24fadecb4da06d5188521478935567da2259aa6b
[srvgit] / koha-tmpl / intranet-tmpl / prog / js / vue / components / ERM / EHoldingsTitlesShow.vue
1 <template>
2     <div v-if="!initialized">{{ $t("Loading") }}</div>
3     <div v-else-if="title" id="eholdings_title_show">
4         <h2>
5             {{ $t("Title .id", { id: title.title_id }) }}
6             <span v-if="erm_provider == 'manual'" class="action_links">
7                 <router-link
8                     :to="`/cgi-bin/koha/erm/eholdings/titles/edit/${title.title_id}`"
9                     :title="$t('Edit')"
10                     ><i class="fa fa-pencil"></i
11                 ></router-link>
12
13                 <router-link
14                     :to="`/cgi-bin/koha/erm/eholdings/titles/delete/${title.title_id}`"
15                     :title="$t('Delete')"
16                     ><i class="fa fa-trash"></i
17                 ></router-link>
18             </span>
19         </h2>
20         <div>
21             <fieldset class="rows">
22                 <ol>
23                     <li v-if="title.title_id">
24                         <label>{{ $t("Title identifier") }}:</label>
25                         <span>
26                             {{ title.title_id }}
27                         </span>
28                     </li>
29                     <li>
30                         <label>{{ $t("Publication title") }}:</label>
31                         <span>
32                             {{ title.publication_title }}
33                             <a
34                                 v-if="title.biblio_id"
35                                 :href="`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${title.biblio_id}`"
36                             >
37                                 {{ $t("Local bibliographic record") }}
38                             </a>
39                         </span>
40                     </li>
41                     <li v-if="title.print_identifier">
42                         <label>{{ $t("Print-format identifier") }}:</label>
43                         <span>
44                             {{ title.print_identifier }}
45                         </span>
46                     </li>
47                     <li v-if="title.online_identifier">
48                         <label>{{ $t("Online-format identifier") }}:</label>
49                         <span>
50                             {{ title.online_identifier }}
51                         </span>
52                     </li>
53                     <li v-if="title.date_first_issue_online">
54                         <label
55                             >{{
56                                 $t(
57                                     "Date of first serial issue available online"
58                                 )
59                             }}:</label
60                         >
61                         <span>
62                             {{ title.date_first_issue_online }}
63                         </span>
64                     </li>
65                     <li v-if="title.num_first_vol_online">
66                         <label
67                             >{{
68                                 $t("Number of first volume available online")
69                             }}:</label
70                         >
71                         <span>
72                             {{ title.num_first_vol_online }}
73                         </span>
74                     </li>
75                     <li v-if="title.num_first_issue_online">
76                         <label
77                             >{{
78                                 $t("Number of first issue available online")
79                             }}:</label
80                         >
81                         <span>
82                             {{ title.num_first_issue_online }}
83                         </span>
84                     </li>
85                     <li v-if="title.date_last_issue_online">
86                         <label
87                             >{{
88                                 $t("Date of last issue available online")
89                             }}:</label
90                         >
91                         <span>
92                             {{ title.date_last_issue_online }}
93                         </span>
94                     </li>
95                     <li v-if="title.num_last_vol_online">
96                         <label
97                             >{{
98                                 $t("Number of last volume available online")
99                             }}:</label
100                         >
101                         <span>
102                             {{ title.num_last_vol_online }}
103                         </span>
104                     </li>
105                     <li v-if="title.num_last_issue_online">
106                         <label
107                             >{{
108                                 $t("Number of last issue available online")
109                             }}:</label
110                         >
111                         <span>
112                             {{ title.num_last_issue_online }}
113                         </span>
114                     </li>
115                     <li v-if="title.title_url">
116                         <label>{{ $t("Title-level URL") }}:</label>
117                         <span>
118                             {{ title.title_url }}
119                         </span>
120                     </li>
121                     <li v-if="title.first_author">
122                         <label>{{ $t("First author") }}:</label>
123                         <span>
124                             {{ title.first_author }}
125                         </span>
126                     </li>
127                     <li v-if="title.embargo_info">
128                         <label>{{ $t("Embargo information") }}:</label>
129                         <span>
130                             {{ title.embargo_info }}
131                         </span>
132                     </li>
133                     <li v-if="title.coverage_depth">
134                         <label>{{ $t("Coverage depth") }}:</label>
135                         <span>
136                             {{ title.coverage_depth }}
137                         </span>
138                     </li>
139                     <li v-if="title.notes">
140                         <label>{{ $t("Notes") }}:</label>
141                         <span>
142                             {{ title.notes }}
143                         </span>
144                     </li>
145                     <li v-if="title.publisher_name">
146                         <label>{{ $t("Publisher name") }}:</label>
147                         <span>
148                             {{ title.publisher_name }}
149                         </span>
150                     </li>
151                     <li v-if="title.publication_type">
152                         <label>{{ $t("Publication type") }}:</label>
153                         <span
154                             >{{
155                                 get_lib_from_av(
156                                     "av_title_publication_types",
157                                     title.publication_type
158                                 )
159                             }}
160                         </span>
161                     </li>
162                     <li v-if="title.date_monograph_published_print">
163                         <label
164                             >{{
165                                 $t(
166                                     "Date the monograph is first published in print"
167                                 )
168                             }}:</label
169                         >
170                         <span>
171                             {{ title.date_monograph_published_print }}
172                         </span>
173                     </li>
174                     <li v-if="title.date_monograph_published_online">
175                         <label
176                             >{{
177                                 $t(
178                                     "Date the monograph is first published online"
179                                 )
180                             }}:</label
181                         >
182                         <span>
183                             {{ title.date_monograph_published_online }}
184                         </span>
185                     </li>
186                     <li v-if="title.monograph_volume">
187                         <label
188                             >{{ $t("Number of volume for monograph") }}:</label
189                         >
190                         <span>
191                             {{ title.monograph_volume }}
192                         </span>
193                     </li>
194                     <li v-if="title.monograph_edition">
195                         <label>{{ $t("Edition of the monograph") }}:</label>
196                         <span>
197                             {{ title.monograph_edition }}
198                         </span>
199                     </li>
200                     <li v-if="title.first_editor">
201                         <label>{{ $t("First editor") }}:</label>
202                         <span>
203                             {{ title.first_editor }}
204                         </span>
205                     </li>
206                     <li v-if="title.parent_publication_title_id">
207                         <label
208                             >{{
209                                 $t(
210                                     "Title identifier of the parent publication"
211                                 )
212                             }}:</label
213                         >
214                         <span>
215                             {{ title.parent_publication_title_id }}
216                         </span>
217                     </li>
218                     <li v-if="title.preceeding_publication_title_id">
219                         <label
220                             >{{
221                                 $t(
222                                     "Title identifier of any preceding publication title"
223                                 )
224                             }}:</label
225                         >
226                         <span>
227                             {{ title.preceeding_publication_title_id }}
228                         </span>
229                     </li>
230                     <li v-if="title.access_type">
231                         <label>{{ $t("Acces type") }}:</label>
232                         <span>
233                             {{ title.access_type }}
234                         </span>
235                     </li>
236                     <li>
237                         <label>Packages ({{ title.resources.length }})</label>
238                         <div v-if="title.resources.length">
239                             <EHoldingsTitlePackagesList
240                                 :resources="title.resources"
241                             />
242                         </div>
243                     </li>
244                 </ol>
245             </fieldset>
246             <fieldset class="action">
247                 <router-link
248                     to="/cgi-bin/koha/erm/eholdings/titles"
249                     role="button"
250                     class="cancel"
251                     >{{ $t("Close") }}</router-link
252                 >
253             </fieldset>
254         </div>
255     </div>
256 </template>
257
258 <script>
259 import EHoldingsTitlePackagesList from "./EHoldingsTitlePackagesList.vue"
260 import { fetchTitle } from "../../fetch"
261 import { useAVStore } from "../../stores/authorised_values"
262 export default {
263     setup() {
264         const AVStore = useAVStore()
265         const { get_lib_from_av } = AVStore
266
267         return {
268             get_lib_from_av,
269         }
270     },
271     data() {
272         return {
273             title: {
274                 title_id: null,
275                 publication_title: '',
276                 external_id: '',
277                 print_identifier: '',
278                 online_identifier: '',
279                 date_first_issue_online: '',
280                 num_first_vol_online: '',
281                 num_first_issue_online: '',
282                 date_last_issue_online: '',
283                 num_last_vol_online: '',
284                 num_last_issue_online: '',
285                 title_url: '',
286                 first_author: '',
287                 embargo_info: '',
288                 coverage_depth: '',
289                 notes: '',
290                 publisher_name: '',
291                 publication_type: '',
292                 date_monograph_published_print: '',
293                 date_monograph_published_online: '',
294                 monograph_volume: '',
295                 monograph_edition: '',
296                 first_editor: '',
297                 parent_publication_title_id: '',
298                 preceeding_publication_title_id: '',
299                 access_type: '',
300                 resources: [],
301             },
302             initialized: false,
303         }
304     },
305     inject: ['erm_provider'],
306     beforeRouteEnter(to, from, next) {
307         next(vm => {
308             vm.getTitle(to.params.title_id)
309         })
310     },
311     beforeRouteUpdate(to, from) {
312         this.title = this.getTitle(to.params.title_id)
313     },
314     methods: {
315         async getTitle(title_id) {
316             const title = await fetchTitle(title_id)
317             this.title = title
318             this.initialized = true
319         },
320     },
321     components: {
322         EHoldingsTitlePackagesList,
323     },
324     name: "EHoldingsTitlesShow",
325 }
326 </script>
327 <style scoped>
328 .action_links a {
329     padding-left: 0.2em;
330     font-size: 11px;
331 }
332 fieldset.rows label {
333     width: 25rem;
334 }
335 </style>