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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (-6 / +1 lines)
Lines 4-10 Link Here
4
        <Toolbar v-if="!embedded">
4
        <Toolbar v-if="!embedded">
5
            <ToolbarButton
5
            <ToolbarButton
6
                action="add"
6
                action="add"
7
                @addResource="add_agreement"
7
                :to="{ name: 'AgreementsFormAdd' }"
8
                :title="$__('New agreement')"
8
                :title="$__('New agreement')"
9
            />
9
            />
10
        </Toolbar>
10
        </Toolbar>
Lines 174-184 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
        },
182
        doShow: function ({ agreement_id }, dt, event) {
177
        doShow: function ({ agreement_id }, dt, event) {
183
            event.preventDefault()
178
            event.preventDefault()
184
            this.$router.push({
179
            this.$router.push({
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsShow.vue (-7 / +7 lines)
Lines 2-8 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 action="edit" @editResource="edit_agreement" />
5
            <ToolbarButton
6
                action="edit"
7
                :to="{
8
                    name: 'AgreementsFormAddEdit',
9
                    params: { agreement_id: agreement.agreement_id },
10
                }"
11
            />
6
            <ToolbarButton action="delete" @deleteResource="delete_agreement" />
12
            <ToolbarButton action="delete" @deleteResource="delete_agreement" />
7
        </Toolbar>
13
        </Toolbar>
8
14
Lines 383-394 export default { Link Here
383
                error => {}
389
                error => {}
384
            )
390
            )
385
        },
391
        },
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 () {
392
        delete_agreement: function () {
393
            let agreement_id = this.agreement.agreement_id
393
            let agreement_id = this.agreement.agreement_id
394
            let agreement_name = this.agreement.name
394
            let agreement_name = this.agreement.name
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue (-7 / +8 lines)
Lines 1-5 Link Here
1
<template>
1
<template>
2
    <a v-if="action === 'add'" @click="$emit('addResource')" :class="class"
2
    <a v-if="action === 'add'" @click="goTo" :class="class"
3
        ><font-awesome-icon icon="plus" /> {{ title }}</a
3
        ><font-awesome-icon icon="plus" /> {{ title }}</a
4
    >
4
    >
5
    <a
5
    <a
Lines 8-17 Link Here
8
        :class="class"
8
        :class="class"
9
        ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a
9
        ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a
10
    >
10
    >
11
    <a
11
    <a v-else-if="action === 'edit'" @click="goTo" :class="class"
12
        v-else-if="action === 'edit'"
13
        @click="$emit('editResource')"
14
        :class="class"
15
        ><font-awesome-icon icon="pencil" /> {{ $__("Edit") }}</a
12
        ><font-awesome-icon icon="pencil" /> {{ $__("Edit") }}</a
16
    >
13
    >
17
    <span v-else>{{ $__("Unknown action %s").format(action) }}</span>
14
    <span v-else>{{ $__("Unknown action %s").format(action) }}</span>
Lines 19-24 Link Here
19
16
20
<script>
17
<script>
21
export default {
18
export default {
19
    methods: {
20
        goTo: function () {
21
            this.$router.push(this.to)
22
        },
23
    },
22
    props: {
24
    props: {
23
        action: {
25
        action: {
24
            type: String,
26
            type: String,
Lines 39-45 export default { Link Here
39
            type: String,
41
            type: String,
40
        },
42
        },
41
    },
43
    },
42
    emits: ["addResource", "deleteResource", "editResource"],
44
    emits: ["deleteResource"],
43
    name: "Toolbar",
45
    name: "Toolbar",
44
}
46
}
45
</script>
47
</script>
46
- 

Return to bug 37301