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

(-)a/Koha/REST/V1/Acquisitions/Vendors.pm (+1 lines)
Lines 216-221 sub config { Link Here
216
            gst_values  => \@gst_values,
216
            gst_values  => \@gst_values,
217
            edifact     => C4::Context->preference('EDIFACT'),
217
            edifact     => C4::Context->preference('EDIFACT'),
218
            marc_orders => C4::Context->preference('MarcOrderingAutomation'),
218
            marc_orders => C4::Context->preference('MarcOrderingAutomation'),
219
            erm_module  => C4::Context->preference('ERMModule'),
219
        },
220
        },
220
    );
221
    );
221
}
222
}
(-)a/api/v1/swagger/definitions/vendors_config.yaml (+3 lines)
Lines 16-19 properties: Link Here
16
  marc_orders:
16
  marc_orders:
17
    type: boolean
17
    type: boolean
18
    description: MarcOrderingAutomation system preference value
18
    description: MarcOrderingAutomation system preference value
19
  erm_module:
20
    type: boolean
21
    description: ERMModule system preference value
19
additionalProperties: false
22
additionalProperties: false
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/AgreementsList.vue (+7 lines)
Lines 274-279 export default { Link Here
274
            if (this.filters.by_expired)
274
            if (this.filters.by_expired)
275
                url +=
275
                url +=
276
                    "?max_expiration_date=" + this.filters.max_expiration_date;
276
                    "?max_expiration_date=" + this.filters.max_expiration_date;
277
278
            const vendorId = this.$route.query.vendor_id
279
            if (vendorId) {
280
                url = this.filters.by_expired
281
                    ? url + "&vendor_id=" + vendorId
282
                    : url + "?vendor_id=" + vendorId
283
            }
277
            return url;
284
            return url;
278
        },
285
        },
279
        filter_table: async function () {
286
        filter_table: async function () {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/LicensesList.vue (-1 / +10 lines)
Lines 70-76 export default { Link Here
70
            searchable_av_options: [],
70
            searchable_av_options: [],
71
            tableOptions: {
71
            tableOptions: {
72
                columns: this.getTableColumns(),
72
                columns: this.getTableColumns(),
73
                url: "/api/v1/erm/licenses",
73
                url: this.tableURL(),
74
                options: { embed: "vendor,extended_attributes,+strings" },
74
                options: { embed: "vendor,extended_attributes,+strings" },
75
                table_settings: this.license_table_settings,
75
                table_settings: this.license_table_settings,
76
                add_filters: true,
76
                add_filters: true,
Lines 114-119 export default { Link Here
114
                error => {}
114
                error => {}
115
            );
115
            );
116
        },
116
        },
117
        tableURL() {
118
            let url = "/api/v1/erm/licenses";
119
120
            const vendorId = this.$route.query.vendor_id
121
            if (vendorId) {
122
                url += "?vendor_id=" + vendorId
123
            }
124
            return url
125
        },
117
        async getSearchableAdditionalFields() {
126
        async getSearchableAdditionalFields() {
118
            const client = APIClient.additional_fields;
127
            const client = APIClient.additional_fields;
119
            await client.additional_fields.getAll("license").then(
128
            await client.additional_fields.getAll("license").then(
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Islands/VendorMenu.vue (-4 / +28 lines)
Lines 75-80 Link Here
75
                    >{{ $__("Uncertain prices") }}</a
75
                    >{{ $__("Uncertain prices") }}</a
76
                >
76
                >
77
            </li>
77
            </li>
78
            <li v-if="ermModule && (erm || isUserPermitted('CAN_user_erm'))">
79
                <a
80
                    :href="`/cgi-bin/koha/erm/agreements?vendor_id=${vendorId}`"
81
                    >{{ $__("ERM agreements") }}</a
82
                >
83
            </li>
84
            <li v-if="ermModule && (erm || isUserPermitted('CAN_user_erm'))">
85
                <a :href="`/cgi-bin/koha/erm/licenses?vendor_id=${vendorId}`">{{
86
                    $__("ERM licenses")
87
                }}</a>
88
            </li>
78
        </ul>
89
        </ul>
79
    </div>
90
    </div>
80
</template>
91
</template>
Lines 103-124 export default { Link Here
103
        issuemanage: {
114
        issuemanage: {
104
            type: String,
115
            type: String,
105
        },
116
        },
117
        ermmodule: {
118
            type: String,
119
        },
120
        erm: {
121
            type: String,
122
        },
106
    },
123
    },
107
    setup() {
124
    setup() {
108
        const permissionsStore = inject("permissionsStore");
125
        const permissionsStore = inject("permissionsStore")
109
        const { isUserPermitted } = permissionsStore;
126
        const { isUserPermitted } = permissionsStore
110
        const navigationStore = inject("navigationStore");
127
        const navigationStore = inject("navigationStore")
111
        const { params } = storeToRefs(navigationStore);
128
        const { params } = storeToRefs(navigationStore)
129
        const vendorStore = inject("vendorStore")
130
        const { config } = storeToRefs(vendorStore)
112
131
113
        return {
132
        return {
114
            isUserPermitted,
133
            isUserPermitted,
115
            params,
134
            params,
135
            config,
116
        };
136
        };
117
    },
137
    },
118
    data() {
138
    data() {
119
        const vendorId = this.vendorid || this.params.id;
139
        const vendorId = this.vendorid || this.params.id;
140
        const ermModule = this.ermmodule
141
            ? this.ermmodule
142
            : this.config.settings.ermModule
120
        return {
143
        return {
121
            vendorId,
144
            vendorId,
145
            ermModule,
122
        };
146
        };
123
    },
147
    },
124
    mounted() {
148
    mounted() {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue (-1 / +1 lines)
Lines 66-71 export default { Link Here
66
                client.config.get("vendors").then(config => {
66
                client.config.get("vendors").then(config => {
67
                    this.userPermissions = config.permissions;
67
                    this.userPermissions = config.permissions;
68
                    this.config.settings.edifact = config.edifact;
68
                    this.config.settings.edifact = config.edifact;
69
                    this.config.settings.ermModule = config.erm_module;
69
                    this.config.settings.marcOrderAutomation =
70
                    this.config.settings.marcOrderAutomation =
70
                        config.marcOrderAutomation;
71
                        config.marcOrderAutomation;
71
                    this.vendorStore.currencies = config.currencies;
72
                    this.vendorStore.currencies = config.currencies;
72
- 

Return to bug 38208