4 {{ $__("Publication title") }}:
7 id="publication_title_filter"
8 v-model="filters.publication_title"
9 @keyup.enter="filter_table"
11 {{ $__("Publication type") }}:
13 id="publication_type_filter"
14 v-model="filters.publication_type"
16 <option value="">{{ $__("All") }}</option>
18 v-for="type in av_title_publication_types"
22 {{ type.description }}
25 {{ $__("Selection status") }}:
26 <select id="selection_type_filter" v-model="filters.selection_type">
27 <option value="0">{{ $__("All") }}</option>
28 <option value="1">{{ $__("Selected") }}</option>
29 <option value="2">{{ $__("Not selected") }}</option>
35 :value="$__('Submit')"
37 <span v-if="cannot_search">{{
38 $__("Please enter a search term")
42 <!-- We need to display the table element to initiate DataTable -->
44 id="title_list_result"
45 :style="show_table ? 'display: block' : 'display: none'"
49 local_title_count !== undefined &&
50 local_title_count !== null
53 <router-link :to="local_titles_url">
55 $__("%s titles found locally").format(local_title_count)
59 <div id="title_list_result" class="page-section">
72 import { inject, ref, reactive } from "vue"
73 import { storeToRefs } from "pinia"
74 import { APIClient } from "../../fetch/api-client.js"
75 import { build_url_params, build_url } from "../../composables/datatables"
76 import KohaTable from "../KohaTable.vue"
80 const vendorStore = inject("vendorStore")
81 const { vendors } = storeToRefs(vendorStore)
83 const AVStore = inject("AVStore")
84 const { av_title_publication_types } = storeToRefs(AVStore)
85 const { get_lib_from_av } = AVStore
87 const ERMStore = inject("ERMStore")
88 const { config } = ERMStore
91 const filters = reactive({
92 publication_title: "",
99 av_title_publication_types,
108 publication_title: this.$route.query.publication_title || "",
109 publication_type: this.$route.query.publication_type || "",
110 selection_type: this.$route.query.selection_type || "",
112 let filters = this.filters
118 columns: this.getTableColumns(),
119 url: "/api/v1/erm/eholdings/ebsco/titles",
122 dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>',
130 this.map_av_dt_filter("av_title_publication_types"),
132 actions: { 0: ["show"] },
134 publication_title: function () {
135 return filters.publication_title || ""
137 publication_type: function () {
138 return filters.publication_type || ""
140 selection_type: function () {
141 return filters.selection_type || ""
145 cannot_search: false,
146 show_table: build_url_params(filters).length ? true : false,
147 local_title_count: null,
152 let { href } = this.$router.resolve({
153 name: "EHoldingsLocalTitlesList",
155 return build_url(href, this.filters)
159 doShow: function ({ title_id }, dt, event) {
160 event.preventDefault()
162 name: "EHoldingsEBSCOTitlesShow",
163 params: { title_id },
166 filter_table: async function () {
167 if (this.filters.publication_title.length) {
168 this.cannot_search = false
169 let { href } = this.$router.resolve({
170 name: "EHoldingsEBSCOTitlesList",
172 let new_route = build_url(href, this.filters)
173 this.$router.push(new_route)
174 this.show_table = true
175 this.local_title_count = null
177 if (this.$refs.table) {
178 this.$refs.table.redraw(
179 "/api/v1/erm/eholdings/ebsco/titles"
182 if (this.config.settings.ERMProviders.includes("local")) {
183 const client = APIClient.erm
185 const q = this.filters
187 ...(this.filters.publication_title
189 "me.publication_title": {
192 this.filters.publication_title +
197 ...(this.filters.publication_type
199 "me.publication_type":
200 this.filters.publication_type,
206 client.localTitles.count(q).then(
207 count => (this.local_title_count = count),
212 this.cannot_search = true
215 getTableColumns: function () {
216 let get_lib_from_av = this.get_lib_from_av
217 let escape_str = this.escape_str
221 data: "me.publication_title",
224 render: function (data, type, row, meta) {
226 '<a href="/cgi-bin/koha/erm/eholdings/ebsco/titles/' +
230 `${row.publication_title} (#${row.title_id})`
233 if (row.is_selected) {
236 '<i class="fa fa-check-square" style="color: green; float: right;" title="' +
244 title: __("Publisher name"),
245 data: "me.publisher_name",
248 render: function (data, type, row, meta) {
249 return escape_str(row.publisher_name)
253 title: __("Publication type"),
254 data: "publication_type",
257 render: function (data, type, row, meta) {
260 "av_title_publication_types",
267 title: __("Identifier"),
268 data: "print_identifier:online_identifier",
271 render: function (data, type, row, meta) {
272 let print_identifier = row.print_identifier
273 let online_identifier = row.online_identifier
277 _("ISBN (Print): %s").format(
284 _("ISBN (Online): %s").format(
295 components: { KohaTable },
296 name: "EHoldingsEBSCOTitlesList",