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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-317 / +362 lines)
Lines 2-351 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% SET footerjs = 1 %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Administration &rsaquo;[% IF ( add_form ) %][% IF ( use_heading_flags_p ) %][% IF ( heading_edit_subfields_p ) %] MARC subfield structure &rsaquo; Edit MARC subfields constraints[% END %][% ELSE %] MARC subfield structure &rsaquo; [% action | html %][% END %][% END %]
5
<title>
6
[% IF ( delete_confirm ) %] MARC subfield structure &rsaquo; Confirm deletion of subfield [% tagsubfield | html %][% END %][% IF ( delete_confirmed ) %] MARC subfield structure &rsaquo; Subfield deleted[% END %][% IF ( else ) %]MARC subfield structure[% END %]</title>
6
    Koha &rsaquo; Administration &rsaquo;
7
    [%- IF ( add_form ) -%]
8
        [%- IF ( use_heading_flags_p ) -%]
9
            [%- IF ( heading_edit_subfields_p ) -%]
10
                MARC subfield structure &rsaquo; Edit MARC subfields constraints
11
            [%- END -%]
12
        [%- ELSE -%]
13
            MARC subfield structure &rsaquo; [%- action | html -%]
14
        [%- END -%]
15
    [%- END -%]
16
    [%- IF ( delete_confirm ) -%]
17
        MARC subfield structure &rsaquo; Confirm deletion of subfield [%- tagsubfield | html -%]
18
    [%- END -%]
19
    [%- IF ( delete_confirmed ) -%]
20
        MARC subfield structure &rsaquo; Subfield deleted
21
    [%- END -%]
22
    [%- IF ( else ) -%]
23
        MARC subfield structure
24
    [%- END -%]
25
</title>
7
[% INCLUDE 'doc-head-close.inc' %]
26
[% INCLUDE 'doc-head-close.inc' %]
8
<style>.constraints::after { content:  " "; clear: both; display:block; }</style>
27
<style>.constraints::after { content:  " "; clear: both; display:block; }</style>
9
</head>
28
</head>
10
29
11
<body id="admin_marc_subfields_structure" class="admin">
30
<body id="admin_marc_subfields_structure" class="admin">
12
[% INCLUDE 'header.inc' %]
31
    [% INCLUDE 'header.inc' %]
13
[% INCLUDE 'prefs-admin-search.inc' %]
32
    [% INCLUDE 'prefs-admin-search.inc' %]
14
33
15
<div id="breadcrumbs">
34
    <div id="breadcrumbs">
16
  <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a> &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode | html %]&amp;searchfield=[% tagfield | uri %]">[% IF ( frameworkcode ) %][% frameworkcode | html %][% ELSE %]Default[% END %] framework structure</a> &rsaquo;
35
        <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
17
  [% IF ( add_form ) %]
36
        <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
18
  [% IF ( use_heading_flags_p ) %]
37
        <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a> &rsaquo;
19
  [% IF ( heading_edit_subfields_p ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Edit subfields constraints
38
        <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode | html %]&amp;searchfield=[% tagfield | uri %]">
20
  [% END %]
39
            [% IF ( frameworkcode ) %][% frameworkcode | html %][% ELSE %]Default[% END %] framework structure
21
  [% ELSE %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; [% action | html %]
40
        </a> &rsaquo;
22
  [% END %]
41
        [% IF ( add_form ) %]
23
  [% END %]
42
            [% IF ( use_heading_flags_p ) %]
24
[% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; Confirm deletion of subfield [% tagsubfield | html %]
43
                [% IF ( heading_edit_subfields_p ) %]
25
[% END %]
44
                    <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Edit subfields constraints
26
[% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Subfield deleted
45
                [% END %]
27
[% END %]
28
[% IF ( else ) %]Tag [% tagfield | html %] Subfield structure[% END %]
29
</div>
30
31
<div class="main container-fluid">
32
    <div class="row">
33
        <div class="col-sm-10 col-sm-push-2">
34
            <main>
35
36
[% IF ( add_form ) %]
37
    <h1>
38
        [% IF ( use_heading_flags_p ) %]
39
            [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
40
        [% ELSE %]
41
            [% action | html %]
42
        [% END %]
43
    </h1>
44
    <form action="[% script_name | html %]" name="Aform" method="post">
45
    <input type="hidden" name="op" value="add_validate" />
46
    <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
47
    <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
48
    <div id="subfieldtabs" class="toptabs numbered">
49
   <ul>
50
        [% FOREACH loo IN loop %]
51
            [% IF ( loo.new_subfield ) %]
52
                <li><a href="#sub[% loo.urisubfieldcode | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">New</a></li>
53
            [% ELSE %]
46
            [% ELSE %]
54
                <li><a href="#sub[% loo.urisubfieldcode | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">
47
                <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; [% action | html %]
55
                    [% loo.subfieldcode | html %]
56
               </a></li>
57
            [% END %]
48
            [% END %]
58
        [% END %]
49
        [% END %]
59
    </ul>
50
        [% IF ( delete_confirm ) %]
60
    
51
            <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; Confirm deletion of subfield [% tagsubfield | html %]
61
    [% FOREACH loo IN loop %] 
52
        [% END %]
62
        <div class="constraints" id="sub[% loo.urisubfieldcode | html %]field">
53
        [% IF ( delete_confirmed ) %]
54
            <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Subfield deleted
55
        [% END %]
56
        [% IF ( else ) %]
57
            Tag [% tagfield | html %] Subfield structure
58
        [% END %]
59
    </div>
63
60
64
                    <div id="basic[% loo.urisubfieldcode | html %]" class="contraints">
61
    <div class="main container-fluid">
65
                    <fieldset class="rows">
62
        <div class="row">
66
                        <legend>Basic constraints</legend>
63
            <div class="col-sm-10 col-sm-push-2">
67
                	<ol>
64
                <main>
68
                		[% IF ( subfieldcode == 0 || subfieldcode ) %] 
65
69
                		<li><span class="label">Subfield code:</span> [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" /></li>
66
                    [% IF ( add_form ) %]
70
                		[% ELSE %]
67
                        <h1>
71
                		<li><label for="tagsubfield[% loo.row | html %]">Subfield code:</label> <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" /></li>
68
                            [% IF ( use_heading_flags_p ) %]
72
                		[% END %]
69
                                [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
73
                        <li><label for="liblibrarian[% loo.row | html %]">Text for librarian: </label><input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /></li>
74
                        <li><label for="libopac[% loo.row | html %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /></li>
75
                        <li>
76
                            <label for="repeatable[% loo.row | html %]">Repeatable: </label>
77
                            [% IF loo.repeatable %]
78
                                <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
79
                            [% ELSE %]
80
                                <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
81
                            [% END %]
82
                        </li>
83
                        <li>
84
                            <label for="mandatory[% loo.row | html %]">Mandatory: </label>
85
                            [% IF loo.mandatory %]
86
                                <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
87
                            [% ELSE %]
88
                                <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
89
                            [% END %]
90
                        </li>
91
                        <li>
92
                            <label for="important[% loo.row | html %]">Important: </label>
93
                            [% IF loo.important %]
94
                                <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" checked="checked" value="1" />
95
                            [% ELSE %]
70
                            [% ELSE %]
96
                                <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" value="1" />
71
                                [% action | html %]
97
                            [% END %]
72
                            [% END %]
98
                        </li>
73
                        </h1>
99
                        <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
100
                            <select name="tab" tabindex="" size="1" id="tab[% loo.row | html %]">
101
                            [%- IF ( loo.tab ==  -1 ) -%]
102
                                <option value="-1" selected="selected">ignore</option>
103
                            [%- ELSE -%]
104
                                <option value="-1">ignore</option>
105
                            [%- END -%]
106
                            [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
107
                                [%- IF ( loo.tab ==  t ) -%]
108
                                <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
109
                                [%- ELSE -%]
110
                                <option value="[%- t | html -%]">[%- t | html -%]</option>
111
                                [%- END -%]
112
                            [%- END -%]
113
                            [%- IF ( loo.tab ==  10 ) -%]
114
                                <option value="10" selected="selected">items (10)</option>
115
                            [%- ELSE -%]
116
                                <option value="10">items (10)</option>
117
                            [%- END -%]
118
                            </select>
119
                            (ignore means that the subfield does not display in the record editor)
120
                        </li>
121
                	</ol>
122
                    </fieldset>
123
                    </div>
124
74
75
                        <form action="[% script_name | html %]" name="Aform" method="post">
76
                            <input type="hidden" name="op" value="add_validate" />
77
                            <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
78
                            <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
125
79
126
            <div id="advanced[% loo.urisubfieldcode | html %]" class="contraints">
80
                            <div id="subfieldtabs" class="toptabs numbered">
127
            <fieldset class="rows">
81
                                <ul>
128
                <legend>Advanced constraints</legend>
82
                                    [% FOREACH loo IN loop %]
129
                <ol><li><label for="defaultvalue[% loo.row | html %]">Default value:</label>
83
                                        [% IF ( loo.new_subfield ) %]
130
                    <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" /></li>
84
                                            <li><a href="#sub[% loo.urisubfieldcode | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">New</a></li>
131
                    <li><label for="maxlength[% loo.row | html %]">Max length:</label><input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" /></li>
85
                                        [% ELSE %]
132
                <li>
86
                                            <li><a href="#sub[% loo.urisubfieldcode | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">
133
                    [% IF loo.hidden_protected %]
87
                                                [% loo.subfieldcode | html %]
134
                        <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" data-koha-protected="1" />
88
                                        </a></li>
135
                    [% ELSE %]
89
                                        [% END %]
136
                        <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
137
                    [% END %]
138
                    <label for="hidden[% loo.row | html %]" style="float: none;">Visibility: </label>
139
                    <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
140
                    <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
141
                    <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
142
                    <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
143
                    <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
144
                    <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
145
                    <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
146
                    <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
147
                    <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
148
                    <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
149
                </li>
150
                <li>
151
                    <label for="isurl[% loo.row | html %]">Is a URL:</label>
152
                    [% IF loo.isurl %]
153
                        <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
154
                    [% ELSE %]
155
                        <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
156
                    [% END %]
157
                    (if checked, it means that the subfield is a URL and can be clicked)
158
                </li>
159
                <li>
160
                    <label for="link[% loo.row | html %]">Link:</label>
161
                    <input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" />
162
                    (an index name, e.g. title or Local-Number)
163
                </li>
164
                <li>
165
                    <label for="kohafield[% loo.row | html %]">Koha link:</label>
166
                    <!-- This select should be DISABLED; value is submitted by the following hidden input -->
167
                    <select name="kohafield" id="kohafield[% loo.row | html %]" size="1" disabled>
168
                    [% FOREACH value IN loo.kohafields %]
169
                      [% IF ( value == loo.kohafield ) %]
170
                        <option value="[% value | html %]" selected="selected">[% value | html %]</option>
171
                      [% ELSE %]
172
                        <option value="[% value | html %]">[% value | html %]</option>
173
                      [% END %]
174
                    [% END %]
175
                    </select>
176
                    <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
177
                    <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
178
                </li>
179
			</ol>
180
            </fieldset>
181
            </div>
182
183
            <div id="oth[% loo.urisubfieldcode | html %]" class="contraints">
184
            <fieldset class="rows">
185
                <legend>Other options (choose one)</legend>
186
                    	<ol>
187
                            <li>
188
                                <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
189
                                <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
190
                                <option value=""></option>
191
                                [% FOREACH value IN loo.authorised_values %]
192
                                    [% IF ( value == loo.authorised_value ) %]
193
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
194
                                    [% ELSE %]
195
                                    <option value="[% value | html %]">[% value | html %]</option>
196
                                    [% END %]
90
                                    [% END %]
197
                                [% END %]
91
                                </ul>
198
                                </select>
199
                            </li>
200
                            <li>
201
                                <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
202
                                <select name="authtypecode" id="authtypecode[% loo.row | html %]" size="1">
203
                                [% FOREACH value IN loo.authtypes %]
204
                                    [% IF ( value == loo.authtypecode ) %]
205
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
206
                                    [% ELSE %]
207
                                    <option value="[% value | html %]">[% value | html %]</option>
208
                                    [% END %]
209
                                [% END %]
210
                                </select>
211
                            </li>
212
                            <li>
213
                                <label for="value_builder[% loo.row | html %]">Plugin:</label>
214
                                <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
215
                                [% FOREACH value IN loo.value_builders %]
216
                                    [% IF ( value == loo.value_builder ) %]
217
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
218
                                    [% ELSE %]
219
                                    <option value="[% value | html %]">[% value | html %]</option>
220
                                    [% END %]
221
                                [% END %]
222
                                </select>
223
                            </li>
224
                    	</ol>
225
            </fieldset>
226
            </div>
227
        </div><!-- /content_sub -->
228
        [% END %]
229
		</div><!-- /content -->
230
    <fieldset class="action">
231
        <input type="submit" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
232
    </fieldset>
233
    </form>
234
[% END %]
235
92
236
[% IF ( delete_confirm ) %]
93
                                [% FOREACH loo IN loop %]
94
                                    <div class="constraints" id="sub[% loo.urisubfieldcode | html %]field">
95
                                        <div id="basic[% loo.urisubfieldcode | html %]" class="contraints">
96
                                            <fieldset class="rows">
97
                                                <legend>Basic constraints</legend>
98
                                                <ol>
99
                                                    [% IF ( subfieldcode == 0 || subfieldcode ) %]
100
                                                        <li>
101
                                                            <span class="label">Subfield code:</span>
102
                                                            [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
103
                                                        </li>
104
                                                    [% ELSE %]
105
                                                        <li>
106
                                                            <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
107
                                                                <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
108
                                                            </li>
109
                                                    [% END %]
110
                                                    <li>
111
                                                        <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
112
                                                        <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
113
                                                    </li>
114
                                                    <li>
115
                                                        <label for="libopac[% loo.row | html %]">Text for OPAC: </label>
116
                                                        <input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
117
                                                    </li>
118
                                                    <li>
119
                                                        <label for="repeatable[% loo.row | html %]">Repeatable: </label>
120
                                                        [% IF loo.repeatable %]
121
                                                            <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
122
                                                        [% ELSE %]
123
                                                            <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
124
                                                        [% END %]
125
                                                    </li>
126
                                                    <li>
127
                                                        <label for="mandatory[% loo.row | html %]">Mandatory: </label>
128
                                                        [% IF loo.mandatory %]
129
                                                            <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
130
                                                        [% ELSE %]
131
                                                            <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
132
                                                        [% END %]
133
                                                    </li>
134
                                                    <li>
135
                                                        <label for="important[% loo.row | html %]">Important: </label>
136
                                                        [% IF loo.important %]
137
                                                            <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" checked="checked" value="1" />
138
                                                        [% ELSE %]
139
                                                            <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" value="1" />
140
                                                        [% END %]
141
                                                    </li>
142
                                                    <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
143
                                                        <select name="tab" tabindex="" size="1" id="tab[% loo.row | html %]">
144
                                                        [%- IF ( loo.tab ==  -1 ) -%]
145
                                                            <option value="-1" selected="selected">ignore</option>
146
                                                        [%- ELSE -%]
147
                                                            <option value="-1">ignore</option>
148
                                                        [%- END -%]
149
                                                        [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
150
                                                            [%- IF ( loo.tab ==  t ) -%]
151
                                                            <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
152
                                                            [%- ELSE -%]
153
                                                            <option value="[%- t | html -%]">[%- t | html -%]</option>
154
                                                            [%- END -%]
155
                                                        [%- END -%]
156
                                                        [%- IF ( loo.tab ==  10 ) -%]
157
                                                            <option value="10" selected="selected">items (10)</option>
158
                                                        [%- ELSE -%]
159
                                                            <option value="10">items (10)</option>
160
                                                        [%- END -%]
161
                                                        </select>
162
                                                        (ignore means that the subfield does not display in the record editor)
163
                                                    </li>
164
                                                </ol>
165
                                            </fieldset>
166
                                        </div>
237
167
238
    <div class="dialog alert">
168
                                        <div id="advanced[% loo.urisubfieldcode | html %]" class="contraints">
239
        <h3>Confirm deletion of subfield [% tagsubfield | html %]?</h3>
169
                                            <fieldset class="rows">
240
        <p>Subfield: [% tagsubfield | html %]</p>
170
                                                <legend>Advanced constraints</legend>
241
        <p>Description: [% liblibrarian | html_entity %]</p>
171
                                                <ol>
172
                                                    <li>
173
                                                        <label for="defaultvalue[% loo.row | html %]">Default value:</label>
174
                                                        <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
175
                                                    </li>
176
                                                    <li>
177
                                                        <label for="maxlength[% loo.row | html %]">Max length:</label>
178
                                                        <input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" />
179
                                                    </li>
180
                                                    <li>
181
                                                        [% IF loo.hidden_protected %]
182
                                                            <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" data-koha-protected="1" />
183
                                                        [% ELSE %]
184
                                                            <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
185
                                                        [% END %]
186
                                                        <label for="hidden[% loo.row | html %]" style="float: none;">Visibility: </label>
187
                                                        <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
188
                                                        <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
189
                                                        <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
190
                                                        <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
191
                                                        <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
192
                                                        <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
193
                                                        <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
194
                                                        <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
195
                                                        <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
196
                                                        <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
197
                                                    </li>
198
                                                    <li>
199
                                                        <label for="isurl[% loo.row | html %]">Is a URL:</label>
200
                                                        [% IF loo.isurl %]
201
                                                            <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
202
                                                        [% ELSE %]
203
                                                            <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
204
                                                        [% END %]
205
                                                        (if checked, it means that the subfield is a URL and can be clicked)
206
                                                    </li>
207
                                                    <li>
208
                                                        <label for="link[% loo.row | html %]">Link:</label>
209
                                                        <input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" />
210
                                                        (an index name, e.g. title or Local-Number)
211
                                                    </li>
212
                                                    <li>
213
                                                        <label for="kohafield[% loo.row | html %]">Koha link:</label>
214
                                                        <!-- This select should be DISABLED; value is submitted by the following hidden input -->
215
                                                        <select name="kohafield" id="kohafield[% loo.row | html %]" size="1" disabled>
216
                                                        [% FOREACH value IN loo.kohafields %]
217
                                                        [% IF ( value == loo.kohafield ) %]
218
                                                            <option value="[% value | html %]" selected="selected">[% value | html %]</option>
219
                                                        [% ELSE %]
220
                                                            <option value="[% value | html %]">[% value | html %]</option>
221
                                                        [% END %]
222
                                                        [% END %]
223
                                                        </select>
224
                                                        <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
225
                                                        <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
226
                                                    </li>
227
                                                </ol>
228
                                            </fieldset>
229
                                        </div>
230
231
                                        <div id="oth[% loo.urisubfieldcode | html %]" class="contraints">
232
                                            <fieldset class="rows">
233
                                                <legend>Other options (choose one)</legend>
234
                                                <ol>
235
                                                    <li>
236
                                                        <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
237
                                                        <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
238
                                                        <option value=""></option>
239
                                                        [% FOREACH value IN loo.authorised_values %]
240
                                                            [% IF ( value == loo.authorised_value ) %]
241
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
242
                                                            [% ELSE %]
243
                                                                <option value="[% value | html %]">[% value | html %]</option>
244
                                                            [% END %]
245
                                                        [% END %]
246
                                                        </select>
247
                                                    </li>
248
                                                    <li>
249
                                                        <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
250
                                                        <select name="authtypecode" id="authtypecode[% loo.row | html %]" size="1">
251
                                                        [% FOREACH value IN loo.authtypes %]
252
                                                            [% IF ( value == loo.authtypecode ) %]
253
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
254
                                                            [% ELSE %]
255
                                                                <option value="[% value | html %]">[% value | html %]</option>
256
                                                            [% END %]
257
                                                        [% END %]
258
                                                        </select>
259
                                                    </li>
260
                                                    <li>
261
                                                        <label for="value_builder[% loo.row | html %]">Plugin:</label>
262
                                                        <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
263
                                                        [% FOREACH value IN loo.value_builders %]
264
                                                            [% IF ( value == loo.value_builder ) %]
265
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
266
                                                            [% ELSE %]
267
                                                                <option value="[% value | html %]">[% value | html %]</option>
268
                                                            [% END %]
269
                                                        [% END %]
270
                                                        </select>
271
                                                    </li>
272
                                                </ol>
273
                                            </fieldset>
274
                                        </div>
275
                                    </div><!-- /content_sub -->
276
                                [% END %]
277
                            </div><!-- /content -->
242
278
243
        <form action="[% delete_link | html %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
279
                            <fieldset class="action">
244
            <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
280
                                <input type="submit" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
245
            <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
281
                            </fieldset>
246
            <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
282
                        </form>
247
            <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
283
                    [% END %]
248
            <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
249
        </form>
250
284
285
                    [% IF ( delete_confirm ) %]
286
                        <div class="dialog alert">
287
                            <h3>Confirm deletion of subfield [% tagsubfield | html %]?</h3>
288
                            <p>Subfield: [% tagsubfield | html %]</p>
289
                            <p>Description: [% liblibrarian | html_entity %]</p>
251
290
252
        <form action="[% script_name | html %]" method="post">
291
                            <form action="[% delete_link | html %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
253
            <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
292
                                <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
254
            <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
293
                                <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
255
            <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
294
                                <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
256
            <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
295
                                <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
257
            <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
296
                                <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
258
        </form>
297
                            </form>
259
    </div>
260
298
261
[% END %]
262
299
263
[% IF ( delete_confirmed ) %]
300
                            <form action="[% script_name | html %]" method="post">
301
                                <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
302
                                <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
303
                                <input type="hidden" name="tagsubfield" value="[% tagsubfield | html %]" />
304
                                <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
305
                                <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
306
                            </form>
307
                        </div>
308
                    [% END %]
264
309
265
    <h3>Data deleted</h3>
310
                    [% IF ( delete_confirmed ) %]
266
    <form action="[% script_name | html %]" method="post">
311
                        <h3>Data deleted</h3>
267
        <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
312
                        <form action="[% script_name | html %]" method="post">
268
    <input type="submit" value="OK" />
313
                            <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
269
    </form>
314
                            <input type="submit" value="OK" />
270
[% END %]
315
                        </form>
316
                    [% END %]
271
317
318
                    [% IF ( else ) %]
319
                        <h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode | html %])[% ELSE %](default framework)[% END %]</h1>
320
                        <p>This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.</p>
321
                        <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
272
322
273
[% IF ( else ) %]
323
                        <table id="table_marcsubfieldstructure">
274
<h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode | html %])[% ELSE %](default framework)[% END %]</h1>
324
                            <thead>
275
<p>This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.</p>
325
                                <tr>
276
<p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
326
                                    <th>Subfield</th>
327
                                    <th>Text</th>
328
                                    <th>Constraints</th>
329
                                    <th class="NoSort">Actions</th>
330
                                </tr>
331
                            </thead>
332
                            <tbody>
333
                                [% FOREACH loo IN loop %]
334
                                    <tr>
335
                                        <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field">[% loo.tagsubfield | html %]</a></td>
336
                                        <td>
337
                                            [% IF ( loo.subfield_ignored ) %]
338
                                                <i>[% loo.liblibrarian | html_entity %]</i>
339
                                            [% ELSE %]
340
                                                [% loo.liblibrarian | html_entity %]
341
                                            [% END %]
342
                                        </td>
343
                                        <td>
344
                                            [% IF ( loo.subfield_ignored ) %]
345
                                                <i>subfield ignored</i>
346
                                            [% ELSE %]
347
                                                Tab:[% loo.tab | html %],
348
                                                [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield | html %], [% END %]
349
                                                [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
350
                                                [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
351
                                                [% IF ( loo.important ) %]Important, [% ELSE %]Not important,[% END %]
352
                                                [% IF ( loo.seealso ) %] | See Also: [% loo.seealso | html %],[% END %]
353
                                                [% IF ( loo.hidden ) %]hidden,[% END %]
354
                                                [% IF ( loo.isurl ) %]is a URL,[% END %]
355
                                                [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value | html %],[% END %]
356
                                                [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode | html %],[% END %]
357
                                                [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder | html %],[% END %]
358
                                                [% IF ( loo.link ) %] | Link:[% loo.link | html %],[% END %]
359
                                            [% END %]
360
                                        </td>
361
                                        <td class="actions">
362
                                            <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
363
                                            <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
364
                                        </td>
365
                                    </tr>
366
                                [% END %]
367
                            </tbody>
368
                        </table>
277
369
278
<table id="table_marcsubfieldstructure">
370
                        <form action="[% script_name | html %]" method="get">
279
    <thead>
371
                            <fieldset class="action"><input type="hidden" name="op" value="add_form" />
280
<tr>
372
                                <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
281
    <th>Subfield</th>
373
                                <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode | html %]" />
282
    <th>Text</th>
374
                                <input type="submit" value="Edit subfields" />
283
    <th>Constraints</th>
375
                                <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Cancel</a>
284
    <th class="NoSort">Actions</th>
376
                            </fieldset>
285
</tr>
377
                        </form>
286
    </thead>
287
    <tbody>
288
[% FOREACH loo IN loop %]
289
<tr>
290
    <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field">[% loo.tagsubfield | html %]</a></td>
291
    <td>
292
        [% IF ( loo.subfield_ignored ) %]
293
            <i>[% loo.liblibrarian | html_entity %]</i>
294
        [% ELSE %]
295
            [% loo.liblibrarian | html_entity %]
296
        [% END %]
297
    </td>
298
    <td>
299
        [% IF ( loo.subfield_ignored ) %]
300
            <i>subfield ignored</i>
301
        [% ELSE %]
302
            Tab:[% loo.tab | html %],
303
            [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield | html %], [% END %]
304
            [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
305
            [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
306
            [% IF ( loo.important ) %]Important, [% ELSE %]Not important,[% END %]
307
            [% IF ( loo.seealso ) %] | See Also: [% loo.seealso | html %],[% END %]
308
            [% IF ( loo.hidden ) %]hidden,[% END %]
309
            [% IF ( loo.isurl ) %]is a URL,[% END %]
310
            [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value | html %],[% END %]
311
            [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode | html %],[% END %]
312
            [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder | html %],[% END %]
313
            [% IF ( loo.link ) %] | Link:[% loo.link | html %],[% END %]
314
        [% END %]
315
    </td>
316
    <td class="actions">
317
        <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
318
        <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
319
    </td>
320
</tr>
321
[% END %]
322
    </tbody>
323
</table>
324
378
325
<form action="[% script_name | html %]" method="get">
379
                    [% END %]
326
    <fieldset class="action"><input type="hidden" name="op" value="add_form" />
327
    <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
328
    <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode | html %]" />
329
    <input type="submit" value="Edit subfields" />
330
        <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Cancel</a>
331
	</fieldset>
332
</form>
333
380
334
[% END %]
381
                </main>
382
            </div> <!-- /.col-sm-10.col-sm-push-2 -->
335
383
336
            </main>
384
            <div class="col-sm-2 col-sm-pull-10">
337
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
385
                <aside>
386
                    [% INCLUDE 'admin-menu.inc' %]
387
                </aside>
388
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
389
        </div> <!-- /.row -->
338
390
339
        <div class="col-sm-2 col-sm-pull-10">
391
    [% MACRO jsinclude BLOCK %]
340
            <aside>
392
        [% INCLUDE 'datatables.inc' %]
341
                [% INCLUDE 'admin-menu.inc' %]
393
        [% Asset.js("js/admin-menu.js") | $raw %]
342
            </aside>
394
        [% Asset.js("js/marc_subfields_structure.js") | $raw %]
343
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
395
    [% END %]
344
     </div> <!-- /.row -->
345
396
346
[% MACRO jsinclude BLOCK %]
397
    [% INCLUDE 'intranet-bottom.inc' %]
347
    [% INCLUDE 'datatables.inc' %]
348
    [% Asset.js("js/admin-menu.js") | $raw %]
349
    [% Asset.js("js/marc_subfields_structure.js") | $raw %]
350
[% END %]
351
[% INCLUDE 'intranet-bottom.inc' %]
352
- 

Return to bug 26456