Bug 30604: Add value builders for UNIMARC 146 ($a, $h and $i)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / moveitem.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Attach an item to [% INCLUDE 'biblio-title-head.inc' %] &rsaquo; Cataloging &rsaquo; Koha</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 </head>
6 <body id="catalog_moveitem" class="catalog">
7 [% INCLUDE 'header.inc' %]
8 [% INCLUDE 'cat-search.inc' %]
9
10 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
11     <ol>
12         <li>
13             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
14         </li>
15         <li>
16             <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
17         </li>
18         <li>
19             [% INCLUDE 'biblio-title.inc' link = 1 %]
20         </li>
21         <li>
22             <a href="#" aria-current="page">
23                 Attach an item
24             </a>
25         </li>
26     </ol>
27 </nav>
28
29 <div class="main container-fluid">
30     <div class="row">
31         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
32
33         <h1>Attach an item [% IF ( biblio.title ) %] to [% INCLUDE 'biblio-title.inc' %][% END %]</h1>
34 [% BLOCK actions %]
35                         [% IF Koha.Preference('IntranetBiblioDefaultView') == 'marc' %]
36                              <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post">
37                         [% ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'labeled_marc' %]
38                              <form action="/cgi-bin/koha/catalogue/labeledMARCdetail.pl" method="post">
39                         [% ELSIF Koha.Preference('IntranetBiblioDefaultView') == 'isbd' %]
40                              <form action="/cgi-bin/koha/catalogue/ISBDdetail.pl" method="post">
41                         [% ELSE %]
42                              <form action="/cgi-bin/koha/catalogue/detail.pl" method="post">
43                         [% END %]
44 [% END %]
45
46 [% BLOCK fail %]
47         <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
48                                 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
49                         </form>
50                                 <form method="get" action="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber | html %]">
51         <button type="submit" class="new"><i class="fa fa-fw fa-plus"></i> Try again with a different barcode</button>
52                                 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
53                         </form>
54 [% END %]
55
56 [% IF ( error ) %]
57     <div class="dialog alert">
58
59                 [% IF ( errornonewitem ) %]ERROR: Unable to create the new item.<p>
60                         [% INCLUDE actions %]
61                         [% INCLUDE fail %]
62         </p>
63                 [% END %]
64
65                 [% IF ( errornoitem ) %]ERROR: Unable to get the item.<p>
66                         [% INCLUDE actions %]
67                         [% INCLUDE fail %]
68                 </p>
69         [% END %]
70     </div>
71
72         [% ELSE %]
73             [% IF ( success ) %]
74             [% IF from_biblio.items.count == 0 && CAN_user_editcatalogue_edit_catalogue %]
75                 <div class="dialog alert" id="del-bib-alert">
76                     <div id="del-bib-action">
77                         The record <em><a class="title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% from_biblio.id | html %]">[% from_biblio.title | html %]</a></em> has [% from_biblio.items.count | html %] attached items.
78                         <p><button id="delete-biblio-btn" data-biblionumber="[% from_biblio.id | html %]"><i id="del-bib-spn" class="fa fa-spinner fa-pulse fa-fw" style="display:none"></i><i class="fa fa-fw fa-trash"></i> Delete record
79                         </button></p>
80                     </div>
81                     <p id="del-bib-result">
82                         <span id="del-bib-success" style="display:none"><i class="fa fa-check success"></i> Record deleted</span>
83                         <span id="del-bib-failure" style="display:none"><i class="fa fa-warning"></i> Attempt to delete record failed.</span>
84                     </p>
85                 </div>
86             [% END %]
87
88             <div class="dialog message">The item has successfully been attached to [% INCLUDE 'biblio-title.inc' link = 1 %].
89                         <p>
90                         [% INCLUDE actions %]
91                     <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
92                                 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
93                         </form>
94                                 <form method="get" action="/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber | html %]"/>
95                     <button type="submit" class="new"><i class="fa fa-fw fa-plus"></i> Attach another item</button>
96                                 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
97                         </form>
98                         </p>
99
100                         </div>
101     [% ELSE %]
102         [% IF ( missingparameter ) %]
103         <form method="post" action="/cgi-bin/koha/cataloguing/moveitem.pl">
104             [% IF ( missingbiblionumber ) %]
105             <fieldset id="biblionumber_fieldset">
106                 <label for="biblionumber">Select the biblionumber to attach the item to</label>
107                         <div class="hint">Enter biblionumber:</div>
108                     <input type="text" name="biblionumber" id="biblionumber" class="focus" size="14" />
109                     <fieldset class="action"><input type="submit" value="Submit" /></fieldset>
110             </fieldset>
111             [% ELSE %]
112             <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
113             [% END %]
114
115                 [% IF ( missingbarcode ) %]
116             <fieldset id="barcode_fieldset">
117                 <label for="barcode">Enter the barcode of the item to attach:</label>
118                     <p class="hint">The item you select will be moved to the target record.</p>
119                     <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
120                     <fieldset class="action"><input type="submit" value="Submit" /></fieldset>
121             </fieldset>
122             [% ELSE %]
123             <input type="hidden" name="barcode" id="barcode" value="[% barcode | html %]" />
124             [% END %]
125
126         </form>
127         [% END %]
128     [% END %]
129 [% END %]
130
131     </div>
132 </div>
133
134 [% MACRO jsinclude BLOCK %]
135     <script>
136         $("#delete-biblio-btn").on("click", function(){
137             if ( confirm(_("Are you sure you want to delete this record?")) ) {
138                 $("#del-bib-spn").show();
139                 let biblionumber = $(this).data('biblionumber');
140                 $.ajax({
141                     url: '/api/v1/biblios/' + biblionumber,
142                     type: 'DELETE',
143                     success: function(result) {
144                         $("#del-bib-action").hide();
145                         $('#del-bib-success').show();
146                         $("#del-bib-alert").attr("class","dialog message")
147                     },
148                     error: function(result) {
149                         $("#delete-biblio-btn").hide();
150                         $('#del-bib-failure').show();
151                     }
152                 });
153             }
154         });
155     </script>
156 [% END %]
157
158 [% INCLUDE 'intranet-bottom.inc' %]