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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Dialog.vue (-3 / +4 lines)
Lines 10-16 Link Here
10
    </div>
10
    </div>
11
    <div class="modal_centered" v-if="confirmation">
11
    <div class="modal_centered" v-if="confirmation">
12
        <div class="dialog alert confirmation">
12
        <div class="dialog alert confirmation">
13
            <h1 v-html="confirmation"></h1>
13
            <h1 v-html="confirmation.title"></h1>
14
            <p v-html="confirmation.message"></p>
14
            <button
15
            <button
15
                v-if="accept_callback"
16
                v-if="accept_callback"
16
                id="accept_modal"
17
                id="accept_modal"
Lines 18-28 Link Here
18
                @click="accept_callback"
19
                @click="accept_callback"
19
            >
20
            >
20
                <i class="fa fa-fw fa-check"></i>
21
                <i class="fa fa-fw fa-check"></i>
21
                {{ $__("Accept") }}
22
                <span v-html="confirmation.accept_label"></span>
22
            </button>
23
            </button>
23
            <button id="close_modal" class="deny" @click="removeMessages">
24
            <button id="close_modal" class="deny" @click="removeMessages">
24
                <i class="fa fa-fw fa-remove"></i>
25
                <i class="fa fa-fw fa-remove"></i>
25
                {{ $__("Close") }}
26
                <span v-html="confirmation.cancel_label"></span>
26
            </button>
27
            </button>
27
        </div>
28
        </div>
28
    </div>
29
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-6 / +16 lines)
Lines 49-55 export default { Link Here
49
        const AVStore = inject("AVStore")
49
        const AVStore = inject("AVStore")
50
        const { get_lib_from_av, map_av_dt_filter } = AVStore
50
        const { get_lib_from_av, map_av_dt_filter } = AVStore
51
51
52
        const { setConfirmation, setMessage } = inject("mainStore")
52
        const { setConfirmationDialog, setMessage } = inject("mainStore")
53
53
54
        const table_id = "agreement_list"
54
        const table_id = "agreement_list"
55
        useDataTable(table_id)
55
        useDataTable(table_id)
Lines 59-65 export default { Link Here
59
            get_lib_from_av,
59
            get_lib_from_av,
60
            map_av_dt_filter,
60
            map_av_dt_filter,
61
            table_id,
61
            table_id,
62
            setConfirmation,
62
            setConfirmationDialog,
63
            setMessage,
63
            setMessage,
64
        }
64
        }
65
    },
65
    },
Lines 114-122 export default { Link Here
114
                "/cgi-bin/koha/erm/agreements/edit/" + agreement_id
114
                "/cgi-bin/koha/erm/agreements/edit/" + agreement_id
115
            )
115
            )
116
        },
116
        },
117
        delete_agreement: function (agreement_id) {
117
        delete_agreement: function (agreement_id, agreement_name) {
118
            this.setConfirmation(
118
            this.setConfirmationDialog(
119
                this.$__("Are you sure you want to remove this agreement?"),
119
                {
120
                    title: this.$__(
121
                        "Are you sure you want to remove this agreement?"
122
                    ),
123
                    message: agreement_name,
124
                    accept_label: this.$__("Yes, delete"),
125
                    cancel_label: this.$__("No, do not delete"),
126
                },
120
                () => {
127
                () => {
121
                    const client = APIClient.erm
128
                    const client = APIClient.erm
122
                    client.agreements.delete(agreement_id).then(
129
                    client.agreements.delete(agreement_id).then(
Lines 338-344 export default { Link Here
338
                                            class: "btn btn-default btn-xs",
345
                                            class: "btn btn-default btn-xs",
339
                                            role: "button",
346
                                            role: "button",
340
                                            onClick: () => {
347
                                            onClick: () => {
341
                                                delete_agreement(agreement_id)
348
                                                delete_agreement(
349
                                                    agreement_id,
350
                                                    api.row(tr).data().name
351
                                                )
342
                                            },
352
                                            },
343
                                        },
353
                                        },
344
                                        [
354
                                        [
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/main.js (-2 / +1 lines)
Lines 35-41 export const useMainStore = defineStore("main", { Link Here
35
            this._confirmation = null;
35
            this._confirmation = null;
36
            this.displayed_already = displayed; /* Is displayed on the current view */
36
            this.displayed_already = displayed; /* Is displayed on the current view */
37
        },
37
        },
38
        setConfirmation(confirmation, accept_callback, displayed = true){
38
        setConfirmationDialog(confirmation, accept_callback, displayed = true){
39
            if(accept_callback) {
39
            if(accept_callback) {
40
                this._accept_callback = async () => {
40
                this._accept_callback = async () => {
41
                    await accept_callback()
41
                    await accept_callback()
42
- 

Return to bug 32991