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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/DropdownButtons.vue (+1 lines)
Lines 12-17 Link Here
12
                    :to="item.to"
12
                    :to="item.to"
13
                    :title="$__(item.title)"
13
                    :title="$__(item.title)"
14
                    :callback="item.callback"
14
                    :callback="item.callback"
15
                    :cssClass="'dropdown-item'"
15
                />
16
                />
16
            </li>
17
            </li>
17
        </ul>
18
        </ul>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ToolbarButton.vue (-22 / +29 lines)
Lines 1-16 Link Here
1
<template>
1
<template>
2
    <a
2
    <a
3
        v-if="callback"
3
        v-if="callback"
4
        @click="typeof callback === 'string' ? redirect() : callback"
4
        @click="typeof callback === 'string' ? redirect() : callback(this)"
5
        class="btn btn-default"
5
        :class="cssClass"
6
        style="cursor: pointer"
6
        style="cursor: pointer"
7
    >
7
    >
8
        <font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}
8
        <font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}
9
    </a>
9
    </a>
10
    <router-link
10
    <router-link v-else :to="to" :class="cssClass"
11
        v-else
12
        :to="to"
13
        class="btn btn-default"
14
        ><font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}</router-link
11
        ><font-awesome-icon v-if="icon" :icon="icon" /> {{ title }}</router-link
15
    >
12
    >
16
</template>
13
</template>
Lines 32-55 export default { Link Here
32
            type: [String, Function],
29
            type: [String, Function],
33
            required: false,
30
            required: false,
34
        },
31
        },
32
        cssClass: {
33
            type: String,
34
            default: "btn btn-default",
35
            required: false,
36
        },
35
    },
37
    },
36
    methods: {
38
    methods: {
37
        redirect() {
39
        redirect(url) {
38
            if (typeof this.to === "string")
40
            const redirectParams = url ? url : this.to;
39
                window.location.href = this.formatUrl(this.to);
41
            if (typeof redirectParams === "string")
40
            if (typeof this.to === "object") {
42
                window.location.href = this.formatUrl(redirectParams);
41
                let url = this.to.path;
43
            if (typeof redirectParams === "object") {
42
                if (this.to.hasOwnProperty("query")) {
44
                const url = this.handleQuery(redirectParams);
43
                    url +=
45
                window.open(this.formatUrl(url), "_blank");
44
                        "?" +
45
                        Object.keys(this.to.query)
46
                            .map(
47
                                queryParam =>
48
                                    `${queryParam}=${this.to.query[queryParam]}`
49
                            )
50
                            .join("&");
51
                }
52
                window.open(this.formatUrl(url, this.to.internal), "_blank");
53
            }
46
            }
54
        },
47
        },
55
        formatUrl(url) {
48
        formatUrl(url) {
Lines 58-63 export default { Link Here
58
                return `//${window.location.host}/${url}`;
51
                return `//${window.location.host}/${url}`;
59
            return `//${url}`;
52
            return `//${url}`;
60
        },
53
        },
54
        handleQuery(query) {
55
            let url = this.to.path;
56
            if (this.to.hasOwnProperty("query")) {
57
                url +=
58
                    "?" +
59
                    Object.keys(this.to.query)
60
                        .map(
61
                            queryParam =>
62
                                `${queryParam}=${this.to.query[queryParam]}`
63
                        )
64
                        .join("&");
65
            }
66
            return url;
67
        },
61
    },
68
    },
62
    name: "ToolbarButton",
69
    name: "ToolbarButton",
63
};
70
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue (-6 / +10 lines)
Lines 46-64 Link Here
46
                <span class="label">{{ $__("Acquisitions options") }}:</span>
46
                <span class="label">{{ $__("Acquisitions options") }}:</span>
47
                <ol>
47
                <ol>
48
                    <li v-if="contact.acqprimary">
48
                    <li v-if="contact.acqprimary">
49
                        <span
49
                        <span class="contact_details"
50
                            ><i class="fa fa-check"></i>
50
                            ><i class="fa fa-check"></i>
51
                            {{ $__("Primary acquisitions contact") }}</span
51
                            {{ $__("Primary acquisitions contact") }}</span
52
                        >
52
                        >
53
                    </li>
53
                    </li>
54
                    <li v-if="contact.orderacquisition">
54
                    <li v-if="contact.orderacquisition">
55
                        <span
55
                        <span class="contact_details"
56
                            ><i class="fa fa-check"></i>
56
                            ><i class="fa fa-check"></i>
57
                            {{ $__("Receives orders") }}</span
57
                            {{ $__("Receives orders") }}</span
58
                        >
58
                        >
59
                    </li>
59
                    </li>
60
                    <li v-if="contact.claimacquisition">
60
                    <li v-if="contact.claimacquisition">
61
                        <span
61
                        <span class="contact_details"
62
                            ><i class="fa fa-check"></i>
62
                            ><i class="fa fa-check"></i>
63
                            {{ $__("Receives claims for late orders") }}</span
63
                            {{ $__("Receives claims for late orders") }}</span
64
                        >
64
                        >
Lines 69-81 Link Here
69
                <span class="label">{{ $__("Serials options") }}:</span>
69
                <span class="label">{{ $__("Serials options") }}:</span>
70
                <ol>
70
                <ol>
71
                    <li v-if="contact.serialsprimary">
71
                    <li v-if="contact.serialsprimary">
72
                        <span
72
                        <span class="contact_details"
73
                            ><i class="fa fa-check"></i>
73
                            ><i class="fa fa-check"></i>
74
                            {{ $__("Primary serials contact") }}</span
74
                            {{ $__("Primary serials contact") }}</span
75
                        >
75
                        >
76
                    </li>
76
                    </li>
77
                    <li v-if="contact.claimissues">
77
                    <li v-if="contact.claimissues">
78
                        <span
78
                        <span class="contact_details"
79
                            ><i class="fa fa-check"></i>
79
                            ><i class="fa fa-check"></i>
80
                            {{ $__("Receives claims for late issues") }}</span
80
                            {{ $__("Receives claims for late issues") }}</span
81
                        >
81
                        >
Lines 281-284 export default { Link Here
281
};
281
};
282
</script>
282
</script>
283
283
284
<style></style>
284
<style scoped>
285
.contact_details {
286
    margin-left: 9em;
287
}
288
</style>
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue (-1 / +1 lines)
Lines 49-55 Link Here
49
                    :to="{
49
                    :to="{
50
                        path: vendor.url,
50
                        path: vendor.url,
51
                    }"
51
                    }"
52
                    class=""
52
                    :cssClass="''"
53
                    :title="vendor.url"
53
                    :title="vendor.url"
54
                    callback="redirect"
54
                    callback="redirect"
55
                />
55
                />
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue (-1 / +1 lines)
Lines 17-23 Link Here
17
                    :to="{
17
                    :to="{
18
                        path: vi.uri,
18
                        path: vi.uri,
19
                    }"
19
                    }"
20
                    class=""
20
                    :cssClass="''"
21
                    :title="vi.uri"
21
                    :title="vi.uri"
22
                    callback="redirect"
22
                    callback="redirect"
23
                />
23
                />
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue (-3 / +12 lines)
Lines 10-16 Link Here
10
                            query: { booksellerid: vendor.id, op: 'add_form' },
10
                            query: { booksellerid: vendor.id, op: 'add_form' },
11
                        },
11
                        },
12
                        title: 'Basket',
12
                        title: 'Basket',
13
                        callback: 'redirect',
13
                        callback: toolbarComponent => {
14
                            const url = toolbarComponent.handleQuery(
15
                                toolbarComponent.to
16
                            );
17
                            toolbarComponent.redirect(url);
18
                        },
14
                    },
19
                    },
15
                    {
20
                    {
16
                        to: {
21
                        to: {
Lines 18-24 Link Here
18
                            query: { booksellerid: vendor.id, op: 'add_form' },
23
                            query: { booksellerid: vendor.id, op: 'add_form' },
19
                        },
24
                        },
20
                        title: 'Contract',
25
                        title: 'Contract',
21
                        callback: 'redirect',
26
                        callback: toolbarComponent => {
27
                            const url = toolbarComponent.handleQuery(
28
                                toolbarComponent.to
29
                            );
30
                            toolbarComponent.redirect(url);
31
                        },
22
                    },
32
                    },
23
                    {
33
                    {
24
                        to: { name: 'VendorFormAdd' },
34
                        to: { name: 'VendorFormAdd' },
25
- 

Return to bug 38010