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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-2 / +7 lines)
Lines 3-10 Link Here
3
    <div v-else id="agreements_list">
3
    <div v-else id="agreements_list">
4
        <Toolbar v-if="!embedded">
4
        <Toolbar v-if="!embedded">
5
            <ToolbarButton
5
            <ToolbarButton
6
                :to="{ name: 'AgreementsFormAdd' }"
6
                type="add"
7
                icon="plus"
7
                @add-clicked="add_agreement"
8
                :title="$__('New agreement')"
8
                :title="$__('New agreement')"
9
            />
9
            />
10
        </Toolbar>
10
        </Toolbar>
Lines 223-228 export default { Link Here
223
                    })
223
                    })
224
                })
224
                })
225
        },
225
        },
226
        add_agreement: function () {
227
            this.$router.push({
228
                name: "AgreementsFormAdd",
229
            })
230
        },
226
        doShow: function ({ agreement_id }, dt, event) {
231
        doShow: function ({ agreement_id }, dt, event) {
227
            event.preventDefault()
232
            event.preventDefault()
228
            this.$router.push({
233
            this.$router.push({
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue (-17 / +12 lines)
Lines 2-23 Link Here
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
2
    <div v-if="!initialized">{{ $__("Loading") }}</div>
3
    <div v-else id="agreements_show">
3
    <div v-else id="agreements_show">
4
        <Toolbar>
4
        <Toolbar>
5
            <ToolbarButton
5
            <ToolbarButton type="edit" @edit-clicked="edit_agreement" />
6
                :to="{
6
            <ToolbarButton type="delete" @delete-clicked="delete_agreement" />
7
                    name: 'AgreementsFormAddEdit',
8
                    params: { agreement_id: agreement.agreement_id },
9
                }"
10
                class="btn btn-default"
11
                icon="pencil"
12
                :title="$__('Edit')"
13
            />
14
            <a
15
                @click="
16
                    delete_agreement(agreement.agreement_id, agreement.name)
17
                "
18
                class="btn btn-default"
19
                ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a
20
            >
21
        </Toolbar>
7
        </Toolbar>
22
8
23
        <h2>
9
        <h2>
Lines 406-412 export default { Link Here
406
                error => {}
392
                error => {}
407
            )
393
            )
408
        },
394
        },
409
        delete_agreement: function (agreement_id, agreement_name) {
395
        edit_agreement: function () {
396
            this.$router.push({
397
                name: "AgreementsFormAddEdit",
398
                params: { agreement_id: this.agreement.agreement_id },
399
            })
400
        },
401
        delete_agreement: function () {
402
            let agreement_id = this.agreement.agreement_id
403
            let agreement_name = this.agreement.name
404
410
            this.setConfirmationDialog(
405
            this.setConfirmationDialog(
411
                {
406
                {
412
                    title: this.$__(
407
                    title: this.$__(
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue (-3 / +24 lines)
Lines 1-12 Link Here
1
<template>
1
<template>
2
    <router-link :to="to" :class="class"
2
    <a v-if="type === 'add'" @click="click_add" :class="class"
3
        ><font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}</router-link
3
        ><font-awesome-icon icon="plus" /> {{ title }}</a
4
    >
5
    <a v-if="type === 'delete'" @click="click_delete" :class="class"
6
        ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a
7
    >
8
    <a v-if="type === 'edit'" @click="click_edit" :class="class"
9
        ><font-awesome-icon icon="pencil" /> {{ $__("Edit") }}</a
4
    >
10
    >
5
</template>
11
</template>
6
12
7
<script>
13
<script>
8
export default {
14
export default {
9
    props: {
15
    props: {
16
        type: {
17
            type: String,
18
            required: true,
19
        },
10
        to: {
20
        to: {
11
            type: [String, Object],
21
            type: [String, Object],
12
        },
22
        },
Lines 22-27 export default { Link Here
22
            type: String,
32
            type: String,
23
        },
33
        },
24
    },
34
    },
35
    methods: {
36
        click_add() {
37
            this.$emit("add-clicked")
38
        },
39
        click_delete() {
40
            this.$emit("delete-clicked")
41
        },
42
        click_edit() {
43
            this.$emit("edit-clicked")
44
        },
45
    },
46
    emits: ["add-clicked", "delete-clicked", "edit-clicked"],
25
    name: "Toolbar",
47
    name: "Toolbar",
26
}
48
}
27
</script>
49
</script>
28
- 

Return to bug 37301