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

(-)a/admin/patron-attr-types.pl (-2 / +14 lines)
Lines 53-59 $template->param(script_name => $script_name); Link Here
53
my $code = $input->param("code");
53
my $code = $input->param("code");
54
54
55
my $display_list = 0;
55
my $display_list = 0;
56
if ($op eq "edit_attribute_type") {
56
if( $op eq "attribute_type_model" ) {
57
    attribute_type_model($template);
58
} elsif ($op eq "edit_attribute_type") {
57
    edit_attribute_type_form($template, $code);
59
    edit_attribute_type_form($template, $code);
58
} elsif ($op eq "cud-edit_attribute_type_confirmed") {
60
} elsif ($op eq "cud-edit_attribute_type_confirmed") {
59
    $display_list = add_update_attribute_type('edit', $template, $code);
61
    $display_list = add_update_attribute_type('edit', $template, $code);
Lines 81-94 output_html_with_http_headers $input, $cookie, $template->output; Link Here
81
83
82
exit 0;
84
exit 0;
83
85
86
sub attribute_type_model {
87
    my $template = shift;
88
89
    $template->param(
90
        attribute_type_model => 1,
91
    );
92
}
93
84
sub add_attribute_type_form {
94
sub add_attribute_type_form {
85
    my $template = shift;
95
    my $template = shift;
86
96
87
    my $patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']});
97
    my $model             = $input->param('model');
98
    my $patron_categories = Koha::Patron::Categories->search_with_library_limits( {}, { order_by => ['description'] } );
88
    $template->param(
99
    $template->param(
89
        attribute_type_form => 1,
100
        attribute_type_form => 1,
90
        confirm_op => 'cud-add_attribute_type_confirmed',
101
        confirm_op => 'cud-add_attribute_type_confirmed',
91
        categories => $patron_categories,
102
        categories => $patron_categories,
103
        model      => $model
92
    );
104
    );
93
}
105
}
94
106
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-15 / +65 lines)
Lines 74-79 Link Here
74
<div class="dialog message">Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records.  <br/>Go to the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=ExtendedPatronAttributes">ExtendedPatronAttributes</a> system preference if you wish to enable this feature.</div>
74
<div class="dialog message">Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records.  <br/>Go to the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=ExtendedPatronAttributes">ExtendedPatronAttributes</a> system preference if you wish to enable this feature.</div>
75
[% END %]
75
[% END %]
76
76
77
[% IF ( attribute_type_model ) %]
78
    [% WRAPPER module_langing_page %]
79
        [% WRAPPER module_langing_page_content label = t("Select the attribute type model") %]
80
            [% WRAPPER module_langing_page_column %]
81
                [% WRAPPER module_langing_page_item
82
                    title = t("Basic")
83
                    item_permission = ( CAN_user_catalogue )
84
                    sub_items = [
85
                        {
86
                            'label' => t("Text"),
87
                            'icon_class' => 'fa fa-pencil',
88
                            'link' => script_name _ '?op=add_attribute_type&model=text',
89
                            'permission' => CAN_user_catalogue,
90
                        },
91
                        {
92
                            'label' => t("Date"),
93
                            'icon_class' => 'fa fa-calendar',
94
                            'link' => script_name _ '?op=add_attribute_type&model=date',
95
                            'permission' => CAN_user_catalogue,
96
                        }
97
                    ]
98
                %]
99
                [% END %]
100
            [% END %] <!-- module_langing_page_column-->
101
            [% WRAPPER module_langing_page_column %]
102
                [% WRAPPER module_langing_page_item
103
                    title = t("Choice")
104
                    item_permission = ( CAN_user_catalogue )
105
                    sub_items = [
106
                        {
107
                            'label' => t("Authorized value category"),
108
                            'icon_class' => 'fa fa-list',
109
                            'link' => script_name _ '?op=add_attribute_type&model=avc',
110
                            'permission' => CAN_user_catalogue,
111
                        }
112
                    ]
113
                %]
114
                [% END %]
115
            [% END %] <!-- module_langing_page_column-->
116
        [% END %] <!-- module_langing_page_content -->
117
118
        [%- SET StaffCataloguingHome = AdditionalContents.get( location => "StaffCataloguingHome", lang => lang, library => logged_in_user.branchcode ) -%]
119
        [%- FOREACH block IN StaffCataloguingHome.content -%]
120
        <div class="page-section">
121
            [%- block.content | $raw -%]
122
        </div>
123
        [%- END -%]
124
    [% END %] <!-- module_langing_page -->
125
[% END %]
126
77
[% IF ( attribute_type_form ) %]
127
[% IF ( attribute_type_form ) %]
78
  [% IF ( edit_attribute_type ) %]
128
  [% IF ( edit_attribute_type ) %]
79
<h1>[% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %]</h1>
129
<h1>[% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %]</h1>
Lines 106-111 Link Here
106
           <span class="required">Required</span>
156
           <span class="required">Required</span>
107
       </li>
157
       </li>
108
158
159
        [% IF attribute_type AND attribute_type.authorised_value_category OR model == "avc" %]
160
        <li>
161
            <label for="authorised_value_category">Authorized value category: </label>
162
            <select name="authorised_value_category" id="authorised_value_category">
163
                <option value=""></option>
164
                [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => attribute_type.authorised_value_category ) %]
165
            </select>
166
        </li>
167
        [% END %]
168
109
        [% IF attribute_type AND attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]
169
        [% IF attribute_type AND attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]
110
            <li aria-disabled="true">
170
            <li aria-disabled="true">
111
        [% ELSE %]
171
        [% ELSE %]
Lines 148-160 Link Here
148
            <span class="hint">If checked, attribute will be a unique identifier. If a value is given to a patron record, the same value
208
            <span class="hint">If checked, attribute will be a unique identifier. If a value is given to a patron record, the same value
149
                  cannot be given to a different record.</span>
209
                  cannot be given to a different record.</span>
150
        </li>
210
        </li>
151
        <li><label for="is_date">Is a date: </label>
211
        <li>
152
            [% IF attribute_type AND attribute_type.is_date %]
212
            [% IF attribute_type AND attribute_type.is_date OR model == 'date' %]
153
                <input type="checkbox" id="is_date" name="is_date" checked="checked" />
213
                <input hidden type="checkbox" id="is_date" name="is_date" checked="checked" />
154
            [% ELSE %]
214
            [% ELSE %]
155
                <input type="checkbox" id="is_date" name="is_date" />
215
                <input hidden type="checkbox" id="is_date" name="is_date" />
156
            [% END %]
216
            [% END %]
157
            <span class="hint">If checked, attribute will be a date. Date attributes cannot be repeatable or linked to an authorised value category.</span>
158
        </li>
217
        </li>
159
       <li><label for="opac_display">Display in OPAC: </label>
218
       <li><label for="opac_display">Display in OPAC: </label>
160
          [% IF attribute_type AND attribute_type.opac_display %]
219
          [% IF attribute_type AND attribute_type.opac_display %]
Lines 222-235 Link Here
222
                <span class="hint">Check to make this attribute copied to the patron's pseudonymized attributes.</span>
281
                <span class="hint">Check to make this attribute copied to the patron's pseudonymized attributes.</span>
223
            </li>
282
            </li>
224
        [% END %]
283
        [% END %]
225
226
        <li><label for="authorised_value_category">Authorized value category: </label>
227
            <select name="authorised_value_category" id="authorised_value_category">
228
                <option value=""></option>
229
                [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => attribute_type.authorised_value_category ) %]
230
            </select>
231
            <div class="hint">If one is selected, the patron record input page will only allow values to be chosen from the authorized value list.  However, an authorized value list is not enforced during batch patron import.</div>
232
        </li>
233
        <li><label for="branches">Library limitation: </label>
284
        <li><label for="branches">Library limitation: </label>
234
            <select id="branches" name="branches" multiple size="10">
285
            <select id="branches" name="branches" multiple size="10">
235
                <option value="">All libraries</option>
286
                <option value="">All libraries</option>
Lines 288-294 Link Here
288
[% IF ( display_list ) %]
339
[% IF ( display_list ) %]
289
340
290
<div id="toolbar" class="btn-toolbar">
341
<div id="toolbar" class="btn-toolbar">
291
    <a class="btn btn-default" id="newrule" href="[% script_name | url %]?op=add_attribute_type"><i class="fa fa-plus"></i> New patron attribute type</a>
342
    <a class="btn btn-default" id="newrule" href="[% script_name | url %]?op=attribute_type_model"><i class="fa fa-plus"></i> New patron attribute type</a>
292
</div>
343
</div>
293
344
294
<h1>Patron attribute types</h1>
345
<h1>Patron attribute types</h1>
295
- 

Return to bug 36751