Bug 32030: Add users to licenses - Preparation
[koha-ffzg.git] / koha-tmpl / intranet-tmpl / prog / js / vue / components / ERM / EHoldingsLocalTitlesShow.vue
1 <template>
2     <div v-if="!initialized">{{ $__("Loading") }}</div>
3     <div v-else-if="title" id="eholdings_title_show">
4         <h2>
5             {{ $__("Title #%s").format(title.title_id) }}
6             <span class="action_links">
7                 <router-link
8                     :to="`/cgi-bin/koha/erm/eholdings/local/titles/edit/${title.title_id}`"
9                     :title="$__('Edit')"
10                     ><i class="fa fa-pencil"></i
11                 ></router-link>
12
13                 <router-link
14                     :to="`/cgi-bin/koha/erm/eholdings/local/titles/delete/${title.title_id}`"
15                     :title="$__('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>{{ $__("Title identifier") }}:</label>
25                         <span>
26                             {{ title.title_id }}
27                         </span>
28                     </li>
29                     <li>
30                         <label>{{ $__("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                                 {{ $__("Local bibliographic record") }}
38                             </a>
39                         </span>
40                     </li>
41                     <li v-if="title.print_identifier">
42                         <label>{{ $__("Print-format identifier") }}:</label>
43                         <span>
44                             {{ title.print_identifier }}
45                         </span>
46                     </li>
47                     <li v-if="title.online_identifier">
48                         <label>{{ $__("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                                 $__(
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                                 $__("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                                 $__("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                                 $__("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                                 $__("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                                 $__("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>{{ $__("Title-level URL") }}:</label>
117                         <span>
118                             {{ title.title_url }}
119                         </span>
120                     </li>
121                     <li v-if="title.first_author">
122                         <label>{{ $__("First author") }}:</label>
123                         <span>
124                             {{ title.first_author }}
125                         </span>
126                     </li>
127                     <li v-if="title.embargo_info">
128                         <label>{{ $__("Embargo information") }}:</label>
129                         <span>
130                             {{ title.embargo_info }}
131                         </span>
132                     </li>
133                     <li v-if="title.coverage_depth">
134                         <label>{{ $__("Coverage depth") }}:</label>
135                         <span>
136                             {{ title.coverage_depth }}
137                         </span>
138                     </li>
139                     <li v-if="title.notes">
140                         <label>{{ $__("Notes") }}:</label>
141                         <span>
142                             {{ title.notes }}
143                         </span>
144                     </li>
145                     <li v-if="title.publisher_name">
146                         <label>{{ $__("Publisher name") }}:</label>
147                         <span>
148                             {{ title.publisher_name }}
149                         </span>
150                     </li>
151                     <li v-if="title.publication_type">
152                         <label>{{ $__("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                                 $__(
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                                 $__(
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                             >{{ $__("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>{{ $__("Edition of the monograph") }}:</label>
196                         <span>
197                             {{ title.monograph_edition }}
198                         </span>
199                     </li>
200                     <li v-if="title.first_editor">
201                         <label>{{ $__("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                                 $__(
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                                 $__(
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>{{ $__("Access 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/local/titles"
249                     role="button"
250                     class="cancel"
251                     >{{ $__("Close") }}</router-link
252                 >
253             </fieldset>
254         </div>
255     </div>
256 </template>
257
258 <script>
259 import { inject } from "vue"
260 import EHoldingsTitlePackagesList from "./EHoldingsLocalTitlePackagesList.vue"
261 import { fetchLocalTitle } from "../../fetch"
262 export default {
263     setup() {
264         const AVStore = inject("AVStore")
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     beforeRouteEnter(to, from, next) {
306         next(vm => {
307             vm.getTitle(to.params.title_id)
308         })
309     },
310     beforeRouteUpdate(to, from) {
311         this.title = this.getTitle(to.params.title_id)
312     },
313     methods: {
314         async getTitle(title_id) {
315             const title = await fetchLocalTitle(title_id)
316             this.title = title
317             this.initialized = true
318         },
319     },
320     components: {
321         EHoldingsTitlePackagesList,
322     },
323     name: "EHoldingsLocalTitlesShow",
324 }
325 </script>
326 <style scoped>
327 .action_links a {
328     padding-left: 0.2em;
329     font-size: 11px;
330 }
331 fieldset.rows label {
332     width: 25rem;
333 }
334 </style>