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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (+121 lines)
Lines 58-60 Link Here
58
        </option>
58
        </option>
59
    [% END %]
59
    [% END %]
60
[% END %]
60
[% END %]
61
62
[% BLOCK subfields_for_item %]
63
    <ol>
64
        [% FOREACH subfield IN subfields %]
65
            [% IF subfield.kohafield == 'items.more_subfields_xml' %]
66
                [% SET kohafield = 'items.more_subfields_xml_' _ subfield.subfield %]
67
            [% ELSE %]
68
                [% SET kohafield = subfield.kohafield %]
69
            [% END %]
70
71
            <li>
72
                <div class="subfield_line" style="[% subfield.visibility | html %]" id="subfield[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]">
73
                    [% IF ( subfield.mandatory ) %]
74
                        <label class="required">[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label>
75
                    [% ELSE %]
76
                       <label>[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label>
77
                    [% END %]
78
79
                    [% SET mv = subfield.marc_value %]
80
                    [% IF ( mv.type == 'hidden' ) %]
81
                        <input type="hidden" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]">
82
                    [% ELSIF ( mv.type == 'select' ) %]
83
                        [% IF ( mv.readonly || subfield.IS_RETURN_CLAIM ) %]
84
                            <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor" readonly="readonly" disabled="disabled" data-width="50%">
85
                        [% ELSE %]
86
                            <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor select2" data-category="[% mv.category | html %]" data-width="50%">
87
                        [% END %]
88
89
                        [% FOREACH aval IN mv.values %]
90
                            [% IF aval == mv.default %]
91
                                <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
92
                            [% ELSE %]
93
                                [% IF subfield.IS_LOST_AV && Koha.Preference("ClaimReturnedLostValue") && aval == Koha.Preference("ClaimReturnedLostValue") %]
94
                                    <option disabled="disabled" value="[%- aval | html -%]" title="Return claims must be processed from the patron details page">[%- mv.labels.$aval | html -%]</option>
95
                                [%  ELSE %]
96
                                    <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
97
                                [% END %]
98
                            [% END %]
99
                        [% END %]
100
                        </select>
101
                    [% ELSIF ( mv.type == 'text_auth' ) %]
102
                        [% IF mv.readonly %]
103
                            <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
104
                        [% ELSE %]
105
                            <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
106
                            [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
107
                            <a href="#" class="buttonDot"  onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a>
108
                        [% END %]
109
                    [% ELSIF ( mv.type == 'text_plugin' ) %]
110
                        [% IF mv.readonly %]
111
                            <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
112
                        [% ELSE %]
113
                            <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
114
                            [% IF ( mv.nopopup ) %]
115
                                <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a>
116
                            [% ELSE  %]
117
                                <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a>
118
                            [% END %]
119
                            [%- mv.javascript | $raw -%]
120
                        [% END %]
121
                    [% ELSIF ( mv.type == 'text' ) %]
122
                        [% IF mv.readonly %]
123
                            <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
124
                        [% ELSE %]
125
                            <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
126
                        [% END %]
127
                    [% ELSIF ( mv.type == 'textarea' ) %]
128
                        [% IF mv.readonly %]
129
                            <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea>
130
                        [% ELSE %]
131
                            <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea>
132
                        [% END %]
133
                    [% END %]
134
135
                    [% IF subfield.kohafield == 'items.more_subfields_xml' %]
136
                        <input type="hidden" name="items.more_subfields_xml" value="[% subfield.subfield | html %]" />
137
                    [% END %]
138
                    <input type="hidden" name="tag"       value="[% subfield.tag | html %]" />
139
                    <input type="hidden" name="subfield"  value="[% subfield.subfield | html %]" />
140
                    <input type="hidden" name="mandatory" value="[% subfield.mandatory | html %]" />
141
                    <input type="hidden" name="important" value="[% subfield.important | html %]" />
142
143
                    [% IF add_regex %]
144
                        <span name="regex_fields" style="display: none;">
145
                            s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/
146
                            <input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/
147
                            <input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" />
148
                        </span>
149
                    [% END %]
150
151
                    [% IF add_delete_checkbox %]
152
                        [% UNLESS ( subfield.mandatory ) %]
153
                            <input type="checkbox" id="row[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]" title="Check to delete subfield [% subfield.subfield | html %]" name="disable_input" value="[% subfield.subfield | html %]" />
154
                        [% ELSE %]
155
                            <span class="required">Required</span>
156
                        [% END %]
157
                    [% ELSE %]
158
                        [% IF ( subfield.mandatory ) %] <span class="required">Required</span>
159
                        [% ELSIF ( subfield.important ) %] <span class="important">Important</span>
160
                        [% END %]
161
                    [% END %]
162
163
                    [% IF add_regex %]
164
                        [% IF (mv.type == 'text' || mv.type == 'text2' || mv.type == 'textarea' ) %]
165
                            <a href="#" name="field_regex" id="[% subfield.id | html %]" >RegEx</a>
166
                        [% END %]
167
                    [% END %]
168
169
                    [% IF ( subfield.repeatable ) %]
170
                        <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;">
171
                            <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
172
                        </a>
173
                    [% END %]
174
175
                    <span class="hint" id="hint[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]"></span>
176
177
                </div>
178
            </li>
179
        [% END %]
180
    </ol>
181
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-90 / +1 lines)
Lines 153-247 Link Here
153
        <h2 id="edititem">Edit Item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2>
153
        <h2 id="edititem">Edit Item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2>
154
    [% END %]
154
    [% END %]
155
	<fieldset class="rows">
155
	<fieldset class="rows">
156
	<ol>
156
        [% PROCESS subfields_for_item subfields => subfields %]
157
        [% FOREACH subfield IN subfields %]
158
159
                [% IF subfield.kohafield == 'items.more_subfields_xml' %]
160
                    [% SET kohafield = 'items.more_subfields_xml_' _ subfield.subfield %]
161
                [% ELSE %]
162
                    [% SET kohafield = subfield.kohafield %]
163
                [% END %]
164
165
               <li><div class="subfield_line" style="[% subfield.visibility | html %]" id="subfield[% subfield.tag | html %][% subfield.subfield | html %][% subfield.random | html %]">
166
                [% IF ( subfield.mandatory ) %]
167
               <label class="required">[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label>
168
               [% ELSE %]
169
               <label>[% subfield.subfield | html %] - [% subfield.marc_lib | $raw %]</label>
170
               [% END %]
171
172
                [% SET mv = subfield.marc_value %]
173
                [% IF ( mv.type == 'hidden' ) %]
174
                    <input type="hidden" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]">
175
                [% ELSIF ( mv.type == 'select' ) %]
176
                    [% IF ( mv.readonly || subfield.IS_RETURN_CLAIM ) %]
177
                        <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor" readonly="readonly" disabled="disabled" data-width="50%">
178
                    [% ELSE %]
179
                        <select name="[% kohafield | html %]" id="[%- mv.id | html -%]" class="input_marceditor" data-category="[% mv.category | html %]" data-width="50%">
180
                    [% END %]
181
                    [% FOREACH aval IN mv.values %]
182
                        [% IF aval == mv.default %]
183
                        <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
184
                        [% ELSE %]
185
                            [% IF subfield.IS_LOST_AV && Koha.Preference("ClaimReturnedLostValue") && aval == Koha.Preference("ClaimReturnedLostValue") %]
186
                                <option disabled="disabled" value="[%- aval | html -%]" title="Return claims must be processed from the patron details page">[%- mv.labels.$aval | html -%]</option>
187
                            [%  ELSE %]
188
                                <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
189
                            [% END %]
190
                        [% END %]
191
                    [% END %]
192
                    </select>
193
                [% ELSIF ( mv.type == 'text_auth' ) %]
194
                    [% IF mv.readonly %]
195
                        <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
196
                    [% ELSE %]
197
                        <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
198
                        [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
199
                        <a href="#" class="buttonDot"  onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a>
200
                    [% END %]
201
                [% ELSIF ( mv.type == 'text_plugin' ) %]
202
                    [% IF mv.readonly %]
203
                        <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
204
                    [% ELSE %]
205
                        <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
206
                        [% IF ( mv.nopopup ) %]
207
                            <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a>
208
                        [% ELSE  %]
209
                            <a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a>
210
                        [% END %]
211
                        [%- mv.javascript | $raw -%]
212
                    [% END %]
213
                [% ELSIF ( mv.type == 'text' ) %]
214
                    [% IF mv.readonly %]
215
                        <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
216
                    [% ELSE %]
217
                        <input type="text" id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
218
                    [% END %]
219
                [% ELSIF ( mv.type == 'textarea' ) %]
220
                    [% IF mv.readonly %]
221
                        <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea>
222
                    [% ELSE %]
223
                        <textarea id="[%- mv.id | html -%]" name="[% kohafield | html %]" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea>
224
                    [% END %]
225
                [% END %]
226
227
                [% IF subfield.kohafield == 'items.more_subfields_xml' %]
228
                    <input type="hidden" name="items.more_subfields_xml" value="[% subfield.subfield | html %]" />
229
                [% END %]
230
                <input type="hidden" name="tag"       value="[% subfield.tag | html %]" />
231
                <input type="hidden" name="subfield"  value="[% subfield.subfield | html %]" />
232
                <input type="hidden" name="mandatory" value="[% subfield.mandatory | html %]" />
233
                <input type="hidden" name="important" value="[% subfield.important | html %]" />
234
                [% IF ( subfield.repeatable ) %]
235
                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;">
236
                        <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
237
                    </a>
238
                [% END %]
239
                [% IF ( subfield.mandatory ) %] <span class="required">Required</span>
240
                [% ELSIF ( subfield.important ) %] <span class="important">Important</span>
241
                [% END %]
242
            </div></li>
243
        [% END %]
244
    </ol>
245
    </fieldset>
157
    </fieldset>
246
    <input type="hidden" name="indicator" value=" " />
158
    <input type="hidden" name="indicator" value=" " />
247
    <input type="hidden" name="indicator" value=" " />
159
    <input type="hidden" name="indicator" value=" " />
248
- 

Return to bug 28445