View | Details | Raw Unified | Return to bug 32991
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesList.vue (-5 / +34 lines)
Lines 30-35 export default { Link Here
30
        const { av_title_publication_types } = storeToRefs(AVStore)
30
        const { av_title_publication_types } = storeToRefs(AVStore)
31
        const { get_lib_from_av, map_av_dt_filter } = AVStore
31
        const { get_lib_from_av, map_av_dt_filter } = AVStore
32
32
33
        const { setConfirmationDialog, setMessage } = inject("mainStore")
34
33
        const table_id = "title_list"
35
        const table_id = "title_list"
34
        useDataTable(table_id)
36
        useDataTable(table_id)
35
37
Lines 38-43 export default { Link Here
38
            get_lib_from_av,
40
            get_lib_from_av,
39
            map_av_dt_filter,
41
            map_av_dt_filter,
40
            table_id,
42
            table_id,
43
            setConfirmationDialog,
44
            setMessage,
41
        }
45
        }
42
    },
46
    },
43
    data: function () {
47
    data: function () {
Lines 77-85 export default { Link Here
77
                "/cgi-bin/koha/erm/eholdings/local/titles/edit/" + title_id
81
                "/cgi-bin/koha/erm/eholdings/local/titles/edit/" + title_id
78
            )
82
            )
79
        },
83
        },
80
        delete_title: function (title_id) {
84
        delete_title: function (title_id, title_publication_title) {
81
            this.$router.push(
85
            this.setConfirmationDialog(
82
                "/cgi-bin/koha/erm/eholdings/local/titles/delete/" + title_id
86
                {
87
                    title: this.$__(
88
                        "Are you sure you want to remove this title?"
89
                    ),
90
                    message: title_publication_title,
91
                    accept_label: this.$__("Yes, delete"),
92
                    cancel_label: this.$__("No, do not delete"),
93
                },
94
                () => {
95
                    const client = APIClient.erm
96
                    client.localTitles.delete(title_id).then(
97
                        success => {
98
                            this.setMessage(this.$__("Local title deleted"))
99
                            $("#" + this.table_id)
100
                                .DataTable()
101
                                .ajax.url("/api/v1/erm/eholdings/local/titles")
102
                                .draw()
103
                        },
104
                        error => {}
105
                    )
106
                }
83
            )
107
            )
84
        },
108
        },
85
        build_datatable: function () {
109
        build_datatable: function () {
Lines 193-198 export default { Link Here
193
                            function (index, e) {
217
                            function (index, e) {
194
                                let tr = $(this).parent().parent()
218
                                let tr = $(this).parent().parent()
195
                                let title_id = api.row(tr).data().title_id
219
                                let title_id = api.row(tr).data().title_id
220
                                let title_publication_title = api
221
                                    .row(tr)
222
                                    .data().publication_title
196
                                let editButton = createVNode(
223
                                let editButton = createVNode(
197
                                    "a",
224
                                    "a",
198
                                    {
225
                                    {
Lines 217-223 export default { Link Here
217
                                        class: "btn btn-default btn-xs",
244
                                        class: "btn btn-default btn-xs",
218
                                        role: "button",
245
                                        role: "button",
219
                                        onClick: () => {
246
                                        onClick: () => {
220
                                            delete_title(title_id)
247
                                            delete_title(
248
                                                title_id,
249
                                                title_publication_title
250
                                            )
221
                                        },
251
                                        },
222
                                    },
252
                                    },
223
                                    [
253
                                    [
224
- 

Return to bug 32991