View | Details | Raw Unified | Return to bug 38942
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css (-1 / +11 lines)
Lines 326-331 tbody tr.active td { Link Here
326
    width: 15em;
326
    width: 15em;
327
}
327
}
328
328
329
#item-template-toolbar div:has(label[for="use_template_for_session"]) {
330
    display: flex;
331
    align-items: center;
332
}
333
334
#item-template-toolbar div:has(label[for="use_template_for_session"])::after {
335
    content: "|";
336
    padding-left: 7px;
337
}
338
329
#toolbar {
339
#toolbar {
330
    padding: 5px 0;
340
    padding: 5px 0;
331
}
341
}
Lines 521-524 tbody tr.active td { Link Here
521
    font-size: 100%;
531
    font-size: 100%;
522
    font-weight: bold;
532
    font-weight: bold;
523
    padding: 0;
533
    padding: 0;
524
}
534
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-356 / +312 lines)
Lines 7-25 Link Here
7
[% USE TablesSettings %]
7
[% USE TablesSettings %]
8
[% PROCESS 'i18n.inc' %]
8
[% PROCESS 'i18n.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
<title
10
<title>[% FILTER collapse %]
11
    >[% FILTER collapse %]
11
    [% t("Items") | html %] &rsaquo;
12
        [% t("Items") | html %]
12
    [% IF ( biblio.author ) %]
13
        &rsaquo;
13
        [% tx("{title} by {author}", { title = biblio.title, author = biblio.author }) | html %]
14
        [% IF ( biblio.author ) %]
14
    [% ELSE %]
15
            [% tx("{title} by {author}", { title = biblio.title, author = biblio.author }) | html %]
15
        [% biblio.title | html %]
16
        [% ELSE %]
16
    [% END %]
17
            [% biblio.title | html %]
17
    [% tx("(Record #{biblionumber})", { biblionumber = biblio.biblionumber }) | html %] &rsaquo;
18
        [% END %]
18
    [% t("Cataloging") | html %] &rsaquo;
19
        [% tx("(Record #{biblionumber})", { biblionumber = biblio.biblionumber }) | html %]
19
    [% t("Koha") | html %]
20
        &rsaquo; [% t("Cataloging") | html %] &rsaquo; [% t("Koha") | html %]
20
[% END %]</title>
21
    [% END %]</title
22
>
23
[% INCLUDE 'doc-head-close.inc' %]
21
[% INCLUDE 'doc-head-close.inc' %]
24
[% Asset.css("css/addbiblio.css") | $raw %]
22
[% Asset.css("css/addbiblio.css") | $raw %]
25
[% INCLUDE 'datatables.inc' %]
23
[% INCLUDE 'datatables.inc' %]
Lines 38-55 Link Here
38
[% INCLUDE 'str/cataloging_additem.inc' %]
36
[% INCLUDE 'str/cataloging_additem.inc' %]
39
[% Asset.js("js/cataloging_additem.js") | $raw %]
37
[% Asset.js("js/cataloging_additem.js") | $raw %]
40
[% Asset.js("js/form-submit.js") | $raw %]
38
[% Asset.js("js/form-submit.js") | $raw %]
41
<script>
39
    <script>
42
    var has_item_groups = "[% item_groups.size | html %]";
40
        var has_item_groups = "[% item_groups.size | html %]";
43
</script>
41
    </script>
44
<style>
42
    <style>
45
    .flatpickr_wrapper input {
43
        .flatpickr_wrapper input {
46
        width: 100%;
44
            width: 100%;
47
    }
45
        }
48
46
49
    .flatpickr_wrapper {
47
        .flatpickr_wrapper {
50
        flex-basis: 50%;
48
            flex-basis: 50%;
51
    }
49
        }
52
</style>
50
    </style>
53
</head>
51
</head>
54
52
55
<body id="cat_additem" class="cat">
53
<body id="cat_additem" class="cat">
Lines 65-439 Link Here
65
        [% WRAPPER breadcrumb_item %]
63
        [% WRAPPER breadcrumb_item %]
66
            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblio.biblionumber | uri %]">
64
            <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblio.biblionumber | uri %]">
67
                [% IF ( biblio.author ) %]
65
                [% IF ( biblio.author ) %]
68
                    [% tx('Edit {title} by {author}', { title = biblio.title, author = biblio.author }) | html %]
66
                    [% tx('Edit {title} by {author}', { title = biblio.title, author = biblio.author }) | html %] ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %])
69
                    ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %])
70
                [% ELSE %]
67
                [% ELSE %]
71
                    [% tx('Edit {title}', title = biblio.title) | html %]
68
                    [% tx('Edit {title}', title = biblio.title) | html %] ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %])
72
                    ([% tp('Bibliographic record number', 'Record #') | html %] [% biblio.biblionumber | html %])
73
                [% END %]
69
                [% END %]
74
            </a>
70
            </a>
75
        [% END %]
71
        [% END %]
76
        [% WRAPPER breadcrumb_item bc_active= 1 %]
72
        [% WRAPPER breadcrumb_item bc_active= 1 %]
77
            [% tp('Items attached to a bibliographic record', 'Items') | html %]
73
            [%  tp('Items attached to a bibliographic record', 'Items') | html %]
78
        [% END %]
74
        [% END %]
79
    [% END #/ WRAPPER breadcrumbs %]
75
    [% END #/ WRAPPER breadcrumbs %]
80
[% END #/ WRAPPER sub-header.inc %]
76
[% END #/ WRAPPER sub-header.inc %]
81
77
82
[% WRAPPER 'main-container.inc' wide_full => 1 %]
78
[% WRAPPER 'main-container.inc' wide_full => 1 %]
83
    [% INCLUDE 'messages.inc' %]
79
                [% INCLUDE 'messages.inc' %]
84
    [% IF item_doesnt_exist %]
80
                [% IF item_doesnt_exist %]
85
        <div class="alert alert-warning">
81
                    <div class="alert alert-warning">
86
            <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber | uri %]">Add a new item</a> or
82
                        <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber | uri %]">Add a new item</a> or <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]#holdings">go to the records holdings</a>.
87
            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]#holdings">go to the records holdings</a>.
83
                    </div>
88
        </div>
84
                [% END %]
89
    [% END %]
85
<h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %] by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
90
    <h1>Items for [% biblio.title | html %] [% IF ( biblio.author ) %]by [% biblio.author | html %][% END %] (Record #[% biblio.biblionumber | html %])</h1>
86
<a id="newitem_jump" href="#additema"><i class="fa fa-arrow-down"></i> Jump to add item form</a>
91
    <a id="newitem_jump" href="#additema"><i class="fa fa-arrow-down"></i> Jump to add item form</a>
92
87
93
    [% IF ( barcode_not_unique ) %]<div class="alert alert-warning"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
88
[% IF ( barcode_not_unique ) %]<div class="alert alert-warning"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
94
    [% IF ( no_next_barcode ) %]<div class="alert alert-warning"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
89
[% IF ( no_next_barcode ) %]<div class="alert alert-warning"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
95
    [% IF ( book_on_loan ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
90
[% IF ( book_on_loan ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
96
    [% IF ( book_reserved ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
91
[% IF ( book_reserved ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
97
    [% IF ( not_same_branch ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
92
[% IF ( not_same_branch ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
98
    [% IF ( linked_analytics ) %]
93
[% IF ( linked_analytics ) %]<div class="alert alert-warning"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;analyze=1">analytics.</a>.</div>[% END %]
99
        <div class="alert alert-warning"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;analyze=1">analytics.</a>.</div>
94
[% IF last_item_for_hold %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Last item for bibliographic record with biblio-level hold on it.</div>[% END %]
100
    [% END %]
95
[% IF item_not_found %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
101
    [% IF last_item_for_hold %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Last item for bibliographic record with biblio-level hold on it.</div>[% END %]
102
    [% IF item_not_found %]<div class="alert alert-warning"><strong>Cannot delete</strong>: Item not found.</div>[% END %]
103
96
104
    <div id="cataloguing_additem_itemlist">
97
<div id="cataloguing_additem_itemlist">
105
        [% IF items %]
98
    [% IF items %]
106
            [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %]
99
        [% SET date_fields = [ 'dateaccessioned', 'onloan', 'datelastseen', 'datelastborrowed', 'replacementpricedate' ] %]
107
            <div class="page-section">
100
        <div class="page-section">
108
                <table id="itemst">
101
            <table id="itemst">
109
                    <thead>
102
            <thead>
110
                        <tr>
103
                <tr>
111
                            <th class="NoSort">&nbsp;</th>
104
                    <th class="NoSort">&nbsp;</th>
112
                            [% FOREACH item_header IN item_header_loop %]
105
                    [% FOREACH item_header IN item_header_loop %]
113
                                <th data-colname="[% item_header.attribute | html %]"> [% item_header.header_value | html %] </th>
106
                        <th data-colname="[% item_header.attribute | html %]">
107
                            [% item_header.header_value | html %]
108
                        </th>
109
                    [% END %]
110
                </tr>
111
            </thead>
112
            <tbody>
113
                    [% FOREACH item IN items %]
114
                        [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %]
115
                        [% SET tr_class = '' %]
116
                        [% IF item.itemnumber == itemnumber%]
117
                            [% UNLESS can_be_edited %]
118
                                [% SET tr_class='active' %]
119
                            [% ELSE %]
120
                                [% SET tr_class='active editable' %]
114
                            [% END %]
121
                            [% END %]
115
                        </tr>
122
                        [% ELSIF can_be_edited %]
116
                    </thead>
123
                            [% SET tr_class='editable' %]
117
                    <tbody>
124
                        [% END %]
118
                        [% FOREACH item IN items %]
125
                        <tr id="row[% item.itemnumber | html %]" class="[% tr_class | html %]">
119
                            [% SET can_be_edited = ! ( Koha.Preference('IndependentBranches') && ! logged_in_user.is_superlibrarian && item.homebranch != Branches.GetLoggedInBranchname() ) %]
126
                        [% UNLESS can_be_edited %]
120
                            [% SET tr_class = '' %]
127
                        <td>&nbsp;</td>
121
                            [% IF item.itemnumber == itemnumber %]
128
                        [% ELSE %]
122
                                [% UNLESS can_be_edited %]
129
                        <td>
123
                                    [% SET tr_class='active' %]
130
                            <div class="btn-group dropup">
124
                                [% ELSE %]
131
                            <a class="btn btn-default btn-xs dropdown-toggle" id="itemactions[% item.itemnumber | html %]" role="button" data-bs-toggle="dropdown" href="#">
125
                                    [% SET tr_class='active editable' %]
132
                                Actions
133
                            </a>
134
                            <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item.itemnumber | html %]">
135
136
                            [% IF item.biblionumber != biblio.biblionumber %] [%# Host item %]
137
                                <li><a href="additem.pl?op=edititem&amp;biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblio.biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | html %]&amp;searchid=[% searchid | html %]">Delink</a></li>
138
                            [% ELSE %]
139
                                [% UNLESS item.nomod %]
140
                                    <li><a class="dropdown-item" href="additem.pl?op=edititem&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#edititem">Edit</a></li>
126
                                [% END %]
141
                                [% END %]
127
                            [% ELSIF can_be_edited %]
142
                                <li><a class="dropdown-item" href="additem.pl?op=dupeitem&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#additema">Duplicate</a></li>
128
                                [% SET tr_class='editable' %]
143
                                <li class="print_label">
129
                            [% END %]
144
                                     <a class="dropdown-item submit-form-link" target="_blank" href="#" data-op="cud-add" data-number_list="[% item.itemnumber | html %]" data-number_type="itemnumber" data-method="post" data-action="/cgi-bin/koha/labels/label-edit-batch.pl" data-new_tab="true">Print label</a>
130
                            <tr id="row[% item.itemnumber | html %]" class="[% tr_class | html %]">
145
                                </li>
131
                                [% UNLESS can_be_edited %]
146
                                [% UNLESS item.nomod %]
132
                                    <td>&nbsp;</td>
147
                                    <li>
133
                                [% ELSE %]
148
                                        <form id="[% item.itemnumber | html %]-delete-item-form" action="/cgi-bin/koha/cataloguing/additem.pl" method="post">
134
                                    <td>
149
                                            [% INCLUDE 'csrf-token.inc' %]
135
                                        <div class="btn-group dropup">
150
                                            <input type="hidden" name="op" value="cud-delitem" />
136
                                            <a class="btn btn-default btn-xs dropdown-toggle" id="itemactions[% item.itemnumber | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a>
151
                                            <input type="hidden" name="biblionumber" value="[% item.biblionumber | html %]" />
137
                                            <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item.itemnumber | html %]">
152
                                            <input type="hidden" name="itemnumber" value="[% item.itemnumber | html %]" />
138
                                                [% IF item.biblionumber != biblio.biblionumber %]
153
                                            <input type="hidden" name="searchid" value="[% searchid | html %]" />
139
                                                    [%# Host item %]
154
                                        </form>
140
                                                    <li
155
                                        <a class="dropdown-item delete" data-item="[% item.itemnumber | html %]" href="#">Delete</a>
141
                                                        ><a href="additem.pl?op=edititem&amp;biblionumber=[% item.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]#edititem">Edit in host</a> &nbsp;
156
                                    </li>
142
                                                        <a
143
                                                            class="delete"
144
                                                            href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblio.biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | html %]&amp;searchid=[% searchid | html %]"
145
                                                            >Delink</a
146
                                                        ></li
147
                                                    >
148
                                                [% ELSE %]
149
                                                    [% UNLESS item.nomod %]
150
                                                        <li
151
                                                            ><a
152
                                                                class="dropdown-item"
153
                                                                href="additem.pl?op=edititem&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#edititem"
154
                                                                >Edit</a
155
                                                            ></li
156
                                                        >
157
                                                    [% END %]
158
                                                    <li
159
                                                        ><a
160
                                                            class="dropdown-item"
161
                                                            href="additem.pl?op=dupeitem&amp;biblionumber=[% biblio.biblionumber | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#additema"
162
                                                            >Duplicate</a
163
                                                        ></li
164
                                                    >
165
                                                    <li class="print_label">
166
                                                        <a
167
                                                            class="dropdown-item submit-form-link"
168
                                                            target="_blank"
169
                                                            href="#"
170
                                                            data-op="cud-add"
171
                                                            data-number_list="[% item.itemnumber | html %]"
172
                                                            data-number_type="itemnumber"
173
                                                            data-method="post"
174
                                                            data-action="/cgi-bin/koha/labels/label-edit-batch.pl"
175
                                                            data-new_tab="true"
176
                                                            >Print label</a
177
                                                        >
178
                                                    </li>
179
                                                    [% UNLESS item.nomod %]
180
                                                        <li>
181
                                                            <form id="[% item.itemnumber | html %]-delete-item-form" action="/cgi-bin/koha/cataloguing/additem.pl" method="post">
182
                                                                [% INCLUDE 'csrf-token.inc' %]
183
                                                                <input type="hidden" name="op" value="cud-delitem" />
184
                                                                <input type="hidden" name="biblionumber" value="[% item.biblionumber | html %]" />
185
                                                                <input type="hidden" name="itemnumber" value="[% item.itemnumber | html %]" />
186
                                                                <input type="hidden" name="searchid" value="[% searchid | html %]" />
187
                                                            </form>
188
                                                            <a class="dropdown-item delete" data-item="[% item.itemnumber | html %]" href="#">Delete</a>
189
                                                        </li>
190
                                                    [% END %]
191
                                                [% END %]
192
                                                [% IF ( OPACBaseURL ) %]
193
                                                    <li class="view-in-opac"
194
                                                        ><a class="dropdown-item" target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% item.biblionumber | uri %]">OPAC view</a></li
195
                                                    >
196
                                                [% END %]
197
                                            </ul>
198
                                        </div>
199
                                    </td>
200
                                [% END %]
157
                                [% END %]
201
                                [% FOREACH header IN item_header_loop %]
158
                            [% END %]
202
                                    [% SET attribute = header.attribute %]
159
                                [% IF ( OPACBaseURL ) %]
203
                                    [% SET can_mod = item.nomod ? "nomod" : "canmod" %]
160
                                    <li class="view-in-opac"><a class="dropdown-item" target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% item.biblionumber | uri %]">OPAC view</a></li>
204
                                    [% IF attribute AND date_fields.grep('^' _ attribute _ '$').size %]
205
                                        [% IF attribute == 'datelastseen' %]
206
                                            <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates with_hours => 1 %]</td>
207
                                        [% ELSE %]
208
                                            <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates %]</td>
209
                                        [% END %]
210
                                    [% ELSIF ( item.$attribute && ( attribute == 'price' || attribute == 'replacementprice' ) ) %]
211
                                        <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $Price %]</td>
212
                                    [% ELSIF item.$attribute && attribute == 'itemcallnumber' %]
213
                                        <td class="[% can_mod | html %]" data-order="[% item.cn_sort | html %]">[% item.$attribute | html %]</td>
214
                                    [% ELSE %]
215
                                        <td class="[% can_mod | html %]">[% item.$attribute | html %]</td>
216
                                    [% END %]
217
                                [% END %]
161
                                [% END %]
218
                            </tr>
162
                            </ul>
219
                        [% END %]
163
                            </div>
220
                    </tbody>
164
                        </td>
221
                </table>
222
            </div>
223
            <!-- /.page-section -->
224
        [% END %]
225
226
        <div class="row">
227
            <div class="col-md-2 order-sm-2 order-md-1"> [% INCLUDE 'biblio-view-menu.inc' %] </div>
228
            <div class="col-md-10 order-md-2 order-sm-1">
229
                <div id="cataloguing_additem_newitem" class="item_edit_form page-section">
230
                    <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber | html %]" name="f">
231
                        [% INCLUDE 'csrf-token.inc' %]
232
                        <input type="hidden" name="op" value="[% op | html %]" />
233
                        [% IF (popup) %]
234
                            <input type="hidden" name="popup" value="1" />
235
                        [% END %]
165
                        [% END %]
236
                        <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />
166
                    [% FOREACH header IN item_header_loop %]
237
                        [% IF op != 'cud-saveitem' %]
167
                        [% SET attribute = header.attribute %]
238
                            <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
168
                        [% SET can_mod = item.nomod ? "nomod" : "canmod" %]
169
                        [% IF attribute AND date_fields.grep('^' _ attribute _ '$').size %]
170
                            [% IF attribute == 'datelastseen' %]
171
                                <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates with_hours => 1 %]</td>
172
                            [% ELSE %]
173
                                <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $KohaDates %]</td>
174
                            [% END %]
175
                        [% ELSIF ( item.$attribute && ( attribute == 'price' || attribute == 'replacementprice' ) ) %]
176
                            <td class="[% can_mod | html %]" data-order="[% item.$attribute | html %]">[% item.$attribute | $Price %]</td>
177
                        [% ELSIF item.$attribute && attribute == 'itemcallnumber' %]
178
                            <td class="[% can_mod | html %]" data-order="[% item.cn_sort | html %]">[% item.$attribute | html %]</td>
239
                        [% ELSE %]
179
                        [% ELSE %]
240
                            <h2 id="edititem">Edit item #[% itemnumber | html %][% IF ( barcode ) %]/ Barcode [% barcode | html %][% END %]</h2>
180
                            <td class="[% can_mod | html %]">[% item.$attribute | html %]</td>
241
                        [% END %]
181
                        [% END %]
182
                    [% END %]
183
                    </tr>
184
                    [% END %]
185
            </tbody>
186
            </table>
187
        </div> <!-- /.page-section -->
188
    [% END %]
242
189
243
                        [% IF item_templates.owned.count || item_templates.shared.count %]
190
<div class="row">
244
                            <div id="item-template-toolbar" class="btn-toolbar">
191
    <div class="col-md-2 order-sm-2 order-md-1">
245
                                <div class="btn-group">
192
        [% INCLUDE 'biblio-view-menu.inc' %]
246
                                    <select name="template_id" id="template_id" class="select2" style="width: 20em">
193
    </div>
247
                                        <option value="0" selected="selected">Do not use template</option>
194
    <div class="col-md-10 order-md-2 order-sm-1">
248
                                        <optgroup label="My templates">
249
                                            [% FOREACH t IN item_templates.owned %]
250
                                                [% IF t.id == template_id %]
251
                                                    <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
252
                                                [% ELSE %]
253
                                                    <option data-editor="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
254
                                                [% END %]
255
                                            [% END %]
256
                                        </optgroup>
257
                                        <optgroup label="Shared templates">
258
                                            [% FOREACH t IN item_templates.shared %]
259
                                                [% IF t.id == template_id %]
260
                                                    [% IF CAN_user_editcatalogue_manage_item_editor_templates %]
261
                                                        <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option>
262
                                                    [% ELSE %]
263
                                                        <option data-editor="0" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option>
264
                                                    [% END %]
265
                                                [% ELSE %]
266
                                                    [% IF CAN_user_editcatalogue_manage_item_editor_templates %]
267
                                                        <option data-editor="1" value="[% t.id | html %]">[% t.name | html %]</option>
268
                                                    [% ELSE %]
269
                                                        <option data-editor="0" value="[% t.id | html %]">[% t.name | html %]</option>
270
                                                    [% END %]
271
                                                [% END %]
272
                                            [% END %]
273
                                        </optgroup>
274
                                    </select>
275
                                </div>
276
                                <div class="btn-group">
277
                                    <button type="submit" id="load_template_submit" name="load_template_submit" value="1"><i class="fa-solid fa-table-list"></i> Apply template</button>
278
                                </div>
279
                                <div class="btn-group">
280
                                    <label for="use_template_for_session">
281
                                        [% IF use_template_for_session %]
282
                                            <input type="checkbox" id="use_template_for_session" name="use_template_for_session" checked="checked" />
283
                                        [% ELSE %]
284
                                            <input type="checkbox" id="use_template_for_session" name="use_template_for_session" />
285
                                        [% END %]
286
                                        For session</label
287
                                    >
288
                                </div>
289
195
290
                                <div class="btn-group">
196
<div id="cataloguing_additem_newitem" class="item_edit_form page-section">
291
                                    <button type="submit" id="unload_template_submit" name="unload_template_submit" value="1"><i class="fa fa-eraser"></i> Clear template</button>
197
    <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblio.biblionumber | html %]" name="f">
292
                                </div>
198
        [% INCLUDE 'csrf-token.inc' %]
199
    <input type="hidden" name="op" value="[% op | html %]" />
200
    [% IF (popup) %]
201
        <input type="hidden" name="popup" value="1" />
202
    [% END %]
203
    <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />
204
    [% IF op != 'cud-saveitem' %]
205
        <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
206
    [% ELSE %]
207
        <h2 id="edititem">Edit item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2>
208
    [% END %]
293
209
294
                                <div class="btn-group">
210
    [% IF item_templates.owned.count || item_templates.shared.count %]
295
                                    <button type="submit" id="delete_template_submit" name="delete_template_submit" value="1" disabled><i class="fa fa-trash-can"></i> Delete template</button>
211
        <div id="item-template-toolbar" class="btn-toolbar">
296
                                </div>
212
            <select name="template_id" id="template_id" class="select2" style="width: 20em">
297
                            </div>
213
                <option value="0" selected="selected">Do not use template</option>
214
                <optgroup label="My templates">
215
                    [% FOREACH t IN item_templates.owned %]
216
                        [% IF t.id == template_id %]
217
                            <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
218
                        [% ELSE %]
219
                            <option data-editor="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
298
                        [% END %]
220
                        [% END %]
299
221
                    [% END %]
300
                        <fieldset class="rows"> [% PROCESS subfields_for_item subfields => subfields %] </fieldset>
222
                </optgroup>
301
                        [% IF op != 'add_item' %]
223
                <optgroup label="Shared templates">
302
                            <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
224
                    [% FOREACH t IN item_templates.shared %]
225
                        [% IF t.id == template_id %]
226
                            [% IF CAN_user_editcatalogue_manage_item_editor_templates %]
227
                                <option data-editor="1" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option>
228
                            [% ELSE %]
229
                                <option data-editor="0" value="[% t.id | html %]" selected="selected">[% t.name | html %]</option>
230
                            [% END %]
231
                        [% ELSE %]
232
                            [% IF CAN_user_editcatalogue_manage_item_editor_templates %]
233
                                <option data-editor="1" value="[% t.id | html %]">[% t.name | html %]</option>
234
                            [% ELSE %]
235
                                <option data-editor="0" value="[% t.id | html %]">[% t.name | html %]</option>
236
                            [% END %]
303
                        [% END %]
237
                        [% END %]
238
                    [% END %]
239
                </optgroup>
240
            </select>
241
            <button class="btn btn-default" type="submit" id="load_template_submit" name="load_template_submit" value="1"><i class="fa-solid fa-table-list"></i> Apply template</button>
242
            <div>
243
                <label for="use_template_for_session">
244
                    [% IF use_template_for_session %]
245
                        <input type="checkbox" id="use_template_for_session" name="use_template_for_session" checked="checked">
246
                    [% ELSE %]
247
                        <input type="checkbox" id="use_template_for_session" name="use_template_for_session">
248
                    [% END %]
249
                    Remember for session
250
                </label>
251
            </div>
304
252
305
                        [% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %]
253
            <button class="btn btn-default" ype="submit" id="unload_template_submit" name="unload_template_submit" value="1"><i class="fa fa-eraser"></i> Clear template</button>
306
                            <fieldset class="rows">
254
            <button class="btn btn-default" type="submit" id="delete_template_submit" name="delete_template_submit" value="1" disabled><i class="fa fa-trash-can"></i> Delete template</button>
307
                                <legend><i class="fa fa-plus"></i> Add to item group</legend>
255
        </div>
308
                                [% FOREACH ig IN item_groups %]
256
    [% END %]
309
                                    <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" />
257
310
                                [% END %]
258
	<fieldset class="rows">
311
                                <ol>
259
        [% PROCESS subfields_for_item subfields => subfields %]
312
                                    <li>
260
    </fieldset>
313
                                        <label for="select_item_group">Options: </label>
261
    [% IF op != 'add_item' %]
314
                                        <select name="item_group" id="item-group-add-or-create-form-select">
262
        <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
315
                                            <optgroup label="Use existing item group">
263
    [% END %]
316
                                                [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
264
317
                                                    <option value="[% ig.id | html %]">[% ig.description | html %]</option>
265
[% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %]
318
                                                [% END %]
266
    <fieldset class="rows">
319
                                            </optgroup>
267
        <legend><i class="fa fa-plus"></i> Add to item group</legend>
320
                                            <optgroup label="Other options">
268
        [% FOREACH ig IN item_groups %]
321
                                                <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option>
269
            <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" />
322
                                                <option value="create">Create new item group</option>
270
        [% END %]
323
                                            </optgroup>
271
        <ol>
324
                                        </select>
272
            <li>
325
                                    </li>
273
                <label for="select_item_group">Options: </label>
326
                                    <div id="item-group-add-or-create-form-description-block">
274
                <select name="item_group" id="item-group-add-or-create-form-select">
327
                                        <li>
275
                    <optgroup label="Use existing item group">
328
                                            <label for="item_group_description" class="required">Name: </label>
276
                        [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
329
                                            <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" />
277
                            <option value="[% ig.id | html %]">[% ig.description | html %]</option>
330
                                            <span class="required">Required</span>
331
                                        </li>
332
                                        <li>
333
                                            <label for="item_group_display_order">Display order: </label>
334
                                            <input name="item_group_display_order" id="item_group_display_order" type="text" pattern="\d*" size="30" />
335
                                            <div class="hint">Display order must be numerical</div>
336
                                        </li>
337
                                    </div>
338
                                </ol>
339
                            </fieldset>
340
                        [% END %]
278
                        [% END %]
279
                    </optgroup>
280
                    <optgroup label="Other options">
281
                        <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option>
282
                        <option value="create">Create new item group</option>
283
                    </optgroup>
284
                </select>
285
            </li>
286
            <div id="item-group-add-or-create-form-description-block">
287
                <li>
288
                    <label for="item_group_description" class="required">Name: </label>
289
                    <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" />
290
                    <span class="required">Required</span>
291
                </li>
292
                <li>
293
                    <label for="item_group_display_order">Display order: </label>
294
                    <input name="item_group_display_order" id="item_group_display_order" type="text" pattern="\d*" size="30" />
295
                    <div class="hint">Display order must be numerical</div>
296
                </li>
297
            </div>
298
        </ol>
299
    </fieldset>
300
[% END %]
341
301
342
                        <fieldset class="action">
302
<fieldset class="action">    [% IF op != 'cud-saveitem' %]
343
                            [% IF op != 'cud-saveitem' %]
303
    <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
344
                                <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
304
    <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
345
                                <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
346
		when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
305
		when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
347
		It is a bit tricky, but necessary in the sake of UI correctness.
306
		It is a bit tricky, but necessary in the sake of UI correctness.
348
    -->
307
    -->
349
                                <span id="addsingle">
308
    <span id="addsingle">
350
                                    <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
309
        <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
351
                                    <input type="submit" name="add_duplicate_submit" value="Add and duplicate" onclick="return Check(this.form)" />
310
        <input type="submit" name="add_duplicate_submit" value="Add and duplicate" onclick="return Check(this.form)" />
352
                                </span>
311
    </span>
353
                                <span id="addmultiple">
312
    <span id="addmultiple">
354
                                    <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
313
        <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
355
                                </span>
314
    </span>
356
                                <fieldset id="add_multiple_copies_span">
315
    <fieldset id="add_multiple_copies_span">
357
                                    <label for="number_of_copies">Number of copies of this item to add: </label>
316
        <label for="number_of_copies">Number of copies of this item to add: </label>
358
                                    <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" maxlength="3" />
317
        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" maxlength="3" />
359
                                    <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" />
318
        <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
360
                                    <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
319
        <div class="hint"><p>Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.</p></div>
361
                                    <div class="hint"><p>Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.</p></div>
320
    </fieldset>
362
                                </fieldset>
363
321
364
                                <span id="savetemplate">
322
    <span id="savetemplate">
365
                                    <input type="button" name="save_as_template" id="save_as_template" value="Save as template" />
323
        <input type="button" name="save_as_template" id="save_as_template" value="Save as template" />
366
                                </span>
324
    </span>
367
                                <fieldset id="save_as_template_span">
325
    <fieldset id="save_as_template_span">
368
                                    <legend>Save template</legend>
326
        <legend>Save template</legend>
369
                                    <div class="btn-group">
327
        <div class="btn-group">
370
                                        <select name="replace_template_id" id="replace_template_id" class="select2" style="width: 20em">
328
            <select name="replace_template_id" id="replace_template_id" class="select2" style="width: 20em">
371
                                            <option value="0" selected="selected">Save as new template</option>
329
                <option value="0" selected="selected">Save as new template</option>
372
                                            <optgroup label="Update existing template">
330
                <optgroup label="Update existing template">
373
                                                [% FOREACH t IN item_templates.owned %]
331
                    [% FOREACH t IN item_templates.owned %]
374
                                                    <option data-editor="1" data-shared="[% t.is_shared | html %]" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
332
                        <option data-editor="1" data-shared="[% t.is_shared | html %]" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
375
                                                [% END %]
333
                    [% END %]
376
                                                [% IF CAN_user_editcatalogue_manage_item_editor_templates && item_templates.shared.count %]
334
                    [% IF CAN_user_editcatalogue_manage_item_editor_templates && item_templates.shared.count %]
377
                                                    <optgroup label="Update shared template">
335
                        <optgroup label="Update shared template">
378
                                                        [% FOREACH t IN item_templates.shared %]
336
                            [% FOREACH t IN item_templates.shared %]
379
                                                            <option data-editor="1" data-shared="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %](shared)[% END %]</option>
337
                                <option data-editor="1" data-shared="1" value="[% t.id | html %]">[% t.name | html %][% IF t.is_shared %] (shared)[% END %]</option>
380
                                                        [% END %]
338
                            [% END %]
381
                                                    </optgroup>
339
                        </optgroup>
382
                                                [% END %]
340
                    [% END %]
383
                                            </optgroup>
341
                </optgroup>
384
                                        </select>
342
            </select>
385
                                    </div>
343
        </div>
344
345
        <div class="btn-group">
346
            <span id="template_name_block">
347
                <label for="template_name" class="required">Template name: </label>
348
                <input type="text" id="template_name" name="template_name" class="required"/>
349
                <span class="required">Required</span>
350
            </span>
351
        </div>
386
352
387
                                    <div class="btn-group">
353
        <div class="btn-group">
388
                                        <span id="template_name_block">
354
            <label for="template_is_shared">
389
                                            <label for="template_name" class="required">Template name: </label>
355
                <input type="checkbox" id="template_is_shared" name="template_is_shared"/>
390
                                            <input type="text" id="template_name" name="template_name" class="required" />
356
                Share template
391
                                            <span class="required">Required</span>
357
            </label>
392
                                        </span>
358
        </div>
393
                                    </div>
394
359
395
                                    <div class="btn-group">
360
        <div class="btn-group">
396
                                        <label for="template_is_shared">
361
            <input type="submit" id="save_as_template_submit" name="save_as_template_submit" value="Save" onclick="javascript:return CheckTemplateForm(this.form);" />
397
                                            <input type="checkbox" id="template_is_shared" name="template_is_shared" />
362
            <a href="#" id="cancel_save_as_template" class="cancel">Cancel</a>
398
                                            Share template
363
        </div>
399
                                        </label>
364
    </fieldset>
400
                                    </div>
401
365
402
                                    <div class="btn-group">
366
    [% ELSE %]
403
                                        <input type="submit" id="save_as_template_submit" name="save_as_template_submit" value="Save" onclick="javascript:return CheckTemplateForm(this.form);" />
367
    [% IF op != 'add_item' %]
404
                                        <a href="#" id="cancel_save_as_template" class="cancel">Cancel</a>
368
        <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
405
                                    </div>
369
    [% END %]
406
                                </fieldset>
370
    <input type="submit" value="Save changes" onclick="return Check(this.form)">
407
                            [% ELSE %]
371
    <input type="button" id="addnewitem" value="Add a new item">
408
                                [% IF op != 'add_item' %]
372
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Cancel</a>
409
                                    <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
373
    [% END %]</fieldset>
410
                                [% END %]
411
                                <input type="submit" value="Save changes" onclick="return Check(this.form)" />
412
                                <input type="button" id="addnewitem" value="Add a new item" />
413
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">Cancel</a>
414
                            [% END %]</fieldset
415
                        >
416
374
417
                        [%# Fields for fast cataloging %]
375
    [%# Fields for fast cataloging %]
418
                        <input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
376
    <input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
419
                        <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
377
    <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
420
                        <input type="hidden" name="barcode" value="[% barcode | html %]" />
378
    <input type="hidden" name="barcode" value="[% barcode | html %]" />
421
                        <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
379
    <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
422
                        [%# End fields for fast cataloging %]
380
    [%# End fields for fast cataloging %]
423
                    </form>
424
381
425
                    [% INCLUDE 'modals/cataloguing_create_av.inc' %]
382
426
                </div>
383
    </form>
427
                <!-- /#cataloguing_additem_newitem -->
384
428
            </div>
385
    [% INCLUDE 'modals/cataloguing_create_av.inc' %]
429
            <!-- /.col-sm-10 -->
386
430
        </div>
387
                            </div> <!-- /#cataloguing_additem_newitem -->
431
        <!-- /.row -->
388
                        </div> <!-- /.col-sm-10 -->
432
    </div>
389
                    </div> <!-- /.row -->
433
    <!-- /#cataloguing_additem_itemlist -->
390
                </div> <!-- /#cataloguing_additem_itemlist -->
434
[% END %]
391
[% END %]
435
392
436
[% MACRO jsinclude BLOCK %]
393
[% MACRO jsinclude BLOCK %]
437
[% END %]
394
[% END %]
438
395
439
[% INCLUDE 'intranet-bottom.inc' %]
396
[% INCLUDE 'intranet-bottom.inc' %]
440
- 

Return to bug 38942