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

(-)a/admin/patron-attr-types.pl (+2 lines)
Lines 117-122 sub add_update_attribute_type { Link Here
117
    my $opac_display              = $input->param('opac_display') ? 1 : 0;
117
    my $opac_display              = $input->param('opac_display') ? 1 : 0;
118
    my $opac_editable             = $input->param('opac_editable') ? 1 : 0;
118
    my $opac_editable             = $input->param('opac_editable') ? 1 : 0;
119
    my $staff_searchable          = $input->param('staff_searchable') ? 1 : 0;
119
    my $staff_searchable          = $input->param('staff_searchable') ? 1 : 0;
120
    my $searched_by_default       = $input->param('searched_by_default') ? 1 : 0;
120
    my $keep_for_pseudonymization = $input->param('keep_for_pseudonymization') ? 1 : 0;
121
    my $keep_for_pseudonymization = $input->param('keep_for_pseudonymization') ? 1 : 0;
121
    my $mandatory                 = $input->param('mandatory') ? 1 : 0;
122
    my $mandatory                 = $input->param('mandatory') ? 1 : 0;
122
    my $authorised_value_category = $input->param('authorised_value_category');
123
    my $authorised_value_category = $input->param('authorised_value_category');
Lines 152-157 sub add_update_attribute_type { Link Here
152
            opac_display              => $opac_display,
153
            opac_display              => $opac_display,
153
            opac_editable             => $opac_editable,
154
            opac_editable             => $opac_editable,
154
            staff_searchable          => $staff_searchable,
155
            staff_searchable          => $staff_searchable,
156
            searched_by_default       => $searched_by_default,
155
            keep_for_pseudonymization => $keep_for_pseudonymization,
157
            keep_for_pseudonymization => $keep_for_pseudonymization,
156
            mandatory                 => $mandatory,
158
            mandatory                 => $mandatory,
157
            authorised_value_category => $authorised_value_category,
159
            authorised_value_category => $authorised_value_category,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-1 / +1 lines)
Lines 233-239 Link Here
233
        }, {});
233
        }, {});
234
234
235
        [% IF Koha.Preference('ExtendedPatronAttributes') %]
235
        [% IF Koha.Preference('ExtendedPatronAttributes') %]
236
            [% SET extended_attribute_types = [ ExtendedAttributeTypes.codes( staff_searchable => 1 ) ] %]
236
            [% SET extended_attribute_types = [ ExtendedAttributeTypes.codes( staff_searchable => 1, searched_by_default => 1 ) ] %]
237
            let extended_attribute_types = [% To.json(extended_attribute_types || []) | $raw %];
237
            let extended_attribute_types = [% To.json(extended_attribute_types || []) | $raw %];
238
        [% END %]
238
        [% END %]
239
239
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-2 / +43 lines)
Lines 165-171 Patron attribute types › Administration › Koha Link Here
165
          [% ELSE %]
165
          [% ELSE %]
166
            <input type="checkbox" id="staff_searchable" name="staff_searchable" />
166
            <input type="checkbox" id="staff_searchable" name="staff_searchable" />
167
          [% END %]
167
          [% END %]
168
            <span class="hint">Check to make this attribute staff_searchable in the staff patron search.</span>
168
            <span class="hint">
169
                Check to make this attribute searchable in staff patron searches. If
170
                checked, this attribute will appear in patron search dropdowns.
171
            </span>
172
       </li>
173
       <li><label for="searched_by_default">Search by default: </label>
174
          [% IF attribute_type AND attribute_type.searched_by_default %]
175
            <input type="checkbox" id="searched_by_default" name="searched_by_default" checked="checked" />
176
          [% ELSE %]
177
            <input type="checkbox" id="searched_by_default" name="searched_by_default" />
178
          [% END %]
179
            <span class="hint">
180
                If checked, this field will be included in 'Standard' patron searches. Requires
181
                field to be marked as searchable above
182
            </span>
169
       </li>
183
       </li>
170
       <li><label for="mandatory">Mandatory: </label>
184
       <li><label for="mandatory">Mandatory: </label>
171
          [% IF attribute_type AND attribute_type.mandatory %]
185
          [% IF attribute_type AND attribute_type.mandatory %]
Lines 295-300 Patron attribute types &rsaquo; Administration &rsaquo; Koha Link Here
295
              <th>Library limitation</th>
309
              <th>Library limitation</th>
296
              <th>Authorized value category</th>
310
              <th>Authorized value category</th>
297
              <th>Mandatory</th>
311
              <th>Mandatory</th>
312
              <th>Searching</th>
298
              <th class="NoSort noExport">Actions</th>
313
              <th class="NoSort noExport">Actions</th>
299
            </tr>
314
            </tr>
300
          </thead>
315
          </thead>
Lines 334-339 Patron attribute types &rsaquo; Administration &rsaquo; Koha Link Here
334
                       <span>No</span>
349
                       <span>No</span>
335
                    [% END %]
350
                    [% END %]
336
                </td>
351
                </td>
352
                <td>
353
                    [% IF ( item.staff_searchable ) %]
354
                        [% IF( item.searched_by_default ) %]
355
                            <span>Searched by default</span>
356
                        [% ELSE %]
357
                            <span>Searchable</span>
358
                        [% END %]
359
                    [% ELSE %]
360
                        <span>Not searchable</span>
361
                    [% END %]
362
                </td>
337
                <td class="actions">
363
                <td class="actions">
338
                  <a class="btn btn-default btn-xs" href="[% script_name | url %]?op=edit_attribute_type&amp;code=[% item.code | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
364
                  <a class="btn btn-default btn-xs" href="[% script_name | url %]?op=edit_attribute_type&amp;code=[% item.code | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
339
                  <a class="btn btn-default btn-xs" href="[% script_name | url %]?op=delete_attribute_type&amp;code=[% item.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
365
                  <a class="btn btn-default btn-xs" href="[% script_name | url %]?op=delete_attribute_type&amp;code=[% item.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
Lines 368-373 Patron attribute types &rsaquo; Administration &rsaquo; Koha Link Here
368
    [% INCLUDE 'columns_settings.inc' %]
394
    [% INCLUDE 'columns_settings.inc' %]
369
    <script>
395
    <script>
370
        $(document).ready(function() {
396
        $(document).ready(function() {
397
398
            function toggle_search_default(){
399
                if( $("#staff_searchable").is(":checked") ){
400
                    $("#searched_by_default").prop('disabled', false);
401
                } else {
402
403
                    $("#searched_by_default").prop('disabled', true).prop('checked',false);
404
                }
405
            }
406
            $("#staff_searchable").on('change',function(){
407
                toggle_search_default();
408
            });
409
410
            toggle_search_default();
411
412
371
            if ( $("#branches option:selected").length < 1 ) {
413
            if ( $("#branches option:selected").length < 1 ) {
372
                $("#branches option:first").attr("selected", "selected");
414
                $("#branches option:first").attr("selected", "selected");
373
            }
415
            }
374
- 

Return to bug 34517