|
Lines 42-47
export default {
Link Here
|
| 42 |
const vendorStore = inject("vendorStore") |
42 |
const vendorStore = inject("vendorStore") |
| 43 |
|
43 |
|
| 44 |
const AVStore = inject("AVStore") |
44 |
const AVStore = inject("AVStore") |
|
|
45 |
const { initialiseAVStore } = AVStore |
| 45 |
|
46 |
|
| 46 |
const mainStore = inject("mainStore") |
47 |
const mainStore = inject("mainStore") |
| 47 |
|
48 |
|
|
Lines 59-64
export default {
Link Here
|
| 59 |
setError, |
60 |
setError, |
| 60 |
loading, |
61 |
loading, |
| 61 |
loaded, |
62 |
loaded, |
|
|
63 |
initialiseAVStore, |
| 62 |
} |
64 |
} |
| 63 |
}, |
65 |
}, |
| 64 |
data() { |
66 |
data() { |
|
Lines 71-78
export default {
Link Here
|
| 71 |
this.loading() |
73 |
this.loading() |
| 72 |
|
74 |
|
| 73 |
const fetch_config = () => { |
75 |
const fetch_config = () => { |
| 74 |
let promises = [] |
|
|
| 75 |
|
| 76 |
const acq_client = APIClient.acquisition |
76 |
const acq_client = APIClient.acquisition |
| 77 |
acq_client.vendors.getAll().then( |
77 |
acq_client.vendors.getAll().then( |
| 78 |
vendors => { |
78 |
vendors => { |
|
Lines 80-151
export default {
Link Here
|
| 80 |
}, |
80 |
}, |
| 81 |
error => {} |
81 |
error => {} |
| 82 |
) |
82 |
) |
| 83 |
|
83 |
this.initialiseAVStore("erm").then(() => { |
| 84 |
const av_client = APIClient.authorised_values |
84 |
this.loaded() |
| 85 |
const authorised_values = { |
85 |
this.initialized = true |
| 86 |
av_agreement_statuses: "ERM_AGREEMENT_STATUS", |
|
|
| 87 |
av_agreement_closure_reasons: "ERM_AGREEMENT_CLOSURE_REASON", |
| 88 |
av_agreement_renewal_priorities: |
| 89 |
"ERM_AGREEMENT_RENEWAL_PRIORITY", |
| 90 |
av_user_roles: "ERM_USER_ROLES", |
| 91 |
av_license_types: "ERM_LICENSE_TYPE", |
| 92 |
av_license_statuses: "ERM_LICENSE_STATUS", |
| 93 |
av_agreement_license_statuses: "ERM_AGREEMENT_LICENSE_STATUS", |
| 94 |
av_agreement_license_location: "ERM_AGREEMENT_LICENSE_LOCATION", |
| 95 |
av_package_types: "ERM_PACKAGE_TYPE", |
| 96 |
av_package_content_types: "ERM_PACKAGE_CONTENT_TYPE", |
| 97 |
av_title_publication_types: "ERM_TITLE_PUBLICATION_TYPE", |
| 98 |
av_report_types: "ERM_REPORT_TYPES", |
| 99 |
av_platform_reports_metrics: "ERM_PLATFORM_REPORTS_METRICS", |
| 100 |
av_database_reports_metrics: "ERM_DATABASE_REPORTS_METRICS", |
| 101 |
av_title_reports_metrics: "ERM_TITLE_REPORTS_METRICS", |
| 102 |
av_item_reports_metrics: "ERM_ITEM_REPORTS_METRICS", |
| 103 |
} |
| 104 |
|
| 105 |
let av_cat_array = Object.keys(authorised_values).map(function ( |
| 106 |
av_cat |
| 107 |
) { |
| 108 |
return '"' + authorised_values[av_cat] + '"' |
| 109 |
}) |
86 |
}) |
| 110 |
|
|
|
| 111 |
promises.push( |
| 112 |
av_client.values |
| 113 |
.getCategoriesWithValues(av_cat_array) |
| 114 |
.then(av_categories => { |
| 115 |
Object.entries(authorised_values).forEach( |
| 116 |
([av_var, av_cat]) => { |
| 117 |
const av_match = av_categories.find( |
| 118 |
element => element.category_name == av_cat |
| 119 |
) |
| 120 |
this.AVStore[av_var] = |
| 121 |
av_match.authorised_values |
| 122 |
} |
| 123 |
) |
| 124 |
}) |
| 125 |
) |
| 126 |
|
| 127 |
return Promise.all(promises) |
| 128 |
} |
87 |
} |
| 129 |
|
88 |
|
| 130 |
const client = APIClient.erm |
89 |
const client = APIClient.erm |
| 131 |
client.config |
90 |
client.config.get().then(config => { |
| 132 |
.get() |
91 |
this.config = config |
| 133 |
.then(config => { |
92 |
if (this.config.settings.ERMModule != 1) { |
| 134 |
this.config = config |
93 |
return this.setError( |
| 135 |
if (this.config.settings.ERMModule != 1) { |
94 |
this.$__( |
| 136 |
return this.setError( |
95 |
'The e-resource management module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ERMModule">ERMModule</a> to use it' |
| 137 |
this.$__( |
96 |
), |
| 138 |
'The e-resource management module is disabled, turn on <a href="/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ERMModule">ERMModule</a> to use it' |
97 |
false |
| 139 |
), |
98 |
) |
| 140 |
false |
99 |
} |
| 141 |
) |
100 |
return fetch_config() |
| 142 |
} |
101 |
}) |
| 143 |
return fetch_config() |
|
|
| 144 |
}) |
| 145 |
.then(() => { |
| 146 |
this.loaded() |
| 147 |
this.initialized = true |
| 148 |
}) |
| 149 |
}, |
102 |
}, |
| 150 |
methods: { |
103 |
methods: { |
| 151 |
async filterProviders(navigationTree) { |
104 |
async filterProviders(navigationTree) { |