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 174-179 export default { Link Here
174
                error => {}
174
                error => {}
175
            )
175
            )
176
        },
176
        },
177
        add_agreement: function () {
178
            this.$router.push({
179
                name: "AgreementsFormAdd",
180
            })
181
        },
177
        doShow: function ({ agreement_id }, dt, event) {
182
        doShow: function ({ agreement_id }, dt, event) {
178
            event.preventDefault()
183
            event.preventDefault()
179
            this.$router.push({
184
            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 397-403 export default { Link Here
397
                error => {}
383
                error => {}
398
            )
384
            )
399
        },
385
        },
400
        delete_agreement: function (agreement_id, agreement_name) {
386
        edit_agreement: function () {
387
            this.$router.push({
388
                name: "AgreementsFormAddEdit",
389
                params: { agreement_id: this.agreement.agreement_id },
390
            })
391
        },
392
        delete_agreement: function () {
393
            let agreement_id = this.agreement.agreement_id
394
            let agreement_name = this.agreement.name
395
401
            this.setConfirmationDialog(
396
            this.setConfirmationDialog(
402
                {
397
                {
403
                    title: this.$__(
398
                    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