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"
19 :key="type.authorised_values"
20 :value="type.authorised_value"
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">
60 <table :id="table_id"></table>
67 import { inject, createVNode, render } from "vue"
68 import { storeToRefs } from "pinia"
69 import { fetchLocalTitleCount } from "./../../fetch"
74 } from "../../composables/datatables"
78 const vendorStore = inject("vendorStore")
79 const { vendors } = storeToRefs(vendorStore)
81 const AVStore = inject("AVStore")
82 const { av_title_publication_types } = storeToRefs(AVStore)
83 const { get_lib_from_av } = AVStore
85 const table_id = "title_list"
86 useDataTable(table_id)
90 av_title_publication_types,
101 publication_title: this.$route.query.publication_title || "",
102 publication_type: this.$route.query.publication_type || "",
103 selection_type: this.$route.query.selection_type || "",
105 cannot_search: false,
107 local_title_count: null,
113 "/cgi-bin/koha/erm/eholdings/local/titles",
118 beforeRouteEnter(to, from, next) {
124 show_title: function (title_id) {
126 "/cgi-bin/koha/erm/eholdings/ebsco/titles/" + title_id
129 filter_table: async function () {
130 if (this.filters.publication_title.length) {
131 this.cannot_search = false
132 let new_route = build_url(
133 "/cgi-bin/koha/erm/eholdings/ebsco/titles",
136 this.$router.push(new_route)
137 this.show_table = true
138 this.local_title_count = null
139 $("#" + this.table_id)
142 if (this.erm_providers.includes("local")) {
143 this.local_title_count = await fetchLocalTitleCount(
148 this.cannot_search = true
151 build_datatable: function () {
152 let show_title = this.show_title
153 let get_lib_from_av = this.get_lib_from_av
154 if (!this.show_table) {
155 this.show_table = build_url_params(this.filters).length
159 let filters = this.filters
160 let table_id = this.table_id
162 window["vendors"] = this.vendors.map(e => {
164 e["_str"] = e["name"]
167 let vendors_map = this.vendors.reduce((map, e) => {
171 window["av_title_publication_types"] =
172 this.av_title_publication_types.map(e => {
173 e["_id"] = e["authorised_value"]
178 let additional_filters = {
179 publication_title: function () {
180 return filters.publication_title || ""
182 publication_type: function () {
183 return filters.publication_type || ""
185 selection_type: function () {
186 return filters.selection_type || ""
189 $("#" + table_id).kohaTable(
192 url: "/api/v1/erm/eholdings/ebsco/titles",
195 dom: '<"top pager"<"table_entries"ilp>>tr<"bottom pager"ip>',
205 data: "me.publication_title",
208 render: function (data, type, row, meta) {
209 // Rendering done in drawCallback
214 title: __("Publisher name"),
215 data: "me.publisher_name",
218 render: function (data, type, row, meta) {
219 return escape_str(row.publisher_name)
223 title: __("Publication type"),
224 data: "publication_type",
227 render: function (data, type, row, meta) {
230 "av_title_publication_types",
237 title: __("Identifier"),
238 data: "print_identifier:online_identifier",
241 render: function (data, type, row, meta) {
242 let print_identifier = row.print_identifier
243 let online_identifier = row.online_identifier
247 _("ISBN (Print): %s").format(
254 _("ISBN (Online): %s").format(
263 drawCallback: function (settings) {
264 var api = new $.fn.dataTable.Api(settings)
266 if (!api.rows({ search: "applied" }).count()) return
269 $(this).find("tbody tr td:first-child"),
270 function (index, e) {
271 let tr = $(this).parent()
272 let row = api.row(tr).data()
273 if (!row) return // Happen if the table is empty
280 show_title(row.title_id)
283 `${row.publication_title} (#${row.title_id})`
286 if (row.is_selected) {
287 n = createVNode("span", {}, [
291 class: "fa fa-check-square-o",
296 title: __("Is selected"),
310 if (filters.publication_title.length) {
315 name: "EHoldingsEBSCOTitlesList",