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>
type: integer
description: internally assigned identifier
readOnly: true
type: integer
description: internally assigned identifier
readOnly: true
+ vendor_id:
+ description: foreign key to aqbooksellers
+ type:
+ - integer
+ - "null"
publication_title:
description: publication_title of the eHolding
type: string
publication_title:
description: publication_title of the eHolding
type: string
name: eholding_id
required: false
type: integer
name: eholding_id
required: false
type: integer
+ - description: Case insensitive search on eholding vendor_id
+ in: query
+ name: vendor_id
+ required: false
+ type: integer
- description: Case insensitive search on eholding publication_title
in: query
name: publication_title
- description: Case insensitive search on eholding publication_title
in: query
name: publication_title
$dbh->do(q{
CREATE TABLE `erm_eholdings` (
`eholding_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
$dbh->do(q{
CREATE TABLE `erm_eholdings` (
`eholding_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
+ `vendor_id` INT(11) DEFAULT NULL,
`publication_title` VARCHAR(255) DEFAULT NULL,
`print_identifier` VARCHAR(255) DEFAULT NULL,
`online_identifier` VARCHAR(255) DEFAULT NULL,
`publication_title` VARCHAR(255) DEFAULT NULL,
`print_identifier` VARCHAR(255) DEFAULT NULL,
`online_identifier` VARCHAR(255) DEFAULT NULL,
`parent_publication_title_id` VARCHAR(255) DEFAULT NULL,
`preceeding_publication_title_id` VARCHAR(255) DEFAULT NULL,
`access_type` VARCHAR(255) DEFAULT NULL,
`parent_publication_title_id` VARCHAR(255) DEFAULT NULL,
`preceeding_publication_title_id` VARCHAR(255) DEFAULT NULL,
`access_type` VARCHAR(255) DEFAULT NULL,
+ CONSTRAINT `erm_eholdings_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
PRIMARY KEY(`eholding_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
});
PRIMARY KEY(`eholding_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
});
DROP TABLE IF EXISTS `erm_eholdings`;
CREATE TABLE `erm_eholdings` (
`eholding_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
DROP TABLE IF EXISTS `erm_eholdings`;
CREATE TABLE `erm_eholdings` (
`eholding_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
+ `vendor_id` INT(11) DEFAULT NULL,
`publication_title` VARCHAR(255) DEFAULT NULL,
`print_identifier` VARCHAR(255) DEFAULT NULL,
`online_identifier` VARCHAR(255) DEFAULT NULL,
`publication_title` VARCHAR(255) DEFAULT NULL,
`print_identifier` VARCHAR(255) DEFAULT NULL,
`online_identifier` VARCHAR(255) DEFAULT NULL,
`parent_publication_title_id` VARCHAR(255) DEFAULT NULL,
`preceeding_publication_title_id` VARCHAR(255) DEFAULT NULL,
`access_type` VARCHAR(255) DEFAULT NULL,
`parent_publication_title_id` VARCHAR(255) DEFAULT NULL,
`preceeding_publication_title_id` VARCHAR(255) DEFAULT NULL,
`access_type` VARCHAR(255) DEFAULT NULL,
+ CONSTRAINT `erm_eholdings_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
PRIMARY KEY(`eholding_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
PRIMARY KEY(`eholding_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+ <label for="eholding_vendor_id">{{
+ $t("Vendor:")
+ }}</label>
+ <select
+ id="eholding_vendor_id"
+ v-model="eholding.vendor_id"
+ >
+ <option value=""></option>
+ <option
+ v-for="vendor in vendors"
+ :key="vendor.vendor_id"
+ :value="vendor.id"
+ :selected="
+ vendor.id == eholding.vendor_id
+ ? true
+ : false
+ "
+ >
+ {{ vendor.name }}
+ </option>
+ </select>
+ </li>
+
+ <li>
<label for="eholding_print_identifier">{{
$t("Print-format identifier:")
}}</label>
<label for="eholding_print_identifier">{{
$t("Print-format identifier:")
}}</label>
+import { useVendorStore } from "../../stores/vendors"
import EHoldingPackages from "./EHoldingPackages.vue"
import { setMessage, setError } from "../../messages"
import { fetchEHolding } from '../../fetch'
import EHoldingPackages from "./EHoldingPackages.vue"
import { setMessage, setError } from "../../messages"
import { fetchEHolding } from '../../fetch'
+import { storeToRefs } from "pinia"
export default {
setup() {
export default {
setup() {
+ const vendorStore = useVendorStore()
+ const { vendors } = storeToRefs(vendorStore)
+
+ return {
+ vendors,
+ }
},
data() {
return {
eholding: {
eholding_id: null,
},
data() {
return {
eholding: {
eholding_id: null,
publication_title: '',
print_identifier: '',
online_identifier: '',
publication_title: '',
print_identifier: '',
online_identifier: '',
<script>
import Toolbar from "./EHoldingsToolbar.vue"
import { createVNode, render } from 'vue'
<script>
import Toolbar from "./EHoldingsToolbar.vue"
import { createVNode, render } from 'vue'
+import { useVendorStore } from "../../stores/vendors"
+import { storeToRefs } from "pinia"
import { fetchEHoldings } from "../../fetch"
export default {
import { fetchEHoldings } from "../../fetch"
export default {
+ setup() {
+ const vendorStore = useVendorStore()
+ const { vendors } = storeToRefs(vendorStore)
+
+ return {
+ vendors,
+ }
+ },
data: function () {
return {
eholdings: [],
data: function () {
return {
eholdings: [],
let edit_eholding = this.edit_eholding
let delete_eholding = this.delete_eholding
let edit_eholding = this.edit_eholding
let delete_eholding = this.delete_eholding
+ window['vendors'] = this.vendors.map(e => {
+ e['_id'] = e['id']
+ e['_str'] = e['name']
+ return e
+ })
+ let vendors_map = this.vendors.reduce((map, e) => {
+ map[e.id] = e
+ return map
+ }, {})
+
$('#eholding_list').kohaTable({
"ajax": {
"url": eholdings_table_url,
$('#eholding_list').kohaTable({
"ajax": {
"url": eholdings_table_url,
// Rendering done in drawCallback
},
{
// Rendering done in drawCallback
},
{
+ "title": __("Vendor"),
+ "data": "vendor_id",
+ "searchable": true,
+ "orderable": true,
+ "render": function (data, type, row, meta) {
+ return row.vendor_id != undefined ? escape_str(vendors_map[row.vendor_id].name) : ""
+ }
+ },
+ {
"title": __("Publication type"),
"data": "publication_type",
"searchable": true,
"title": __("Publication type"),
"data": "publication_type",
"searchable": true,
"render": function (data, type, row, meta) {
let print_identifier = row.print_identifier
let online_identifier = row.online_identifier
"render": function (data, type, row, meta) {
let print_identifier = row.print_identifier
let online_identifier = row.online_identifier
- return ( print_identifier ? escape_str(_("ISBN (Print): %s").format(print_identifier)) : "" ) +
- ( online_identifier ? escape_str(_("ISBN (Online): %s").format(online_identifier)) : "" )
+ return (print_identifier ? escape_str(_("ISBN (Print): %s").format(print_identifier)) : "") +
+ (online_identifier ? escape_str(_("ISBN (Online): %s").format(online_identifier)) : "")
+ preDrawCallback: function (settings) {
+ var table_id = settings.nTable.id
+ $("#" + table_id).find("thead th").eq(2).attr('data-filter', 'vendors')
+ }
}, eholding_table_settings, 1)
},
beforeUnmount() {
}, eholding_table_settings, 1)
},
beforeUnmount() {
+ <label>{{ $t("Vendor:") }}</label>
+ <span v-if="eholding.vendor_id">
+ {{
+ vendors.find((e) => e.id == eholding.vendor_id)
+ .name
+ }}
+ </span>
+ </li>
+ <li>
<label>{{ $t("Print-format identifier:") }}</label>
<span>
{{ eholding.print_identifier }}
<label>{{ $t("Print-format identifier:") }}</label>
<span>
{{ eholding.print_identifier }}
<script>
import { fetchEHolding } from "../../fetch"
<script>
import { fetchEHolding } from "../../fetch"
+import { useVendorStore } from "../../stores/vendors"
+import { storeToRefs } from "pinia"
export default {
setup() {
export default {
setup() {
+ const vendorStore = useVendorStore()
+ const { vendors } = storeToRefs(vendorStore)
+
+ return {
+ vendors,
+ }
},
data() {
return {
eholding: {
eholding_id: null,
},
data() {
return {
eholding: {
eholding_id: null,
publication_title: '',
print_identifier: '',
online_identifier: '',
publication_title: '',
print_identifier: '',
online_identifier: '',