Jonathan Druart
2db6bd8a0c
Uncaught Error: [🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia? const pinia = createPinia() app.use(pinia) This will fail in production.
Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
137 lines
4.2 KiB
Vue
137 lines
4.2 KiB
Vue
<template>
|
|
<div v-if="!initialized">{{ $t("Loading") }}</div>
|
|
<div v-else id="licenses_show">
|
|
<h2>
|
|
{{ $t("License .id", { id: license.license_id }) }}
|
|
<span class="action_links">
|
|
<router-link
|
|
:to="`/cgi-bin/koha/erm/licenses/edit/${license.license_id}`"
|
|
:title="$t('Edit')"
|
|
><i class="fa fa-pencil"></i
|
|
></router-link>
|
|
<router-link
|
|
:to="`/cgi-bin/koha/erm/licenses/delete/${license.license_id}`"
|
|
:title="$t('Delete')"
|
|
><i class="fa fa-trash"></i
|
|
></router-link>
|
|
</span>
|
|
</h2>
|
|
<div>
|
|
<fieldset class="rows">
|
|
<ol>
|
|
<li>
|
|
<label>{{ $t("License name") }}:</label>
|
|
<span>
|
|
{{ license.name }}
|
|
</span>
|
|
</li>
|
|
<li>
|
|
<label>{{ $t("Vendor") }}:</label>
|
|
<span v-if="license.vendor_id">
|
|
<a
|
|
:href="`/cgi-bin/koha/acqui/booksellers.pl?booksellerid=${license.vendor_id}`"
|
|
>
|
|
{{ license.vendor.name }}
|
|
</a>
|
|
</span>
|
|
</li>
|
|
<li>
|
|
<label>{{ $t("Description") }}:</label>
|
|
<span>
|
|
{{ license.description }}
|
|
</span>
|
|
</li>
|
|
<li>
|
|
<label>{{ $t("Type") }}:</label>
|
|
<span>{{
|
|
get_lib_from_av("av_license_types", license.type)
|
|
}}</span>
|
|
</li>
|
|
<li>
|
|
<label>{{ $t("Status") }}:</label>
|
|
<span>{{
|
|
get_lib_from_av(
|
|
"av_license_statuses",
|
|
license.status
|
|
)
|
|
}}</span>
|
|
</li>
|
|
|
|
<li>
|
|
<label>{{ $t("Started on") }}:</label>
|
|
<span>{{ format_date(license.started_on) }}</span>
|
|
</li>
|
|
|
|
<li>
|
|
<label>{{ $t("Ended on") }}:</label>
|
|
<span>{{ format_date(license.ended_on) }}</span>
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
<router-link
|
|
to="/cgi-bin/koha/erm/licenses"
|
|
role="button"
|
|
class="cancel"
|
|
>{{ $t("Close") }}</router-link
|
|
>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { inject } from 'vue'
|
|
import { fetchLicense } from "../../fetch"
|
|
|
|
export default {
|
|
setup() {
|
|
const format_date = $date
|
|
|
|
const AVStore = inject('AVStore')
|
|
const { get_lib_from_av } = AVStore
|
|
|
|
return {
|
|
format_date,
|
|
get_lib_from_av,
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
license: {
|
|
license_id: null,
|
|
name: '',
|
|
vendor_id: null,
|
|
vendor: null,
|
|
description: '',
|
|
type: '',
|
|
status: '',
|
|
started_on: undefined,
|
|
ended_on: undefined,
|
|
},
|
|
initialized: false,
|
|
}
|
|
},
|
|
beforeRouteEnter(to, from, next) {
|
|
next(vm => {
|
|
vm.license = vm.getLicense(to.params.license_id)
|
|
})
|
|
},
|
|
methods: {
|
|
async getLicense(license_id) {
|
|
const license = await fetchLicense(license_id)
|
|
this.license = license
|
|
this.initialized = true
|
|
},
|
|
},
|
|
components: {
|
|
},
|
|
name: "LicensesShow",
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
.action_links a {
|
|
padding-left: 0.2em;
|
|
font-size: 11px;
|
|
}
|
|
</style>
|