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

(-)a/Koha/Patron.pm (-4 / +4 lines)
Lines 2272-2280 sub extended_attributes { Link Here
2272
                # Check globally mandatory types
2272
                # Check globally mandatory types
2273
                my $interface = C4::Context->interface;
2273
                my $interface = C4::Context->interface;
2274
                my $params    = {
2274
                my $params    = {
2275
                    mandatory                                        => 1,
2275
                    mandatory                                          => 1,
2276
                    category_code                                    => [ undef, $self->categorycode ],
2276
                    'borrower_attribute_types_categories.categorycode' => [ undef, $self->categorycode ],
2277
                    'borrower_attribute_types_branches.b_branchcode' => undef,
2277
                    'borrower_attribute_types_branches.b_branchcode'   => undef,
2278
                };
2278
                };
2279
2279
2280
                if ( $interface eq 'opac' ) {
2280
                if ( $interface eq 'opac' ) {
Lines 2283-2289 sub extended_attributes { Link Here
2283
2283
2284
                my @required_attribute_types = Koha::Patron::Attribute::Types->search(
2284
                my @required_attribute_types = Koha::Patron::Attribute::Types->search(
2285
                    $params,
2285
                    $params,
2286
                    { join => 'borrower_attribute_types_branches' }
2286
                    { join => [ 'borrower_attribute_types_branches', 'borrower_attribute_types_categories' ] }
2287
                )->get_column('code');
2287
                )->get_column('code');
2288
                for my $type (@required_attribute_types) {
2288
                for my $type (@required_attribute_types) {
2289
                    Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw(
2289
                    Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw(
(-)a/Koha/Patron/Attribute/Type.pm (+22 lines)
Lines 60-65 sub attributes { Link Here
60
    Koha::Patron::Attributes->_new_from_dbic($attributes_rs);
60
    Koha::Patron::Attributes->_new_from_dbic($attributes_rs);
61
}
61
}
62
62
63
=head3 categories
64
65
Get or set attribute type's categories
66
67
    my @categories = $attribute_type->categories->as_list;
68
    $attribute_type->categories(\@categories);
69
70
=cut
71
72
sub categories {
73
    my ( $self, $categories ) = @_;
74
75
    if ($categories) {
76
        my @categorycodes = map { $_->_result } @$categories;
77
        $self->_result->set_categorycodes( \@categorycodes );
78
        return $self;
79
    }
80
81
    my $rs = $self->_result->categorycodes;
82
    return Koha::Patron::Categories->_new_from_dbic($rs);
83
}
84
63
=head2 Internal Methods
85
=head2 Internal Methods
64
86
65
=cut
87
=cut
(-)a/admin/patron-attr-types.pl (-2 / +4 lines)
Lines 118-124 sub add_update_attribute_type { Link Here
118
    my $mandatory                 = $input->param('mandatory')                 ? 1 : 0;
118
    my $mandatory                 = $input->param('mandatory')                 ? 1 : 0;
119
    my $authorised_value_category = $input->param('authorised_value_category');
119
    my $authorised_value_category = $input->param('authorised_value_category');
120
    my $display_checkout          = $input->param('display_checkout') ? 1 : 0;
120
    my $display_checkout          = $input->param('display_checkout') ? 1 : 0;
121
    my $category_code             = $input->param('category_code') || undef;
122
    my $class                     = $input->param('class');
121
    my $class                     = $input->param('class');
123
122
124
    my $attr_type = Koha::Patron::Attribute::Types->find($code);
123
    my $attr_type = Koha::Patron::Attribute::Types->find($code);
Lines 154-160 sub add_update_attribute_type { Link Here
154
            mandatory                 => $mandatory,
153
            mandatory                 => $mandatory,
155
            authorised_value_category => $authorised_value_category,
154
            authorised_value_category => $authorised_value_category,
156
            display_checkout          => $display_checkout,
155
            display_checkout          => $display_checkout,
157
            category_code             => $category_code,
158
            class                     => $class,
156
            class                     => $class,
159
        }
157
        }
160
    )->store;
158
    )->store;
Lines 162-167 sub add_update_attribute_type { Link Here
162
    my @branches = grep { !/^\s*$/ } $input->multi_param('branches');
160
    my @branches = grep { !/^\s*$/ } $input->multi_param('branches');
163
    $attr_type->library_limits( \@branches );
161
    $attr_type->library_limits( \@branches );
164
162
163
    my @categories = grep { !/^\s*$/ } $input->multi_param('category_code');
164
    $attr_type->categories( [ Koha::Patron::Categories->search( { categorycode => \@categories } )->as_list ] );
165
165
    if ( $op eq 'edit' ) {
166
    if ( $op eq 'edit' ) {
166
        $template->param( edited_attribute_type => $attr_type->code() );
167
        $template->param( edited_attribute_type => $attr_type->code() );
167
    } else {
168
    } else {
Lines 235-240 sub edit_attribute_type_form { Link Here
235
        $can_be_set_to_unique = 0 if $@;
236
        $can_be_set_to_unique = 0 if $@;
236
        $attr_type->unique_id(0);
237
        $attr_type->unique_id(0);
237
    }
238
    }
239
238
    $template->param(
240
    $template->param(
239
        attribute_type              => $attr_type,
241
        attribute_type              => $attr_type,
240
        attribute_type_form         => 1,
242
        attribute_type_form         => 1,
(-)a/installer/data/mysql/atomicupdate/bug-26573.pl (+54 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => '26573',
5
    description => 'Add table borrower_attribute_types_categories',
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{
12
            CREATE TABLE IF NOT EXISTS `borrower_attribute_types_categories` (
13
                `borrower_attribute_type_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
14
                `categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
15
                KEY `borrower_attribute_type_code` (`borrower_attribute_type_code`),
16
                KEY `categorycode` (`categorycode`),
17
                CONSTRAINT `borrower_attribute_types_categories_borrower_attribute_type_code` FOREIGN KEY (`borrower_attribute_type_code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
18
                CONSTRAINT `borrower_attribute_types_categories_categorycode` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE,
19
                PRIMARY KEY (`borrower_attribute_type_code`, `categorycode`)
20
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
21
        }
22
        );
23
24
        say $out "Table 'borrower_attribute_types_categories' created";
25
26
        if ( column_exists( 'borrower_attribute_types', 'category_code' ) ) {
27
            $dbh->do(
28
                q{
29
                INSERT IGNORE INTO borrower_attribute_types_categories (borrower_attribute_type_code, categorycode)
30
                SELECT `code`, `category_code` FROM `borrower_attribute_types`
31
                WHERE `category_code` IS NOT NULL
32
            }
33
            );
34
35
            say $out
36
                "Data migrated from 'borrower_attribute_types.category_code' to 'borrower_attribute_types_categories'";
37
38
            $dbh->do(
39
                q{
40
                ALTER TABLE `borrower_attribute_types`
41
                DROP FOREIGN KEY `borrower_attribute_types_ibfk_1`
42
            }
43
            );
44
            $dbh->do(
45
                q{
46
                ALTER TABLE `borrower_attribute_types`
47
                DROP COLUMN `category_code`
48
            }
49
            );
50
51
            say $out "Column 'borrower_attribute_types.category_code' deleted";
52
        }
53
    },
54
};
(-)a/installer/data/mysql/kohastructure.sql (-5 / +20 lines)
Lines 1257-1270 CREATE TABLE `borrower_attribute_types` ( Link Here
1257
  `searched_by_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is included in "Standard" patron searches in the staff interface (1 for yes, 0 for no)',
1257
  `searched_by_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is included in "Standard" patron searches in the staff interface (1 for yes, 0 for no)',
1258
  `authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'foreign key from authorised_values that links this custom field to an authorized value category',
1258
  `authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'foreign key from authorised_values that links this custom field to an authorized value category',
1259
  `display_checkout` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field displays in checkout screens',
1259
  `display_checkout` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field displays in checkout screens',
1260
  `category_code` varchar(10) DEFAULT NULL COMMENT 'defines a category for an attribute_type',
1261
  `class` varchar(255) NOT NULL DEFAULT '' COMMENT 'defines a class for an attribute_type',
1260
  `class` varchar(255) NOT NULL DEFAULT '' COMMENT 'defines a class for an attribute_type',
1262
  `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)',
1261
  `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)',
1263
  `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not',
1262
  `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not',
1264
  PRIMARY KEY (`code`),
1263
  PRIMARY KEY (`code`),
1265
  KEY `auth_val_cat_idx` (`authorised_value_category`),
1264
  KEY `auth_val_cat_idx` (`authorised_value_category`)
1266
  KEY `category_code` (`category_code`),
1267
  CONSTRAINT `borrower_attribute_types_ibfk_1` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`)
1268
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1265
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1269
/*!40101 SET character_set_client = @saved_cs_client */;
1266
/*!40101 SET character_set_client = @saved_cs_client */;
1270
1267
Lines 1285-1290 CREATE TABLE `borrower_attribute_types_branches` ( Link Here
1285
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1282
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1286
/*!40101 SET character_set_client = @saved_cs_client */;
1283
/*!40101 SET character_set_client = @saved_cs_client */;
1287
1284
1285
--
1286
-- Table structure for table `borrower_attribute_types_categories`
1287
--
1288
1289
DROP TABLE IF EXISTS `borrower_attribute_types_categories`;
1290
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1291
/*!40101 SET character_set_client = utf8 */;
1292
CREATE TABLE `borrower_attribute_types_categories` (
1293
  `borrower_attribute_type_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
1294
  `categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
1295
  KEY `borrower_attribute_type_code` (`borrower_attribute_type_code`),
1296
  KEY `categorycode` (`categorycode`),
1297
  CONSTRAINT `borrower_attribute_types_categories_borrower_attribute_type_code` FOREIGN KEY (`borrower_attribute_type_code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE,
1298
  CONSTRAINT `borrower_attribute_types_categories_categorycode` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE,
1299
  PRIMARY KEY (`borrower_attribute_type_code`, `categorycode`)
1300
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1301
/*!40101 SET character_set_client = @saved_cs_client */;
1302
1288
--
1303
--
1289
-- Table structure for table `borrower_attributes`
1304
-- Table structure for table `borrower_attributes`
1290
--
1305
--
Lines 6755-6758 CREATE TABLE `zebraqueue` ( Link Here
6755
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
6770
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
6756
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
6771
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
6757
6772
6758
-- Dump completed on 2024-11-25 12:13:27
6773
-- Dump completed on 2024-11-25 12:13:27
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-458 lines)
Lines 1-458 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% USE AuthorisedValues %]
5
[% USE Branches %]
6
[% USE scalar %]
7
[% PROCESS 'i18n.inc' %]
8
[% SET footerjs = 1 %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
<title
11
    >[% FILTER collapse %]
12
        [% IF ( attribute_type_form ) %]
13
            [% IF ( edit_attribute_type ) %]
14
                [% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %]
15
                &rsaquo;
16
            [% ELSE %]
17
                [% t("New patron attribute type") | html %]
18
                &rsaquo;
19
            [% END %]
20
        [% END %]
21
        [% IF ( delete_attribute_type_form ) %]
22
            [% tx("Confirm deletion of patron attribute type '{code}'", { code = code }) | html %]
23
            &rsaquo;
24
        [% END %]
25
        [% t("Patron attribute types") | html %]
26
        &rsaquo; [% t("Administration") | html %] &rsaquo; [% t("Koha") | html %]
27
    [% END %]</title
28
>
29
[% INCLUDE 'doc-head-close.inc' %]
30
</head>
31
32
<body id="admin_patron-attr-types" class="admin">
33
[% WRAPPER 'header.inc' %]
34
    [% INCLUDE 'prefs-admin-search.inc' %]
35
[% END %]
36
37
[% WRAPPER 'sub-header.inc' %]
38
    [% WRAPPER breadcrumbs %]
39
        [% WRAPPER breadcrumb_item %]
40
            <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
41
        [% END %]
42
43
        [% IF ( attribute_type_form || delete_attribute_type_form ) %]
44
            [% WRAPPER breadcrumb_item %]
45
                <a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a>
46
            [% END %]
47
        [% END %]
48
49
        [% IF ( attribute_type_form ) %]
50
            [% WRAPPER breadcrumb_item bc_active= 1 %]
51
                [% IF ( edit_attribute_type ) %]
52
                    [% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %]
53
                [% ELSE %]
54
                    <span>New patron attribute type</span>
55
                [% END %]
56
            [% END %]
57
        [% ELSIF ( delete_attribute_type_form ) %]
58
            [% WRAPPER breadcrumb_item bc_active= 1 %]
59
                [% tx("Confirm deletion of patron attribute type '{code}'", { code = code }) | html %]
60
            [% END %]
61
        [% ELSE %]
62
            [% WRAPPER breadcrumb_item bc_active= 1 %]
63
                <span>Patron attribute types</span>
64
            [% END %]
65
        [% END %]
66
    [% END #/ WRAPPER breadcrumbs %]
67
[% END #/ WRAPPER sub-header.inc %]
68
69
[% WRAPPER 'main-container.inc' aside='admin-menu' %]
70
71
    [% IF ( WARNING_extended_attributes_off ) %]
72
        <div class="alert alert-info"
73
            >Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records. <br />Go to the
74
            <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
        >
76
    [% END %]
77
78
    [% IF ( attribute_type_form ) %]
79
        [% IF ( edit_attribute_type ) %]
80
            <h1>[% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %]</h1>
81
        [% ELSE %]
82
            <h1>New patron attribute type</h1>
83
        [% END %]
84
        [% IF ( duplicate_code_error ) %]
85
            <div class="alert alert-info">Could not add patron attribute type &quot;[% duplicate_code_error | html %]&quot; &mdash; one with that code already exists. </div>
86
        [% END %]
87
        <form action="/cgi-bin/koha/admin/patron-attr-types.pl" class="validated" method="post">
88
            [% INCLUDE 'csrf-token.inc' %]
89
            <input type="hidden" name="op" value="[% confirm_op | html %]" />
90
            <fieldset class="rows">
91
                <ol>
92
                    <li>
93
                        [% IF attribute_type %]
94
                            <span class="label">Patron attribute type code: </span>
95
                            <input type="hidden" name="code" value="[% attribute_type.code |html %]" />
96
                            [% attribute_type.code |html %]
97
                        [% ELSE %]
98
                            <label for="code" class="required">Patron attribute type code: </label>
99
                            <input type="text" id="code" name="code" required="required" class="required focus" maxlength="64" />
100
                            <span class="required">Required</span>
101
                        [% END %]
102
                    </li>
103
                    <li
104
                        ><label for="description" class="required">Description: </label>
105
                        <input type="text" id="description" name="description" required="required" class="required" size="50" maxlength="250" value="[% attribute_type.description |html %]" />
106
                        <span class="required">Required</span>
107
                    </li>
108
109
                    <li [% IF attribute_type AND attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]aria-disabled="true"[% END %]>
110
                        <label for="repeatable">Repeatable: </label>
111
                        [% IF attribute_type %]
112
                            [% IF attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]
113
                                <input type="checkbox" id="repeatable" name="repeatable" checked="checked" disabled="disabled" title="At least one patron has more than one value for this attribute" />
114
                                <input type="hidden" name="repeatable" value="1" />
115
                            [% ELSIF attribute_type.repeatable %]
116
                                <input type="checkbox" id="repeatable" name="repeatable" checked="checked" />
117
                            [% ELSE %]
118
                                <input type="checkbox" id="repeatable" name="repeatable" />
119
                            [% END %]
120
                        [% ELSE %]
121
                            <input type="checkbox" id="repeatable" name="repeatable" />
122
                        [% END %]
123
                        <span class="hint">Check to let a patron record have multiple values of this attribute.</span>
124
                    </li>
125
126
                    <li [% IF attribute_type AND not can_be_set_to_unique %]aria-disabled="true"[% END %]>
127
                        <label for="unique_id">Unique identifier: </label>
128
                        [% IF attribute_type %]
129
                            [% IF attribute_type.unique_id %]
130
                                <input type="checkbox" id="unique_id" name="unique_id" checked="checked" />
131
                            [% ELSIF can_be_set_to_unique %]
132
                                <input type="checkbox" id="unique_id" name="unique_id" />
133
                            [% ELSE %]
134
                                <input type="checkbox" id="unique_id" name="unique_id" disabled="disabled" title="At least two patrons have the same value for this attribute" />
135
                                <input type="hidden" name="unique_id" value="0" />
136
                            [% END %]
137
                        [% ELSE %]
138
                            <input type="checkbox" id="unique_id" name="unique_id" />
139
                        [% END %]
140
                        <span class="hint">If checked, attribute will be a unique identifier. If a value is given to a patron record, the same value cannot be given to a different record.</span>
141
                    </li>
142
                    <li
143
                        ><label for="is_date">Is a date: </label>
144
                        [% IF attribute_type AND attribute_type.is_date %]
145
                            <input type="checkbox" id="is_date" name="is_date" checked="checked" />
146
                        [% ELSE %]
147
                            <input type="checkbox" id="is_date" name="is_date" />
148
                        [% END %]
149
                        <span class="hint">If checked, the attribute will be a date. Date attributes can be repeatable, but cannot be linked to an authorized value category.</span>
150
                    </li>
151
                    <li
152
                        ><label for="opac_display">Display in OPAC: </label>
153
                        [% IF attribute_type AND attribute_type.opac_display %]
154
                            <input type="checkbox" id="opac_display" name="opac_display" checked="checked" />
155
                        [% ELSE %]
156
                            <input type="checkbox" id="opac_display" name="opac_display" />
157
                        [% END %]
158
                        <span class="hint">Check to display this attribute on a patron's details page in the OPAC.</span>
159
                    </li>
160
                    <li
161
                        ><label for="opac_editable">Editable in OPAC: </label>
162
                        [% IF attribute_type AND attribute_type.opac_editable %]
163
                            <input type="checkbox" id="opac_editable" name="opac_editable" checked="checked" />
164
                        [% ELSE %]
165
                            <input type="checkbox" id="opac_editable" name="opac_editable" />
166
                        [% END %]
167
                        <span class="hint">Check to allow patrons to edit this attribute from their details page in the OPAC. (Requires above)</span>
168
                    </li>
169
                    <li
170
                        ><label for="staff_searchable">Searchable: </label>
171
                        [% IF attribute_type AND attribute_type.staff_searchable %]
172
                            <input type="checkbox" id="staff_searchable" name="staff_searchable" checked="checked" />
173
                        [% ELSE %]
174
                            <input type="checkbox" id="staff_searchable" name="staff_searchable" />
175
                        [% END %]
176
                        <span class="hint"> Check to make this attribute searchable in staff patron searches. If checked, this attribute will appear in patron search dropdowns. </span>
177
                    </li>
178
                    <li
179
                        ><label for="searched_by_default">Search by default: </label>
180
                        [% IF attribute_type AND attribute_type.searched_by_default %]
181
                            <input type="checkbox" id="searched_by_default" name="searched_by_default" checked="checked" />
182
                        [% ELSE %]
183
                            <input type="checkbox" id="searched_by_default" name="searched_by_default" />
184
                        [% END %]
185
                        <span class="hint"> If checked, this field will be included in 'Standard' patron searches. Requires field to be marked as searchable above </span>
186
                    </li>
187
                    <li
188
                        ><label for="mandatory">Mandatory: </label>
189
                        [% IF attribute_type AND attribute_type.mandatory %]
190
                            <input type="checkbox" id="mandatory" name="mandatory" checked="checked" />
191
                        [% ELSE %]
192
                            <input type="checkbox" id="mandatory" name="mandatory" />
193
                        [% END %]
194
                        <span class="hint">Check to make this attribute mandatory when creating or editing a patron.</span>
195
                    </li>
196
                    <li
197
                        ><label for="display_checkout">Display in patron's brief information: </label>
198
                        [% IF attribute_type AND attribute_type.display_checkout %]
199
                            <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" />
200
                        [% ELSE %]
201
                            <input type="checkbox" id="display_checkout" name="display_checkout" />
202
                        [% END %]
203
                        <span class="hint">Check to show this attribute in the brief information panel in the patron's record (staff interface).</span>
204
                    </li>
205
206
                    [% IF Koha.Preference('Pseudonymization') %]
207
                        <li>
208
                            <label for="keep_for_pseudonymization">Keep for pseudonymization: </label>
209
                            [% IF attribute_type AND attribute_type.keep_for_pseudonymization %]
210
                                <input type="checkbox" id="keep_for_pseudonymization" name="keep_for_pseudonymization" checked="checked" />
211
                            [% ELSE %]
212
                                <input type="checkbox" id="keep_for_pseudonymization" name="keep_for_pseudonymization" />
213
                            [% END %]
214
                            <span class="hint">Check to make this attribute copied to the patron's pseudonymized attributes.</span>
215
                        </li>
216
                    [% END %]
217
218
                    <li
219
                        ><label for="authorised_value_category">Authorized value category: </label>
220
                        <select name="authorised_value_category" id="authorised_value_category">
221
                            <option value=""></option>
222
                            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => attribute_type.authorised_value_category ) %]
223
                        </select>
224
                        <div class="hint"
225
                            >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
226
                        >
227
                    </li>
228
                    <li
229
                        ><label for="branches">Library limitation: </label>
230
                        <select id="branches" name="branches" multiple size="10">
231
                            <option value="">All libraries</option>
232
                            [% PROCESS options_for_libraries libraries => Branches.all( selected => attribute_type.library_limits ) %]
233
                        </select>
234
                        <div class="hint">Select "All libraries" if this attribute type should always be displayed. Otherwise select libraries you want to associate with this value. </div>
235
                    </li>
236
                    <li>
237
                        <label for="category">Category: </label>
238
                        <select name="category_code" id="category">
239
                            <option value=""></option>
240
                            [% FOREACH cat IN categories %]
241
                                [% IF ( cat.categorycode == attribute_type.category_code ) %]
242
                                    <option value="[% cat.categorycode | html %]" selected="selected">[% cat.description |html %]</option>
243
                                [% ELSE %]
244
                                    <option value="[% cat.categorycode | html %]">[% cat.description |html %]</option>
245
                                [% END %]
246
                            [% END %]
247
                        </select>
248
                        <div class="hint">Choose one to limit this attribute to one patron type. Please leave blank if you want these attributes to be available for all types of patrons.</div>
249
                    </li>
250
                    <li>
251
                        <label for="class">Class: </label>
252
                        [% PROCESS 'av-build-dropbox.inc' name="class", category="PA_CLASS" default=attribute_type.class empty=1 %]
253
                        <div class="hint">
254
                            [% IF ( CAN_user_parameters_manage_auth_values ) %]
255
                                Group attributes types with a block title (based on <a target="_blank" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=PA_CLASS">authorized values category 'PA_CLASS'</a>)
256
                            [% ELSE %]
257
                                Group attributes types with a block title (based on authorized values category 'PA_CLASS')
258
                            [% END %]
259
                        </div>
260
                    </li>
261
                </ol>
262
            </fieldset>
263
            <fieldset class="action">
264
                <input type="submit" class="btn btn-primary" value="Save" />
265
                <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
266
            </fieldset>
267
        </form>
268
    [% END %]
269
270
    [% IF ( delete_attribute_type_form ) %]
271
        <div class="alert alert-warning">
272
            <h1> [% tx("Confirm deletion of patron attribute type '{code}' ({description})?", { code = code, description = description }) | html %] </h1>
273
            <form action="/cgi-bin/koha/admin/patron-attr-types.pl" name="Aform" method="post">
274
                [% INCLUDE 'csrf-token.inc' %]
275
                <input type="hidden" name="op" value="[% confirm_op | html %]" />
276
                <input type="hidden" name="code" value="[% code | html %]" />
277
                <button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete patron attribute type</button>
278
            </form>
279
            <form action="/cgi-bin/koha/admin/patron-attr-types.pl" method="get">
280
                <button type="submit" class="btn btn-default deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
281
            </form>
282
        </div>
283
    [% END %]
284
285
    [% IF ( display_list ) %]
286
        <div id="toolbar" class="btn-toolbar">
287
            <a class="btn btn-default" id="newrule" href="/cgi-bin/koha/admin/patron-attr-types.pl?op=add_attribute_type"><i class="fa fa-plus"></i> New patron attribute type</a>
288
        </div>
289
290
        <h1>Patron attribute types</h1>
291
        [% IF ( added_attribute_type ) %]
292
            <div class="alert alert-info">Added patron attribute type &quot;[% added_attribute_type | html %]&quot;</div>
293
        [% END %]
294
        [% IF ( edited_attribute_type ) %]
295
            <div class="alert alert-info">Modified patron attribute type &quot;[% edited_attribute_type | html %]&quot;</div>
296
        [% END %]
297
        [% IF ( deleted_attribute_type ) %]
298
            <div class="alert alert-info">Deleted patron attribute type &quot;[% deleted_attribute_type | html %]&quot;</div>
299
        [% END %]
300
        [% IF ( ERROR_delete_in_use ) %]
301
            <div class="alert alert-info">Could not delete patron attribute type &quot;[% ERROR_delete_in_use | html %]&quot; &mdash; it is in use by [% ERROR_num_patrons | html %] patron records</div>
302
        [% END %]
303
        [% IF ( ERROR_delete_not_found ) %]
304
            <div class="alert alert-info">Could not delete patron attribute type &quot;[% ERROR_delete_not_found | html %]&quot; &mdash; it was already absent from the database.</div>
305
        [% END %]
306
        [% IF ( available_attribute_types ) %]
307
            [% FOREACH attribute IN available_attribute_types %]
308
                <div class="page-section">
309
                    [% IF attribute.class %]
310
                        <h2>[% attribute.lib | html %]</h2>
311
                    [% ELSE %]
312
                        <h2>Unclassified types</h2>
313
                    [% END %]
314
                    <table class="patron_attributes_types" id="patron_attr[% attribute.class | html %]">
315
                        <thead>
316
                            <tr>
317
                                <th>Code</th>
318
                                <th>Description</th>
319
                                <th>Library limitation</th>
320
                                <th>Authorized value category</th>
321
                                <th>Mandatory</th>
322
                                <th>Searching</th>
323
                                <th class="NoSort noExport">Actions</th>
324
                            </tr>
325
                        </thead>
326
                        <tbody>
327
                            [% FOREACH item IN attribute.items %]
328
                                <tr>
329
                                    <td>[% item.code | html %]</td>
330
                                    <td>[% item.description | html %]</td>
331
                                    <td>
332
                                        [% SET libraries = item.library_limits %]
333
                                        [% IF ( libraries && libraries.count > 0 ) %]
334
                                            [% branches_str = "" %]
335
                                            [% FOREACH branch IN libraries %]
336
                                                [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
337
                                            [% END %]
338
                                            <span title="[% branches_str | html %]">
339
                                                [% IF libraries.count > 1 %]
340
                                                    <span>[% libraries.count | html %] library limitations</span>
341
                                                [% ELSE %]
342
                                                    <span>[% libraries.count | html %] library limitation</span>
343
                                                [% END %]
344
                                            </span>
345
                                        [% ELSE %]
346
                                            No limitation
347
                                        [% END %]
348
                                    </td>
349
                                    <td>
350
                                        [% IF ( CAN_user_parameters_manage_auth_values ) %]
351
                                            <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% item.authorised_value_category | uri %]">[% item.authorised_value_category | html %]</a>
352
                                        [% ELSE %]
353
                                            [% item.authorised_value_category | html %]
354
                                        [% END %]
355
                                    </td>
356
                                    <td>
357
                                        [% IF ( item.mandatory ) -%]
358
                                            <span>Yes</span>
359
                                        [% ELSE -%]
360
                                            <span>No</span>
361
                                        [% END %]
362
                                    </td>
363
                                    <td>
364
                                        [% IF ( item.staff_searchable ) %]
365
                                            [% IF( item.searched_by_default ) %]
366
                                                <span>Searched by default</span>
367
                                            [% ELSE %]
368
                                                <span>Searchable</span>
369
                                            [% END %]
370
                                        [% ELSE %]
371
                                            <span>Not searchable</span>
372
                                        [% END %]
373
                                    </td>
374
                                    <td class="actions">
375
                                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/patron-attr-types.pl?op=edit_attribute_type&amp;code=[% item.code | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
376
                                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/patron-attr-types.pl?op=delete_attribute_type&amp;code=[% item.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
377
                                    </td>
378
                                </tr>
379
                            [% END %]
380
                        </tbody>
381
                    </table> </div
382
                ><!-- ./page-section -->
383
            [% END %]
384
        [% ELSE %]
385
            <p>There are no saved patron attribute types.</p>
386
        [% END %]
387
388
        <div class="pages">[% pagination_bar | $raw %]</div>
389
    [% END %]
390
[% END %]
391
[% MACRO jsinclude BLOCK %]
392
    [% Asset.js("js/admin-menu.js") | $raw %]
393
    [% INCLUDE 'datatables.inc' %]
394
    [% INCLUDE 'columns_settings.inc' %]
395
    <script>
396
        $(document).ready(function () {
397
            function toggle_search_default() {
398
                if ($("#staff_searchable").is(":checked")) {
399
                    $("#searched_by_default").prop("disabled", false);
400
                } else {
401
                    $("#searched_by_default").prop("disabled", true).prop("checked", false);
402
                }
403
            }
404
            $("#staff_searchable").on("change", function () {
405
                toggle_search_default();
406
            });
407
408
            toggle_search_default();
409
410
            if ($("#branches option:selected").length < 1) {
411
                $("#branches option:first").attr("selected", "selected");
412
            }
413
414
            $("#opac_display")
415
                .change(function () {
416
                    if (this.checked) {
417
                        $("#opac_editable").removeAttr("disabled").parent().removeAttr("aria-disabled");
418
                    } else {
419
                        $("#opac_editable").attr("disabled", true).parent().attr("aria-disabled", "true");
420
                    }
421
                })
422
                .change();
423
424
            $("#is_date")
425
                .change(function () {
426
                    if (this.checked) {
427
                        $("#authorised_value_category").attr("disabled", true).parent().attr("aria-disabled", "true");
428
                    } else {
429
                        $("#authorised_value_category").removeAttr("disabled").parent().removeAttr("aria-disabled");
430
                    }
431
                })
432
                .change();
433
434
            $("#authorised_value_category")
435
                .change(function () {
436
                    if ($(this).val() != "") {
437
                        $("#is_date").attr("disabled", true).parent().attr("aria-disabled", "true");
438
                    } else {
439
                        $("#is_date").removeAttr("disabled").parent().removeAttr("aria-disabled");
440
                    }
441
                })
442
                .change();
443
444
            $(".patron_attributes_types").each(function () {
445
                var tableid = $(this).attr("id");
446
                KohaTable(
447
                    tableid,
448
                    {
449
                        paginate: false,
450
                        autoWidth: false,
451
                    },
452
                    null
453
                );
454
            });
455
        });
456
    </script>
457
[% END %]
458
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-1996 lines)
Lines 1-1996 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE To %]
4
[% USE Koha %]
5
[% USE KohaDates %]
6
[% USE Branches %]
7
[% PROCESS 'member-main-address-style.inc' %]
8
[% PROCESS 'member-alt-address-style.inc' %]
9
[% PROCESS 'member-alt-contact-style.inc' %]
10
[% PROCESS 'restriction-types.inc' %]
11
[% PROCESS 'i18n.inc' %]
12
[% SET footerjs = 1 %]
13
[% PROCESS 'patron-search.inc' %]
14
[% INCLUDE 'doc-head-open.inc' %]
15
<title
16
    >[% FILTER collapse %]
17
        [% UNLESS blocking_error %]
18
            [% IF ( op == 'add_form' ) %]
19
                [% t("Add patron") | html %]
20
            [% ELSE %]
21
                [% t("Modify patron") | html %]
22
            [% END %]
23
            [% INCLUDE 'patron-title.inc' no_html = 1 %]
24
            [% IF patron_category %]([% patron_category.description | html %])[% END %]
25
        [% END %]
26
        &rsaquo; [% t("Patrons") | html %] &rsaquo; [% t("Koha") | html %]
27
    [% END %]</title
28
>
29
[% INCLUDE 'doc-head-close.inc' %]
30
[% FILTER collapse %]
31
    <style>
32
        fieldset legend {
33
            border: 1px solid #fff;
34
            margin-left: -0.5em;
35
            margin-top: -0.5em;
36
            padding: 0.7em;
37
        }
38
        fieldset legend:hover {
39
            border: 1px solid #6faf44;
40
            cursor: pointer;
41
        }
42
43
        fieldset legend i {
44
            color: #4c7aa8;
45
            font-size: 80%;
46
            padding-right: 0.2rem;
47
        }
48
49
        fieldset legend.collapsed {
50
            margin-bottom: -0.5em;
51
        }
52
53
        legend.collapsed i.fa.fa-caret-down::before {
54
            content: "\f0da";
55
        }
56
    </style>
57
[% END %]
58
</head>
59
60
<body id="pat_memberentrygen" class="pat">
61
[% WRAPPER 'header.inc' %]
62
    [% INCLUDE 'patron-search-header.inc' %]
63
[% END %]
64
65
[% WRAPPER 'sub-header.inc' %]
66
    [% WRAPPER breadcrumbs %]
67
        [% WRAPPER breadcrumb_item %]
68
            <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
69
        [% END %]
70
        [% UNLESS blocking_error %]
71
            [% UNLESS op == 'add_form' %]
72
                [% IF (borrower_data.firstname || borrower_data.surname ) %]
73
                    [% WRAPPER breadcrumb_item %]
74
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]"> [% INCLUDE 'patron-title.inc' %] </a>
75
                    [% END %]
76
                [% END %]
77
            [% END %]
78
        [% END %]
79
        [% WRAPPER breadcrumb_item bc_active= 1 %]
80
            [% IF ( op == 'add_form' ) %]
81
                <span>Add patron</span>
82
            [% ELSE %]
83
                <span>Modify patron</span>
84
            [% END %]
85
            [% IF patron_category %]
86
                ([% patron_category.description | html %])
87
            [% END %]
88
        [% END %]
89
    [% END #/ WRAPPER breadcrumbs %]
90
[% END #/ WRAPPER sub-header.inc %]
91
92
<div class="main container-fluid">
93
    <div class="row">
94
        [% IF borrower_data.messages %]
95
            [% FOR message IN borrower_data.messages %]
96
                [% SWITCH message.error %]
97
                [% CASE 'error_on_insert_patron' %]
98
                    <div class="alert alert-warning">Something went wrong when creating the patron. Check the logs for details.</div>
99
                [% CASE 'error_on_update_patron' %]
100
                    <div class="alert alert-warning">Something went wrong when updating the patron. Check the logs for details.</div>
101
                [% CASE %]
102
                    <div class="alert alert-warning">Unhandled error: [% message.error | html %]</div>
103
                [% END %]
104
            [% END %]
105
        [% END %]
106
        [% IF ( op == 'add_form' ) %]
107
            [% SET div_class = 'col-md-10 offset-md-1 col-lg-8 offset-lg-2' %]
108
        [% ELSE %]
109
            [% SET div_class = 'col-md-10 order-md-2 order-sm-1' %]
110
        [% END %]
111
        <div class="[% div_class | html %]">
112
            <main class="clearfix">
113
                [% INCLUDE 'messages.inc' %]
114
115
                [% IF error_alert %]
116
                    [% IF ( error_alert == "no_email" ) %]
117
                        <div class="alert alert-warning">This member has no email</div>
118
                    [% ELSE %]
119
                        <div class="alert alert-warning">[% error_alert | html %]</div>
120
                    [% END %]
121
                [% END %]
122
                [% IF info_alert %]
123
                    <div class="alert alert-info">Email has been sent.</div>
124
                [% END %]
125
126
                [% INCLUDE 'noadd-warnings.inc' %]
127
128
                [% UNLESS ( no_add ) %]
129
                    <h1>
130
                        [% IF ( op == 'add_form' ) %]
131
                            <span>Add patron</span>
132
                        [% ELSIF ( op == 'duplicate' ) %]
133
                            <span>Duplicate patron</span>
134
                        [% ELSE %]
135
                            <span>Modify patron</span>
136
                        [% END %]
137
                        [% INCLUDE 'patron-title.inc' %]
138
                        [% IF patron_category %]([% patron_category.description | html %])[% END %]
139
                    </h1>
140
141
                    [% IF quickadd && op == 'add_form' && !check_member %]
142
                        <a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a>
143
                        <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a>
144
                    [% END %]
145
146
                    [% IF ( check_member ) %]
147
                        <div class="alert alert-warning">
148
                            <h3>Duplicate patron record?</h3>
149
                            <p>[%- INCLUDE 'patron-title.inc' patron => check_patron hide_patron_infos_if_needed => 1 -%]</p>
150
                            [% IF logged_in_user.can_see_patron_infos( check_patron ) %]
151
                                <p
152
                                    ><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&amp;borrowernumber=[% check_member | uri %]"><i class="fa-solid fa-window-restore"></i> View existing record</a></p
153
                                >
154
                            [% END %]
155
                            <a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&borrowernumber=[% check_member | uri %]" class="btn btn-default" id="duplicate">
156
                                <i class="fa-solid fa-pencil" aria-hidden="true"></i> It is a duplicate. Edit existing record
157
                            </a>
158
                            <button type="submit" id="not-duplicate" class="new"> <i class="fa fa-plus"></i> Not a duplicate. Save as new record </button>
159
                        </div>
160
                    [% END %]
161
162
                    [% IF ( nok ) %]
163
                        <div class="alert alert-warning">
164
                            <p>The following fields are wrong. Please fix them.</p>
165
                            <ul>
166
                                [% IF ( ERROR_login_exist ) %]
167
                                    <li id="ERROR_login_exist">Username already exists or could not create unique new one.</li>
168
                                [% END %]
169
                                [% IF ERROR_cardnumber_already_exists %]
170
                                    <li id="ERROR_cardnumber">Card number already in use.</li>
171
                                [% END %]
172
                                [% IF ERROR_cardnumber_length %]
173
                                    <li id="ERROR_cardnumber">Card number length is incorrect.</li>
174
                                [% END %]
175
                                [% IF ( ERROR_age_limitations ) %]
176
                                    <li id="ERROR_age_limitations">Patron's age is incorrect for their category. Ages allowed are [% age_low | html %]-[% age_high | html %].</li>
177
                                [% END %]
178
                                [% IF ( ERROR_branch ) %]
179
                                    <li id="ERROR_branch">Library is invalid.</li>
180
                                [% END %]
181
                                [% IF ( ERROR_dateofbirth ) %]
182
                                    <li id="ERROR_dateofbirth">Date of birth is invalid.</li>
183
                                [% END %]
184
                                [% IF ( ERROR_dateenrolled ) %]
185
                                    <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li>
186
                                [% END %]
187
                                [% IF ( ERROR_dateexpiry ) %]
188
                                    <li id="ERROR_dateexpiry">Date of expiration is invalid.</li>
189
                                [% END %]
190
                                [% IF ( ERROR_password_too_short ) %]
191
                                    <li id="ERROR_short_password">Password must be at least [% minPasswordLength | html %] characters long.</li>
192
                                [% END %]
193
                                [% IF ( ERROR_password_too_weak ) %]
194
                                    <li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li>
195
                                [% END %]
196
                                [% IF ( ERROR_password_has_whitespaces ) %]
197
                                    <li id="ERROR_weak_password">Password must not contain leading or trailing whitespaces.</li>
198
                                [% END %]
199
                                [% IF ( ERROR_password_mismatch ) %]
200
                                    <li id="ERROR_password_mismatch">Passwords do not match.</li>
201
                                [% END %]
202
                                [% IF ( ERROR_password_expiration_date ) %]
203
                                    <li id="ERROR_dateexpiry">Password expiration date is invalid.</li>
204
                                [% END %]
205
                                [% IF ( ERROR_extended_unique_id_failed ) %]
206
                                    <li id="ERROR_extended_unique_id_failed"
207
                                        ><strong>[% ERROR_extended_unique_id_failed_description | html %]:</strong> Attribute value "[% ERROR_extended_unique_id_failed_value | html %]" is already in use by another patron record.</li
208
                                    >
209
                                [% END %]
210
                                [% IF ERROR_bad_email %]
211
                                    <li id="ERROR_bad_email">The primary email is invalid.</li>
212
                                [% END %]
213
                                [% IF ERROR_bad_email_secondary %]
214
                                    <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li>
215
                                [% END %]
216
                                [% IF ERROR_bad_email_alternative %]
217
                                    <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li>
218
                                [% END %]
219
                                [% IF ( ERROR_child_no_guarantor ) %]
220
                                    <li id="ERROR_child_no_guarantor">A child patron needs a guarantor.</li>
221
                                [% END %]
222
                                [% IF ( ERROR_child_is_guarantor ) %]
223
                                    <li id="ERROR_child_is_guarantor">Child patron cannot be a guarantor.</li>
224
                                [% END %]
225
                                [% IF ( ERROR_guarantor_is_guarantee ) %]
226
                                    <li id="ERROR_guarantor_is_guarantee">A guarantor cannot be a guarantee.</li>
227
                                [% END %]
228
                                [% IF ( ERROR_cannot_delete_guarantor ) %]
229
                                    <li id="ERROR_cannot_delete_guarantor">Cannot delete guarantor(s). A child patron needs a guarantor.</li>
230
                                [% END %]
231
                                [% IF ( ERROR_invalid_relationship ) %]
232
                                    <li id="ERROR_invalid_relationship">Guarantor relationship cannot be left blank according to configuration.</li>
233
                                [% END %]
234
                            </ul>
235
                        </div>
236
                    [% END %]
237
238
                    [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm') %]
239
                    [% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %]
240
                        <p id="selections">
241
                            <label><input type="checkbox" id="toggle_hidden_fields" title="These fields are collapsed by default by the CollapseFieldsPatronAddForm system preference" /><strong>Show collapsed fields:</strong></label>
242
                            [% FOREACH field IN fieldstohide.split(',') %]
243
                                [% SWITCH field %]
244
                                [% CASE 'identity' %]
245
                                    <span>Patron identity</span> |
246
                                [% CASE 'guarantor' %]
247
                                    <span>Guarantor information</span> |
248
                                [% CASE 'nonpatron_guarantor' %]
249
                                    <span>Non-patron guarantor</span> |
250
                                [% CASE 'primary_address' %]
251
                                    <span>Main address</span> |
252
                                [% CASE 'primary_contact' %]
253
                                    <span>Contact information</span> |
254
                                [% CASE 'alt_address' %]
255
                                    <span>Alternate address</span> |
256
                                [% CASE 'alt_contact' %]
257
                                    <span>Alternate contact</span> |
258
                                [% CASE 'lib_mgmt' %]
259
                                    <span>Library management</span> |
260
                                [% CASE 'lib_setup' %]
261
                                    <span>Library setup</span> |
262
                                [% CASE 'login' %]
263
                                    <span>OPAC/Staff interface login</span> |
264
                                [% CASE 'flags' %]
265
                                    <span>Patron account flags</span> |
266
                                [% CASE 'debarments' %]
267
                                    <span>Patron restrictions</span> |
268
                                [% CASE 'housebound' %]
269
                                    [% IF Koha.Preference('HouseboundModule') %]<span>Housebound roles</span> |[% END %]
270
                                [% CASE 'additional' %]
271
                                    <span>Additional attributes and identifiers</span> |
272
                                [% CASE 'messaging' %]
273
                                    <span>Patron messaging preferences</span> |
274
                                [% END %]
275
                            [% END %]
276
                        </p>
277
                    [% END %][% END %]
278
279
                    [% UNLESS ( check_member ) %]
280
                        <div id="toolbar" class="btn-toolbar sticky">
281
                            [% IF quickadd && op == 'add_form' %]
282
                                <button class="btn btn-primary toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button>
283
                            [% END %]
284
                            <button class="btn btn-primary toggler" id="saverecord" name="save"><i class="fa fa-save"></i> Save</button>
285
                            [% IF op == 'add_form' %]
286
                                <a class="btn btn-link toggler save_entryform" href="/cgi-bin/koha/members/member.pl"> <i class="fa fa-times"></i> Cancel </a>
287
                            [% ELSE %]
288
                                <a class="btn btn-link" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]"> <i class="fa fa-times"></i> Cancel </a>
289
                            [% END %]
290
                        </div>
291
                    [% END %]
292
293
                    <form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler">
294
                        [% UNLESS ( check_member ) %]
295
                            <input type="hidden" name="nodouble" value="[% nodouble | html %]" />
296
                        [% END %]
297
                        <!--    field always hidden in different form (1,2,3) -->
298
                        <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" />
299
                        <input type="hidden" name="updtype" value="[% updtype | html %]" />
300
                        <input type="hidden" name="destination" value="[% destination | html %]" />
301
                        <input type="hidden" name="check_member" value="[% check_member | html %]" />
302
                        <input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS op == 'duplicate' %]" />
303
                        <input type="hidden" name="nodouble" value="[% nodouble | html UNLESS op == 'duplicate' %]" />
304
                        [% INCLUDE 'csrf-token.inc' %]
305
                        [% IF ( step ) %]
306
                            <input type="hidden" name="step" value="[% step | html %]" />
307
                        [% END %]
308
                        [% IF ( op == 'add_form' ) %]
309
                            <input type="hidden" name="op" value="cud-insert" />
310
                        [% ELSIF ( op == 'duplicate' ) %]
311
                            <input type="hidden" name="op" value="cud-insert" />
312
                        [% ELSE %]
313
                            <input type="hidden" name="op" value="cud-save" />
314
                            [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 || step == 7 %]
315
                                [%# Only put the card number if we arent showing it in the form later %]
316
                                [% IF borrower_data.cardnumber %]
317
                                    <input type="hidden" name="cardnumber" value="[% borrower_data.cardnumber | html %]" />
318
                                [% END %]
319
                            [% END %]
320
                        [% END %]
321
322
                        [% IF ( step_1 ) %]
323
                            [% UNLESS notitle && nosurname && nofirstname && nopreferred_name && nomiddle_name && nodateofbirth && noinitials && noothernames &&nosex && nopronouns %]
324
                                <fieldset class="rows" id="memberentry_identity">
325
                                    <legend class="expanded" id="identity_lgd">
326
                                        <i class="fa fa-caret-down" title="Collapse this section"></i>
327
                                        [% IF ( patron_category.category_type == 'I' ) %]
328
                                            <span>Organization identity</span>
329
                                        [% ELSE %]
330
                                            <span>Patron identity</span>
331
                                        [% END %]
332
                                    </legend>
333
                                    <ol>
334
                                        [% UNLESS ( patron_category.category_type == 'I' ) %]
335
                                            [% UNLESS notitle %]
336
                                                [% IF Koha.Preference('BorrowersTitles') %]
337
                                                    <li>
338
                                                        <label for="btitle" [% IF mandatorytitle %]class="required"[% END %]> Salutation: </label>
339
                                                        <select id="btitle" name="title">
340
                                                            <option value=""></option>
341
                                                            [% FOREACH patron_title IN Koha.Preference('BorrowersTitles').split('\|') %]
342
                                                                [% IF btitle == patron_title %]
343
                                                                    <option value="[% patron_title | html %]" selected="selected">[% patron_title | html %]</option>
344
                                                                [% ELSE %]
345
                                                                    <option value="[% patron_title | html %]">[% patron_title | html %]</option>
346
                                                                [% END %]
347
                                                            [% END %]
348
                                                        </select>
349
                                                        [% IF ( mandatorytitle ) %]
350
                                                            <span class="required">Required</span>
351
                                                        [% END %]
352
                                                    </li>
353
                                                [% END # /IF Koha.Preference('BorrowersTitles') %]
354
                                            [% END # /UNLESS notitle %]
355
                                        [% END # /UNLESS ( I ) %]
356
357
                                        [% UNLESS nosurname %]
358
                                            <li>
359
                                                [% IF ( patron_category.category_type == 'I' ) %]
360
                                                    <label for="surname" class="required"> Name: </label>
361
                                                [% ELSE %]
362
                                                    <label for="surname" [% IF mandatorysurname %]class="required"[% END %]> Surname: </label>
363
                                                [% END %]
364
365
                                                [% IF ( uppercasesurnames ) %]
366
                                                    <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% patron.surname | html %]" />
367
                                                [% ELSE %]
368
                                                    <input type="text" id="surname" name="surname" size="20" value="[% patron.surname | html %]" />
369
                                                [% END %]
370
                                                [% IF ( mandatorysurname ) %]
371
                                                    <span class="required">Required</span>
372
                                                [% END %]
373
                                            </li>
374
                                        [% END # /UNLESS nosurname %]
375
376
                                        [% UNLESS ( patron_category.category_type == 'I' ) %]
377
                                            [% UNLESS nofirstname %]
378
                                                <li>
379
                                                    <label for="firstname" [% IF mandatoryfirstname %]class="required"[% END %]> First name: </label>
380
                                                    <input type="text" id="firstname" name="firstname" size="20" value="[% borrower_data.firstname | html UNLESS op == 'duplicate' %]" />
381
                                                    [% IF ( mandatoryfirstname ) %]
382
                                                        <span class="required">Required</span>
383
                                                    [% END %]
384
                                                </li>
385
                                            [% END #/UNLESS nofirstname %]
386
                                            [% UNLESS nopreferred_name %]
387
                                                <li>
388
                                                    <label for="preferred_name" [% IF mandatorypreferred_name %]class="required"[% END %]> Preferred name: </label>
389
                                                    <input type="text" id="preferred_name" name="preferred_name" size="20" value="[% borrower_data.preferred_name | html UNLESS op == 'duplicate' %]" />
390
                                                    [% IF ( mandatorypreferred_name ) %]
391
                                                        <span class="required">Required</span>
392
                                                    [% END %]
393
                                                </li>
394
                                            [% END #/UNLESS nopreferred_name %]
395
                                            [% UNLESS nomiddle_name %]
396
                                                <li>
397
                                                    <label for="middle_name" [% IF mandatorymiddle_name %]class="required"[% END %]> Middle name: </label>
398
                                                    <input type="text" id="middle_name" name="middle_name" size="20" value="[% borrower_data.middle_name | html UNLESS op == 'duplicate' %]" />
399
                                                    [% IF ( mandatorymiddle_name ) %]
400
                                                        <span class="required">Required</span>
401
                                                    [% END %]
402
                                                </li>
403
                                            [% END #/UNLESS nomiddle_name %]
404
                                            [% UNLESS nodateofbirth %]
405
                                                <li>
406
                                                    <label for="dateofbirth" [% IF mandatorydateofbirth %]class="required"[% END %]> Date of birth: </label>
407
                                                    <input
408
                                                        type="text"
409
                                                        id="dateofbirth"
410
                                                        name="dateofbirth"
411
                                                        size="20"
412
                                                        value="[% borrower_data.dateofbirth | html UNLESS op == 'duplicate' %]"
413
                                                        class="flatpickr"
414
                                                        data-flatpickr-pastinclusive="true"
415
                                                    />
416
                                                    [% IF ( mandatorydateofbirth ) %]
417
                                                        <span class="required">Required</span>
418
                                                    [% END %]
419
                                                    [% IF ( ERROR_dateofbirth ) %]
420
                                                        <span class="required">(Error)</span>
421
                                                    [% END %]
422
                                                    <div id="dateofbirth_hint" class="hint">[% INCLUDE 'date-format.inc' %]</div>
423
                                                </li>
424
                                            [% END # /UNLESS nodateofbirth %]
425
                                            [% UNLESS noinitials %]
426
                                                <li>
427
                                                    <label for="initials" [% IF mandatoryinitials %]class="required"[% END %]> Initials: </label>
428
                                                    <input type="text" id="initials" name="initials" size="20" value="[% borrower_data.initials | html UNLESS op == 'duplicate' %]" />
429
                                                    [% IF ( mandatoryinitials ) %]
430
                                                        <span class="required">Required</span>
431
                                                    [% END %]
432
                                                </li>
433
                                            [% END # /UNLESS noinitials %]
434
                                            [% UNLESS nopronouns %]
435
                                                <li>
436
                                                    <label for="pronouns" [% IF mandatorypronouns %]class="required"[% END %]> Pronouns: </label>
437
                                                    <input type="text" id="pronouns" name="pronouns" size="20" value="[% borrower_data.pronouns | html UNLESS op == 'duplicate' %]" />
438
                                                    [% IF ( mandatorypronouns ) %]
439
                                                        <span class="required">Required</span>
440
                                                    [% END %]
441
                                                </li>
442
                                            [% END # /UNLESS nopronouns %]
443
                                        [% END #/UNLESS ( I ) %]
444
                                        [% UNLESS noothernames %]
445
                                            <li>
446
                                                <label for="othernames" [% IF mandatoryothernames %]class="required"[% END %]> Other name: </label>
447
                                                <input type="text" id="othernames" name="othernames" size="20" value="[% borrower_data.othernames | html UNLESS op == 'duplicate' %]" />
448
                                                [% IF ( mandatoryothernames ) %]
449
                                                    <span class="required">Required</span>
450
                                                [% END %]
451
                                                [% IF ( patron_category.category_type == 'I' ) %]<input type="hidden" name="sex" value="N" />[% END %]
452
                                            </li>
453
                                        [% END #/UNLESS noothernames %]
454
455
                                        [% UNLESS ( patron_category.category_type == 'I' ) %]
456
                                            [% UNLESS nosex %]
457
                                                <li class="radio">
458
                                                    [% UNLESS ( op == 'duplicate' ) %]
459
                                                        [% IF ( female ) %]
460
                                                            <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /><span class="patronsex-female"> Female</span></label>
461
                                                        [% ELSE %]
462
                                                            <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /><span class="patronsex-female"> Female</span></label>
463
                                                        [% END %]
464
                                                        [% IF ( male ) %]
465
                                                            <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /><span class="patronsex-male"> Male</span></label>
466
                                                        [% ELSE %]
467
                                                            <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /><span class="patronsex-male"> Male</span></label>
468
                                                        [% END %]
469
                                                        [% IF ( other ) %]
470
                                                            <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" checked="checked" /><span class="patronsex-other"> [% tp('gender', 'Other') | html %]</span></label>
471
                                                        [% ELSE %]
472
                                                            <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" /><span class="patronsex-other"> [% tp('gender', 'Other') | html %]</span></label>
473
                                                        [% END %]
474
                                                        [% IF ( none ) %]
475
                                                            <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" checked="checked" /><span class="patronsex-none"> None specified</span></label>
476
                                                        [% ELSE %]
477
                                                            <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /><span class="patronsex-none"> None specified</span></label>
478
                                                        [% END %]
479
                                                    [% ELSE %]
480
                                                        <label for="sex-female"><span class="patronsex-female">Female </span></label><input type="radio" name="sex" id="sex-female" value="F" />
481
                                                        <label for="sex-male"><span class="patronsex-male">Male </span></label><input type="radio" name="sex" id="sex-male" value="M" />
482
                                                        <label for="sex-other"><span class="patronsex-other">[% tp('gender', 'Other') | html %] </span></label><input type="radio" name="sex" id="sex-other" value="O" />
483
                                                        <label for="sex-none"><span class="patronsex-none">None specified </span></label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
484
                                                    [% END # /UNLESS ( op == 'duplicate' ) %]
485
                                                </li>
486
                                            [% END # /UNLESS nosex %]
487
                                        [% END # /UNLESS ( I ) %]
488
                                    </ol>
489
                                </fieldset>
490
                                <!-- /#memberentry_identity -->
491
                            [% END # hide fieldset %]
492
493
                            [% IF show_guarantor || guarantor %]
494
                                [% SET possible_relationships = Koha.Preference('borrowerRelationship') %]
495
                                <div id="memberentry_guarantor_anchor">
496
                                    <fieldset id="memberentry_guarantor" class="rows">
497
                                        <legend class="expanded" id="patron_guarantor_lgd">
498
                                            <i class="fa fa-caret-down" aria-hidden="true"></i>
499
                                            Patron guarantor
500
                                        </legend>
501
502
                                        <div id="guarantor_relationships">
503
                                            [% FOREACH r IN relationships %]
504
                                                <fieldset>
505
                                                    <ol>
506
                                                        [% IF patron_category.category_type == 'I' %]
507
                                                            <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
508
                                                                <span class="label">Organization:</span>
509
                                                                [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
510
                                                            </li>
511
                                                            <li>
512
                                                                <span class="label">Relationship:</span>
513
                                                                <span>[% r.relationship | html %]</span>
514
                                                            </li>
515
                                                        [% ELSE %]
516
                                                            <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]">
517
                                                                <span class="label">Guarantor:</span>
518
                                                                [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %]
519
                                                                <input type="hidden" class="new_guarantor_id relation-[% r.id | html %]" name="new_guarantor_id" value="[% r.guarantor_id | html %]" />
520
                                                            </li>
521
                                                            <li>
522
                                                                <span class="label">Relationship:</span>
523
                                                                <span>[% r.relationship | html %]</span>
524
                                                                <input type="hidden" class="new_guarantor_relationship relation-[% r.id | html %]" name="new_guarantor_relationship" value="[% r.relationship | html %]" />
525
                                                            </li>
526
527
                                                            <li>
528
                                                                <label for="delete_guarantor-[% r.id | uri %]">Remove: </label>
529
                                                                <input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" onclick="toggle_guarantor_field([% r.id | html %])" />
530
                                                            </li>
531
                                                        [% END %]
532
                                                    </ol>
533
                                                </fieldset>
534
                                            [% END # END relationships foreach %]
535
                                            [% IF guarantor && (!relationships) %]
536
                                                <fieldset class="guarantor">
537
                                                    <ol>
538
                                                        <li class="guarantor-details" data-borrowernumber="0">
539
                                                            <span class="label">Guarantor:</span>
540
                                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank"
541
                                                                >[% guarantor.firstname | html %] [% guarantor.surname | html %] ([% guarantor.cardnumber | html %])</a
542
                                                            >
543
                                                            <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]" />
544
                                                        </li>
545
546
                                                        [% UNLESS norelationship %]
547
                                                            <li>
548
                                                                <label for="guarantor_relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label>
549
                                                                <select class="new_guarantor_relationship" name="new_guarantor_relationship" [% IF mandatoryrelationship %]required="required"[% END %]>
550
                                                                    <option value=""></option>
551
                                                                    [% FOREACH pr IN possible_relationships.split('\|') %]
552
                                                                        [% IF pr != "" %]
553
                                                                            <option value="[% pr | html %]">[% pr | html %]</option>
554
                                                                        [% END %]
555
                                                                    [% END %]
556
                                                                </select>
557
                                                                [% IF mandatoryrelationship %]
558
                                                                    <span class="required">Required</span>
559
                                                                [% END %]
560
                                                            </li>
561
                                                        [% ELSE %]
562
                                                            <input type="hidden" name="new_guarantor_relationship" value="" />
563
                                                        [% END %]
564
565
                                                        <li>
566
                                                            <label for="guarantor_cancel">&nbsp;</label>
567
                                                            <span
568
                                                                ><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can" aria-hidden="true"></i> Remove</a></span
569
                                                            >
570
                                                        </li>
571
                                                    </ol>
572
                                                </fieldset>
573
                                            [% END %]
574
                                        </div>
575
                                        <!-- #/guarantor_relationships -->
576
577
                                        <fieldset class="guarantor" id="guarantor_template">
578
                                            <ol>
579
                                                <li class="guarantor-details" data-borrowernumber="0">
580
                                                    <span class="label">Guarantor:</span>
581
                                                    <a class="new_guarantor_link" href="#" target="blank">
582
                                                        <span class="new_guarantor_firstname_text"></span> <span class="new_guarantor_surname_text"></span> (<span class="new_guarantor_id_text"></span>)
583
                                                    </a>
584
                                                    <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="" />
585
                                                </li>
586
587
                                                [% UNLESS norelationship %]
588
                                                    <li>
589
                                                        <label for="guarantor_relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label>
590
                                                        <select class="new_guarantor_relationship" name="new_guarantor_relationship" [% IF mandatoryrelationship %]required="required"[% END %]>
591
                                                            <option value="" selected></option>
592
                                                            [% FOREACH pr IN possible_relationships.split('\|') %]
593
                                                                [% IF pr != "" %]
594
                                                                    <option value="[% pr | html %]">[% pr | html %]</option>
595
                                                                [% END %]
596
                                                            [% END %]
597
                                                        </select>
598
                                                        [% IF mandatoryrelationship %]
599
                                                            <span class="required">Required</span>
600
                                                        [% END %]
601
                                                    </li>
602
                                                [% ELSE %]
603
                                                    <input type="hidden" name="new_guarantor_relationship" value="" />
604
                                                [% END %]
605
606
                                                <li>
607
                                                    <label for="guarantor_cancel">&nbsp;</label>
608
                                                    <span
609
                                                        ><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can"></i> Remove</a></span
610
                                                    >
611
                                                </li>
612
                                            </ol>
613
                                        </fieldset>
614
615
                                        <ol>
616
                                            <input type="hidden" id="guarantor_id" value="" />
617
                                            <input name="guarantor_surname" id="guarantor_surname" type="hidden" />
618
                                            <input name="guarantor_firstname" id="guarantor_firstname" type="hidden" />
619
620
                                            <li>
621
                                                <a href="#patron_search_modal" class="btn btn-default" data-bs-toggle="modal"><i class="fa fa-plus"></i> Add guarantor</a>
622
                                            </li>
623
624
                                            [% IF Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
625
                                                <li>
626
                                                    <label for="privacy_guarantor_checkouts">Show checkouts to guarantors:</label>
627
                                                    <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
628
                                                        [% IF borrower_data.privacy_guarantor_checkouts %]
629
                                                            <option value="0">No</option>
630
                                                            <option value="1" selected>Yes</option>
631
                                                        [% ELSE %]
632
                                                            <option value="0" selected>No</option>
633
                                                            <option value="1">Yes</option>
634
                                                        [% END %]
635
                                                    </select>
636
                                                    <div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div>
637
                                                </li>
638
                                            [% END %]
639
                                            [% IF Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %]
640
                                                <li>
641
                                                    <label for="privacy_guarantor_fines">Show charges to guarantors:</label>
642
                                                    <select name="privacy_guarantor_fines" id="privacy_guarantor_fines">
643
                                                        [% IF borrower_data.privacy_guarantor_fines %]
644
                                                            <option value="0">No</option>
645
                                                            <option value="1" selected>Yes</option>
646
                                                        [% ELSE %]
647
                                                            <option value="0" selected>No</option>
648
                                                            <option value="1">Yes</option>
649
                                                        [% END %]
650
                                                    </select>
651
                                                    <div class="hint">Allow guarantors of this patron to view this patron's charges from the OPAC</div>
652
                                                </li>
653
                                            [% END %]
654
                                        </ol>
655
                                    </fieldset>
656
                                    <!-- /#memberentry_guarantor -->
657
                                </div>
658
                                <!-- #/memberentry_guarantor_anchor -->
659
660
                                [% UNLESS nocontactname && nocontactfirstname && norelationship %]
661
                                    <fieldset class="rows" id="non_patron_guarantor">
662
                                        <legend class="expanded" id="non_patron_guarantor_lgd">
663
                                            <i class="fa fa-caret-down" aria-hidden="true"></i>
664
                                            Non-patron guarantor
665
                                        </legend>
666
                                        <ol>
667
                                            [% UNLESS nocontactname %]
668
                                                <li>
669
                                                    <label for="contactname" [% IF mandatorycontactname %]class="required"[% END %]> Guarantor surname: </label>
670
                                                    <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" />
671
                                                    [% IF ( mandatorycontactname ) %]
672
                                                        <span class="required">Required</span>
673
                                                    [% END %]
674
                                                    <div class="hint">Non-patron guarantor surname</div>
675
                                                </li>
676
                                            [% END # /UNLESS nocontactname %]
677
678
                                            [% UNLESS nocontactfirstname %]
679
                                                <li>
680
                                                    <label for="contactfirstname" [% IF mandatorycontactfirstname %]class="required"[% END %]> Guarantor first name: </label>
681
                                                    <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" />
682
                                                    [% IF ( mandatorycontactfirstname ) %]
683
                                                        <span class="required">Required</span>
684
                                                    [% END %]
685
                                                    <div class="hint">Non-patron guarantor first name</div>
686
                                                </li>
687
                                            [% END # /UNLESS noaltcontactfirstname %]
688
689
                                            [% UNLESS norelationship %]
690
                                                <li>
691
                                                    <label for="relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label>
692
                                                    <select class="relationship" name="relationship" id="relationship" [% IF mandatoryrelationship %]required="required"[% END %]>
693
                                                        <option value=""></option>
694
                                                        [% FOREACH pr IN possible_relationships.split('\|') %]
695
                                                            [% IF pr == borrower_data.relationship %]
696
                                                                <option value="[% pr | html %]" selected="selected">[% pr | html %]</option>
697
                                                            [% ELSE %]
698
                                                                <option value="[% pr | html %]">[% pr | html %]</option>
699
                                                            [% END %]
700
                                                        [% END %]
701
                                                    </select>
702
                                                    [% IF mandatoryrelationship %]
703
                                                        <span class="required">Required</span>
704
                                                    [% END %]
705
                                                </li>
706
                                            [% END # /UNLESS norelationship %]
707
                                        </ol>
708
                                    </fieldset>
709
                                    <!-- /#non_patron_guarantor -->
710
                                [% END # /UNLESS nocontactname && nocontactfirstname && norelationship %]
711
                            [% END # /IF show_guarantor || guarantor %]
712
713
                            [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
714
                                [% PROCESS 'main-address-style' %]
715
                            [% END # /UNLESS nostreet && nocity etc group %]
716
717
                            [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %]
718
                                <fieldset class="rows" id="memberentry_contact">
719
                                    <legend class="expanded" id="contact_lgd">
720
                                        <i class="fa fa-caret-down" aria-hidden="true"></i>
721
                                        Contact information
722
                                    </legend>
723
                                    <ol>
724
                                        [% UNLESS nophone %]
725
                                            <li>
726
                                                <label for="phone" [% IF mandatoryphone %]class="required"[% END %]> Primary phone: </label>
727
                                                <input type="text" id="phone" name="phone" value="[% patron.phone | html %]" />
728
                                                [% IF ( mandatoryphone ) %]
729
                                                    <span class="required">Required</span>
730
                                                [% END %]
731
                                                <div class="hint">Shows on transit slips</div>
732
                                            </li>
733
                                        [% END # /UNLESS nophone %]
734
735
                                        [% UNLESS nophonepro %]
736
                                            <li>
737
                                                <label for="phonepro" [% IF mandatoryphonepro %]class="required"[% END %]> Secondary phone: </label>
738
                                                <input type="text" id="phonepro" name="phonepro" value="[% patron.phonepro | html %]" />
739
                                                [% IF ( mandatoryphonepro ) %]
740
                                                    <span class="required">Required</span>
741
                                                [% END %]
742
                                            </li>
743
                                        [% END # /UNLESS nophonepro %]
744
745
                                        [% UNLESS nomobile %]
746
                                            <li>
747
                                                <label for="mobile" [% IF mandatorymobile %]class="required"[% END %]> Other phone: </label>
748
                                                <input type="text" id="mobile" name="mobile" value="[% patron.mobile | html %]" />
749
                                                [% IF ( mandatorymobile ) %]
750
                                                    <span class="required">Required</span>
751
                                                [% END %]
752
                                            </li>
753
                                        [% END # /UNLESS nomobile %]
754
755
                                        [% UNLESS noemail %]
756
                                            <li>
757
                                                <label for="email" [% IF mandatoryemail %]class="required"[% END %]> Primary email: </label>
758
                                                [% IF ( NoUpdateEmail ) %]
759
                                                    <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" disabled="disabled" />
760
                                                [% ELSE %]
761
                                                    <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" />
762
                                                [% END %]
763
                                                [% IF ( mandatoryemail ) %]
764
                                                    <span class="required">Required</span>
765
                                                [% END %]
766
                                                <div class="hint">Shows on transit slips</div>
767
                                            </li>
768
                                        [% END #/UNLESS noemail %]
769
770
                                        [% UNLESS noemailpro %]
771
                                            <li>
772
                                                <label for="emailpro" [% IF mandatoryemailpro %]class="required"[% END %]> Secondary email: </label>
773
                                                [% IF ( NoUpdateEmail ) %]
774
                                                    <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" disabled="disabled" />
775
                                                [% ELSE %]
776
                                                    <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" />
777
                                                [% END %]
778
                                                [% IF ( mandatoryemailpro ) %]
779
                                                    <span class="required">Required</span>
780
                                                [% END %]
781
                                            </li>
782
                                        [% END #/UNLESS noemailpro %]
783
784
                                        [% UNLESS nofax %]
785
                                            <li>
786
                                                <label for="fax" [% IF mandatoryfax %]class="required"[% END %]> Fax: </label>
787
                                                <input type="text" id="fax" name="fax" value="[% patron.fax | html %]" />
788
                                                [% IF ( mandatoryfax ) %]
789
                                                    <span class="required">Required</span>
790
                                                [% END %]
791
                                            </li>
792
                                        [% END #/UNLESS nofax %]
793
794
                                        [% UNLESS noprimary_contact_method %]
795
                                            <li>
796
                                                <label for="primary_contact_method" [% IF mandatoryprimary_contact_method %]class="required"[% END %]> Main contact method: </label>
797
798
                                                <select id="primary_contact_method" name="primary_contact_method">
799
                                                    <option value=""></option>
800
                                                    [% UNLESS nophone %]
801
                                                        [% IF ( borrower_data.primary_contact_method == 'phone' ) %]
802
                                                            <option value="phone" selected="selected">Primary phone</option>
803
                                                        [% ELSE %]
804
                                                            <option value="phone">Primary phone</option>
805
                                                        [% END %]
806
                                                    [% END %]
807
                                                    [% UNLESS nophonepro %]
808
                                                        [% IF ( borrower_data.primary_contact_method == 'phonepro' ) %]
809
                                                            <option value="phonepro" selected="selected">Secondary phone</option>
810
                                                        [% ELSE %]
811
                                                            <option value="phonepro">Secondary phone</option>
812
                                                        [% END %]
813
                                                    [% END %]
814
                                                    [% UNLESS nomobile %]
815
                                                        [% IF ( borrower_data.primary_contact_method == 'mobile' ) %]
816
                                                            <option value="mobile" selected="selected">Other phone</option>
817
                                                        [% ELSE %]
818
                                                            <option value="mobile">Other phone</option>
819
                                                        [% END %]
820
                                                    [% END %]
821
                                                    [% UNLESS noemail %]
822
                                                        [% IF ( borrower_data.primary_contact_method == 'email' ) %]
823
                                                            <option value="email" selected="selected">Primary email</option>
824
                                                        [% ELSE %]
825
                                                            <option value="email">Primary email</option>
826
                                                        [% END %]
827
                                                    [% END %]
828
                                                    [% UNLESS noemailpro %]
829
                                                        [% IF ( borrower_data.primary_contact_method == 'emailpro' ) %]
830
                                                            <option value="emailpro" selected="selected">Secondary email</option>
831
                                                        [% ELSE %]
832
                                                            <option value="emailpro">Secondary email</option>
833
                                                        [% END %]
834
                                                    [% END %]
835
                                                    [% UNLESS nofax %]
836
                                                        [% IF ( borrower_data.primary_contact_method == 'fax' ) %]
837
                                                            <option value="fax" selected="selected">Fax</option>
838
                                                        [% ELSE %]
839
                                                            <option value="fax">Fax</option>
840
                                                        [% END %]
841
                                                    [% END %]
842
                                                </select>
843
                                                [% IF mandatoryprimary_contact_method %]
844
                                                    <span class="required">Required</span>
845
                                                [% END %]
846
                                            </li>
847
                                        [% END %]
848
                                    </ol>
849
                                </fieldset>
850
                                <!-- /#memberentry_contact -->
851
                            [% END # hide fieldset %]
852
853
                            <!-- ************************ STEP_1 *********************** -->
854
                        [% END # /IF ( step_1 ) %]
855
856
                        [% IF ( step_6 ) %]
857
                            [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %]
858
                                [% PROCESS 'alt-address-style' %]
859
                            [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %]
860
                        [% END # /IF ( step_6 ) %]
861
862
                        [% IF ( step_2 ) %]
863
                            [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %]
864
                                [% PROCESS 'alt-contact-style' %]
865
                            [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %]
866
                        [% END # /IF ( step_2 ) %]
867
868
                        [% IF ( step_3 ) %]
869
                            [% SET autoMemberNum = Koha.Preference('autoMemberNum') %]
870
                            <fieldset class="rows" id="memberentry_library_management">
871
                                <legend class="expanded" id="library_management_lgd">
872
                                    <i class="fa fa-caret-down" aria-hidden="true"></i>
873
                                    Library management
874
                                </legend>
875
                                <ol>
876
                                    [% UNLESS nocardnumber %]
877
                                        <li>
878
                                            <label for="cardnumber" class="[% mandatorycardnumber ? 'required' : 'validated' | html %]"> Card number: </label>
879
880
                                            [% IF minlength_cardnumber == maxlength_cardnumber %]
881
                                                <input
882
                                                    type="text"
883
                                                    id="cardnumber"
884
                                                    name="cardnumber"
885
                                                    size="20"
886
                                                    value="[% borrower_data.cardnumber | html %]"
887
                                                    minlength="[% minlength_cardnumber | html %]"
888
                                                    maxlength="[% maxlength_cardnumber | html %]"
889
                                                />
890
                                                [% IF mandatorycardnumber %]
891
                                                    <span class="required">Required</span>
892
                                                [% END %]
893
                                                <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
894
                                                <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.</div>
895
                                            [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
896
                                                <input
897
                                                    type="text"
898
                                                    id="cardnumber"
899
                                                    name="cardnumber"
900
                                                    size="20"
901
                                                    value="[% borrower_data.cardnumber | html %]"
902
                                                    minlength="[% minlength_cardnumber | html %]"
903
                                                    maxlength="[% maxlength_cardnumber | html %]"
904
                                                />
905
                                                [% IF mandatorycardnumber %]
906
                                                    <span class="required">Required</span>
907
                                                [% END %]
908
                                                <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
909
                                                <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.</div>
910
                                            [% ELSIF maxlength_cardnumber %]
911
                                                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" />
912
                                                [% IF mandatorycardnumber %]
913
                                                    <span class="required">Required</span>
914
                                                [% END %]
915
                                                <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span>
916
                                                <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.</div>
917
                                            [% ELSE %]
918
                                                <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" />
919
                                                [% IF mandatorycardnumber %]
920
                                                    <span class="required">Required</span>
921
                                                [% END %]
922
                                                <div class="hint">There is no minimum or maximum character length.</div>
923
                                            [% END %]
924
                                            [% IF autoMemberNum %]
925
                                                [% IF mandatorycardnumber %]
926
                                                    <div class="hint"><span class="error">autoMemberNum is set to enabled, but card number is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled.</span></div>
927
                                                [% ELSE %]
928
                                                    <div class="hint">Leave blank for auto calc during registration</div>
929
                                                [% END %]
930
                                            [% END %]
931
                                        </li>
932
                                    [% END # /UNLESS nocardnumber %]
933
934
                                    [% UNLESS nobranchcode %]
935
                                        <li>
936
                                            <label for="libraries" class="required">Library:</label>
937
                                            <select name="branchcode" id="libraries">
938
                                                [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
939
                                            </select>
940
                                            <span class="required">Required</span>
941
                                        </li>
942
                                    [% END %]
943
944
                                    <li>
945
                                        <label for="categorycode_entry" class="required">Category: </label>
946
                                        <select id="categorycode_entry" name="categorycode">
947
                                            [% FOREACH category_type IN patron_categories.keys.sort %]
948
                                                [% SET optgroup_label = t("Unknown") %]
949
                                                [% SWITCH category_type %]
950
                                                [% CASE 'C' %]
951
                                                    [% optgroup_label = t("Child") %]
952
                                                [% CASE 'A' %]
953
                                                    [% optgroup_label = t("Adult") %]
954
                                                [% CASE 'S' %]
955
                                                    [% optgroup_label = t("Staff") %]
956
                                                [% CASE 'I' %]
957
                                                    [% optgroup_label = t("Organization") %]
958
                                                [% CASE 'P' %]
959
                                                    [% optgroup_label = t("Professional") %]
960
                                                [% CASE 'X' %]
961
                                                    [% optgroup_label = t("Statistical") %]
962
                                                [% END %]
963
                                                <optgroup label="[% optgroup_label | html %]">
964
                                                    [% FOREACH category IN patron_categories.$category_type %]
965
                                                        [% IF category.categorycode == patron_category.categorycode %]
966
                                                            <option
967
                                                                value="[% category.categorycode | html %]"
968
                                                                selected="selected"
969
                                                                data-pwd-length="[% category.effective_min_password_length | html %]"
970
                                                                data-pwd-strong="[% category.effective_require_strong_password | html %]"
971
                                                                data-typename="[% category_type | html %]"
972
                                                                >[% category.description | html %]</option
973
                                                            >
974
                                                        [% ELSE %]
975
                                                            <option
976
                                                                value="[% category.categorycode | html %]"
977
                                                                data-pwd-length="[% category.effective_min_password_length | html %]"
978
                                                                data-pwd-strong="[% category.effective_require_strong_password | html %]"
979
                                                                data-typename="[% category_type | html %]"
980
                                                                >[% category.description | html %]</option
981
                                                            >
982
                                                        [% END %]
983
                                                    [% END %]
984
                                                </optgroup>
985
                                            [% END %]
986
                                        </select>
987
                                        [% IF limited_category %]
988
                                            <span title="The patron's current category ([% patron_category.description | html %]) is limited to other libraries"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>
989
                                        [% END %]
990
                                        <span class="required">Required</span>
991
                                    </li>
992
993
                                    [% UNLESS nosort1 %]
994
                                        <li>
995
                                            <label for="sort1" [% IF mandatorysort1 %]class="required"[% END %]> Sort 1: </label>
996
                                            [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=borrower_data.sort1, empty=1, size = 20 %]
997
                                            [% IF ( mandatorysort1 ) %]
998
                                                <span class="required">Required</span>
999
                                            [% END %]
1000
                                        </li>
1001
                                    [% END # /UNLESS nosort1 %]
1002
1003
                                    [% UNLESS nosort2 %]
1004
                                        <li>
1005
                                            <label for="sort2" [% IF mandatorysort2 %]class="required"[% END %]> Sort 2: </label>
1006
                                            [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=borrower_data.sort2, empty=1, size = 20 %]
1007
                                            [% IF ( mandatorysort2 ) %]
1008
                                                <span class="required">Required</span>
1009
                                            [% END %]
1010
                                        </li>
1011
                                    [% END # /UNLESS nosort2 %]
1012
1013
                                    [% UNLESS noautorenew_checkouts %]
1014
                                        <li class="radio">
1015
                                            <label for="yes-autorenew_checkouts"> Allow auto-renewal of items: </label>
1016
                                            [% IF ( borrower_data.autorenew_checkouts || op == 'add_form' ) %]
1017
                                                <label for="yes-autorenew_checkouts">
1018
                                                    Yes
1019
                                                    <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" checked="checked" />
1020
                                                </label>
1021
                                                <label for="no-autorenew_checkouts">
1022
                                                    No
1023
                                                    <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" />
1024
                                                </label>
1025
                                            [% ELSE %]
1026
                                                <label for="yes-autorenew_checkouts">
1027
                                                    Yes
1028
                                                    <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" />
1029
                                                </label>
1030
                                                <label for="no-autorenew_checkouts">
1031
                                                    No
1032
                                                    <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" checked="checked" />
1033
                                                </label>
1034
                                            [% END %]
1035
                                        </li>
1036
                                    [% END %]
1037
1038
                                    [% UNLESS noprotected || !CanUpdateProtectPatron %]
1039
                                        <li class="radio">
1040
                                            <label for="protected">Protected:</label>
1041
                                            [% IF ( patron.protected == 1 ) %]
1042
                                                <label for="yes-protected">
1043
                                                    Yes
1044
                                                    <input type="radio" id="yes-protected" name="protected" value="1" checked="checked" />
1045
                                                </label>
1046
                                                <label for="no-protected">
1047
                                                    No
1048
                                                    <input type="radio" id="no-protected" name="protected" value="0" />
1049
                                                </label>
1050
                                            [% ELSE %]
1051
                                                <label for="yes-protected">
1052
                                                    Yes
1053
                                                    <input type="radio" id="yes-protected" name="protected" value="1" />
1054
                                                </label>
1055
                                                <label for="no-protected">
1056
                                                    No
1057
                                                    <input type="radio" id="no-protected" name="protected" value="0" checked="checked" />
1058
                                                </label>
1059
                                            [% END %]
1060
                                        </li>
1061
                                    [% END %]
1062
1063
                                    [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
1064
                                        <li>
1065
                                            <label for="checkprevcheckout">Check for previous checkouts: </label>
1066
                                            <select name="checkprevcheckout" id="checkprevcheckout">
1067
                                                [% IF ( borrower_data.checkprevcheckout == 'yes' ) %]
1068
                                                    <option value="yes" selected="selected">Yes if settings allow it</option>
1069
                                                    <option value="no">No if settings allow it</option>
1070
                                                    <option value="inherit">Inherit from settings</option>
1071
                                                [% ELSIF ( borrower_data.checkprevcheckout == 'no' ) %]
1072
                                                    <option value="yes">Yes if settings allow it</option>
1073
                                                    <option value="no" selected="selected">No if settings allow it</option>
1074
                                                    <option value="inherit">Inherit from settings</option>
1075
                                                [% ELSE %]
1076
                                                    <option value="yes">Yes if settings allow it</option>
1077
                                                    <option value="no">No if settings allow it</option>
1078
                                                    <option value="inherit" selected="selected">Inherit from settings</option>
1079
                                                [% END %]
1080
                                            </select>
1081
                                        </li>
1082
                                    [% END # /IF ( Koha.Preference('CheckPrevCheckout') %]
1083
1084
                                    [% IF Koha.Preference('TranslateNotices') %]
1085
                                        <li>
1086
                                            <label for="lang">Preferred language for notices: </label>
1087
                                            <select id="lang" name="lang">
1088
                                                <option value="default">Default</option>
1089
                                                [% FOR language IN languages %]
1090
                                                    [% FOR sublanguage IN language.sublanguages_loop %]
1091
                                                        [% IF language.plural %]
1092
                                                            [% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
1093
                                                                <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected"
1094
                                                                    >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
1095
                                                                >
1096
                                                            [% ELSE %]
1097
                                                                <option value="[% sublanguage.rfc4646_subtag | html %]"
1098
                                                                    >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
1099
                                                                >
1100
                                                            [% END %]
1101
                                                        [% ELSE %]
1102
                                                            [% IF sublanguage.rfc4646_subtag == borrower_data.lang %]
1103
                                                                <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1104
                                                            [% ELSE %]
1105
                                                                <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
1106
                                                            [% END %]
1107
                                                        [% END # /IF language.plural %]
1108
                                                    [% END # /FOR sublanguage %]
1109
                                                [% END #/FOR language %]
1110
                                            </select>
1111
                                            <!-- /#lang -->
1112
                                        </li>
1113
                                    [% END #/IF Koha.Preference('TranslateNotices') %]
1114
                                </ol>
1115
                            </fieldset>
1116
                            <!-- /#memberentry_library_management -->
1117
1118
                            [% UNLESS nodateenrolled &&  noopacnote && noborrowernotes %]
1119
                                <fieldset class="rows" id="memberentry_subscription">
1120
                                    <legend class="expanded" id="library_setup_lgd">
1121
                                        <i class="fa fa-caret-down" aria-hidden="true"></i>
1122
                                        Library setup
1123
                                    </legend>
1124
                                    <ol>
1125
                                        [% UNLESS nodateenrolled %]
1126
                                            <li>
1127
                                                <label for="from" [% IF mandatorydateenrolled %]class="required"[% END %]> Registration date: </label>
1128
                                                <input type="text" id="from" name="dateenrolled" maxlength="10" size="10" value="[% borrower_data.dateenrolled | html %]" class="flatpickr" data-date_to="to" />
1129
                                                [% IF ( mandatorydateenrolled ) %]
1130
                                                    <span class="required">Required</span>
1131
                                                [% END %]
1132
                                                [% IF ( ERROR_dateenrolled ) %]
1133
                                                    <span class="required">(Error)</span>
1134
                                                [% END %]
1135
                                                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1136
                                            </li>
1137
                                        [% END # /UNLESS nodateenrolled %]
1138
1139
                                        <li [% IF nodateexpiry %]style="display:none"[% END %]>
1140
                                            <label for="to" [% IF mandatorydateexpiry %]class="required"[% END %]> Expiry date (leave blank for auto calc): </label>
1141
                                            [% UNLESS ( op == 'add_form' ) %]
1142
                                                <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html UNLESS op == 'duplicate' %]" class="flatpickr" />
1143
                                            [% ELSE %]
1144
                                                <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html %]" class="flatpickr" />
1145
                                            [% END %]
1146
                                            [% IF ( mandatorydateexpiry ) %]
1147
                                                <span class="required">Required</span>
1148
                                            [% END %]
1149
                                            [% IF ( ERROR_dateexpiry ) %]
1150
                                                <span class="required">(Error)</span>
1151
                                            [% END %]
1152
                                            <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
1153
                                        </li>
1154
1155
                                        [% UNLESS noopacnote %]
1156
                                            <li>
1157
                                                <label for="opacnote" [% IF mandatoryopacnote %]class="required"[% END %]> OPAC note: </label>
1158
                                                <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% borrower_data.opacnote | html UNLESS op == 'duplicate' %]</textarea>
1159
                                                <div class="hint">This message appears on this patron's user page in the OPAC</div>
1160
                                                [% IF ( mandatoryopacnote ) %]
1161
                                                    <span class="required">Required</span>
1162
                                                [% END %]
1163
                                            </li>
1164
                                        [% END # /UNLESS noopacnote %]
1165
1166
                                        [% UNLESS noborrowernotes %]
1167
                                            <li>
1168
                                                <label for="borrowernotes" [% IF mandatoryborrowernotes %]class="required"[% END %]> Circulation note: </label>
1169
                                                <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrower_data.borrowernotes | $raw UNLESS op == 'duplicate' %]</textarea>
1170
                                                <div class="hint">This message displays when checking out to this patron</div>
1171
                                                [% IF ( mandatoryborrowernotes ) %]
1172
                                                    <span class="required">Required</span>
1173
                                                [% END %]
1174
                                            </li>
1175
                                        [% END # /UNLESS noborrowernotes %]
1176
                                    </ol>
1177
                                </fieldset>
1178
                                <!-- /#memberentry_subscription -->
1179
                            [% END # hide fieldset %]
1180
1181
                            [% UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1182
                                <fieldset class="rows" id="memberentry_userid">
1183
                                    <legend class="expanded" id="opac_staff_login_lgd">
1184
                                        <i class="fa fa-caret-down" aria-hidden="true"></i>
1185
                                        OPAC/Staff interface login
1186
                                    </legend>
1187
                                    <ol>
1188
                                        [% UNLESS nouserid %]
1189
                                            <li>
1190
                                                <label for="userid" [% IF mandatoryuserid %]class="required"[% END %]> Username: </label>
1191
1192
                                                [% IF ( NoUpdateLogin ) %]
1193
                                                    [% IF ( op == 'duplicate' ) %]
1194
                                                        <input type="text" id="userid" name="userid" size="20" disabled="disabled" />
1195
                                                    [% ELSE %]
1196
                                                        <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% borrower_data.userid | html %]" />
1197
                                                    [% END %]
1198
                                                [% ELSE %]
1199
                                                    [% IF ( op == 'duplicate' ) %]
1200
                                                        <input type="text" id="userid" name="userid" size="20" value="" />
1201
                                                    [% ELSE %]
1202
                                                        <input type="text" id="userid" name="userid" size="20" value="[% borrower_data.userid | html %]" />
1203
                                                    [% END %]
1204
                                                [% END # /IF ( NoUpdateLogin ) %]
1205
1206
                                                [%# Dummy input to avoid Firefox from using userid/password saved for authentication %]
1207
                                                <input type="text" disabled="disabled" style="display:none" />
1208
1209
                                                [% IF ( mandatoryuserid ) %]
1210
                                                    <span class="required">Required</span>
1211
                                                [% END %]
1212
                                            </li>
1213
                                        [% END # /UNLESS nouserid %]
1214
1215
                                        [% UNLESS nopassword %]
1216
                                            <li>
1217
                                                <label for="password" [% IF mandatorypassword %]class="required"[% END %]> Password: </label>
1218
                                                [% IF ( op == 'add_form' ) %]
1219
                                                    [% IF ( NoUpdateLogin ) %]
1220
                                                        [% IF ( op == 'duplicate' ) %]
1221
                                                            <input type="password" id="password" name="password" size="20" disabled="disabled" />
1222
                                                        [% ELSE %]
1223
                                                            <input type="password" id="password" name="password" size="20" disabled="disabled" value="[% borrower_data.password | html %]" />
1224
                                                        [% END %]
1225
                                                    [% ELSE %]
1226
                                                        [% IF ( op == 'duplicate' ) %]
1227
                                                            <input type="password" id="password" name="password" size="20" autocomplete="new-password" />
1228
                                                        [% ELSE %]
1229
                                                            <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="[% borrower_data.password | html %]" />
1230
                                                        [% END %]
1231
                                                    [% END # /IF ( NoUpdateLogin ) %]
1232
                                                [% ELSE # IF ( op == 'add_form' ) %]
1233
1234
                                                    [% IF ( borrower_data.password ) %]
1235
                                                        [% IF ( NoUpdateLogin ) %]
1236
                                                            <input type="password" id="password" name="password" size="20" disabled="disabled" value="****" />
1237
                                                        [% ELSE %]
1238
                                                            [% IF ( op == 'duplicate' ) %]
1239
                                                                <input type="password" id="password" name="password" autocomplete="new-password" size="20" />
1240
                                                            [% ELSE %]
1241
                                                                <input type="password" id="password" name="password" size="20" value="****" />
1242
                                                            [% END %]
1243
                                                        [% END %]
1244
                                                    [% ELSE %]
1245
                                                        [% IF ( NoUpdateLogin ) %]
1246
                                                            <input type="password" id="password" name="password" size="20" disabled="disabled" value="" />
1247
                                                        [% ELSE %]
1248
                                                            <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="" />
1249
                                                        [% END %]
1250
                                                    [% END # /IF ( password ) %]
1251
                                                [% END # /IF ( op == 'add_form' ) %]
1252
                                                [% IF ( mandatorypassword ) %]
1253
                                                    <span class="required">Required</span>
1254
                                                [% END %]
1255
                                                [% IF ( ERROR_password_too_short ) %]
1256
                                                    <span class="required">Password is too short</span>
1257
                                                [% END %]
1258
                                                [% IF ( ERROR_password_too_weak ) %]
1259
                                                    <span class="required">Password is too weak</span>
1260
                                                [% END %]
1261
                                                [% IF ( ERROR_password_has_whitespaces ) %]
1262
                                                    <span class="required">Password has leading or trailing whitespaces</span>
1263
                                                [% END %]
1264
                                                <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div>
1265
                                            </li>
1266
1267
                                            <li>
1268
                                                <label for="password2" [% IF mandatorypassword %]class="required"[% END %]> Confirm password: </label>
1269
                                                [% IF ( op == 'add_form' ) %]
1270
                                                    [% IF ( NoUpdateLogin ) %]
1271
                                                        [% IF ( op == 'duplicate' ) %]
1272
                                                            <input type="password" id="password2" name="password2" size="20" disabled="disabled" />
1273
                                                        [% ELSE %]
1274
                                                            <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="[% borrower_data.password | html %]" />
1275
                                                        [% END %]
1276
                                                    [% ELSE %]
1277
                                                        [% IF ( op == 'duplicate' ) %]
1278
                                                            <input type="password" id="password2" name="password2" size="20" />
1279
                                                        [% ELSE %]
1280
                                                            <input type="password" id="password2" name="password2" size="20" value="[% borrower_data.password | html %]" />
1281
                                                        [% END %]
1282
                                                    [% END %]
1283
                                                [% ELSE # IF ( op == 'add_form' ) %]
1284
                                                    [% IF ( borrower_data.password ) %]
1285
                                                        [% IF ( NoUpdateLogin ) %]
1286
                                                            <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="****" />
1287
                                                        [% ELSE %]
1288
                                                            [% IF ( op == 'duplicate' ) %]
1289
                                                                <input type="password" id="password2" name="password2" size="20" />
1290
                                                            [% ELSE %]
1291
                                                                <input type="password" id="password2" name="password2" size="20" value="****" />
1292
                                                            [% END %]
1293
                                                        [% END %]
1294
                                                    [% ELSE %]
1295
                                                        [% IF ( NoUpdateLogin ) %]
1296
                                                            <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="" />
1297
                                                        [% ELSE %]
1298
                                                            <input type="password" id="password2" name="password2" size="20" value="" />
1299
                                                        [% END %]
1300
                                                    [% END %]
1301
                                                [% END # /IF ( op == 'add_form' ) %]
1302
1303
                                                [% IF ( mandatorypassword ) %]
1304
                                                    <span class="required">Required</span>
1305
                                                [% END %]
1306
                                                [% IF ( ERROR_password_mismatch ) %]
1307
                                                    <span class="required">Passwords do not match</span>
1308
                                                [% END %]
1309
                                            </li>
1310
                                        [% END # /UNLESS nopassword %]
1311
                                        [% UNLESS ( !CanUpdatePasswordExpiration ) %]
1312
                                            <li>
1313
                                                <label for="password_expiration_date">Password expiration date:</label>
1314
                                                <input type="text" id="password_expiration_date" name="password_expiration_date" maxlength="10" size="10" value="[% borrower_data.password_expiration_date | html %]" class="flatpickr" />
1315
                                            </li>
1316
                                        [% END %]
1317
                                    </ol>
1318
                                </fieldset>
1319
                                <!-- /#memberentry_userid -->
1320
                            [% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1321
1322
                            <!--this zones are not necessary in modif mode -->
1323
                            [% UNLESS ( op == 'add_form' || op == 'duplicate' || ( nogonenoaddress && nolost ) ) %]
1324
                                <fieldset class="rows" id="memberentry_account_flags">
1325
                                    <legend class="expanded" id="account_flags_lgd">
1326
                                        <i class="fa fa-caret-down" aria-hidden="true"></i>
1327
                                        Patron account flags
1328
                                    </legend>
1329
                                    <p>Setting a value here will prevent patron from circulating materials and placing holds on the OPAC</p>
1330
                                    <ol class="radio">
1331
                                        [% UNLESS nogonenoaddress %]
1332
                                            <li>
1333
                                                <label class="radio [% IF mandatorygonenoaddress %]required[% END %]" for="yesgonenoaddress"> Gone no address: </label>
1334
                                                [% IF CAN_user_circulate_manage_restrictions %]
1335
                                                    <label for="yesgonenoaddress">
1336
                                                        [% IF ( borrower_data.gonenoaddress ) %]
1337
                                                            <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" checked="checked" />
1338
                                                        [% ELSE %]
1339
                                                            <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" />
1340
                                                        [% END %]
1341
                                                        Yes
1342
                                                    </label>
1343
                                                    <label for="nogonenoaddress">
1344
                                                        [% IF ( borrower_data.gonenoaddress ) %]
1345
                                                            <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" />
1346
                                                        [% ELSE %]
1347
                                                            <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" checked="checked" />
1348
                                                        [% END %]
1349
                                                        No
1350
                                                    </label>
1351
                                                [% ELSE %]
1352
                                                    [% IF borrower_data.gonenoaddress %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
1353
                                                [% END # /IF CAN_user_circulate_manage_restrictions %]
1354
                                                [% IF mandatorygonenoaddress %]
1355
                                                    <span class="required">Required</span>
1356
                                                [% END %]
1357
                                            </li>
1358
                                        [% END # /UNLESS nogonenoaddress %]
1359
                                        [% UNLESS nolost %]
1360
                                            <li>
1361
                                                <label class="radio [% IF mandatorylost %]required[% END %]" for="yeslost"> Lost card: </label>
1362
                                                [% IF CAN_user_circulate_manage_restrictions %]
1363
                                                    <label for="yeslost">
1364
                                                        [% IF ( borrower_data.lost ) %]
1365
                                                            <input type="radio" id="yeslost" name="lost" value="1" checked="checked" />
1366
                                                        [% ELSE %]
1367
                                                            <input type="radio" id="yeslost" name="lost" value="1" />
1368
                                                        [% END %]
1369
                                                        Yes
1370
                                                    </label>
1371
                                                    <label for="nolost">
1372
                                                        [% IF ( borrower_data.lost ) %]
1373
                                                            <input type="radio" id="nolost" name="lost" value="0" />
1374
                                                        [% ELSE %]
1375
                                                            <input type="radio" id="nolost" name="lost" value="0" checked="checked" />
1376
                                                        [% END %]
1377
                                                        No
1378
                                                    </label>
1379
                                                [% ELSE %]
1380
                                                    [% IF borrower_data.lost %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %]
1381
                                                [% END # /IF CAN_user_circulate_manage_restrictions %]
1382
                                                [% IF mandatorylost %]
1383
                                                    <span class="required">Required</span>
1384
                                                [% END %]
1385
                                            </li>
1386
                                        [% END # /UNLESS nogonenoaddress %]
1387
                                    </ol>
1388
                                </fieldset>
1389
                                <!-- /#memberentry_account_flags -->
1390
                            [% END %]
1391
                            <fieldset class="rows" id="memberentry_restrictions">
1392
                                <legend class="expanded" id="restrictions_lgd">
1393
                                    <i class="fa fa-caret-down" aria-hidden="true"></i>
1394
                                    Patron restrictions
1395
                                </legend>
1396
                                [% IF ( patron.restrictions.count ) %]
1397
                                    <table>
1398
                                        <thead>
1399
                                            <tr>
1400
                                                <th>Type</th>
1401
                                                <th>Comment</th>
1402
                                                <th>Expiration</th>
1403
                                                <th>[% tp('patron restriction created on', 'Created') | html %]</th>
1404
                                                [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1405
                                                    <th>Remove?</th>
1406
                                                [% END %]
1407
                                            </tr>
1408
                                        </thead>
1409
                                        <tbody>
1410
                                            [% FOREACH restriction IN patron.restrictions %]
1411
                                                <tr>
1412
                                                    <td>[% PROCESS restriction_type_description restriction_type=restriction.type %]</td>
1413
                                                    <td>
1414
                                                        [% IF restriction.comment.search('OVERDUES_PROCESS') %]
1415
                                                            Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %]
1416
                                                        [% ELSE %]
1417
                                                            [% restriction.comment | $raw %]
1418
                                                        [% END %]
1419
                                                    </td>
1420
                                                    <td>
1421
                                                        [% IF restriction.expiration %]
1422
                                                            [% restriction.expiration | $KohaDates %]
1423
                                                        [% ELSE %]
1424
                                                            <em>Indefinite</em>
1425
                                                        [% END %]
1426
                                                    </td>
1427
                                                    <td>[% restriction.created | $KohaDates %]</td>
1428
                                                    [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1429
                                                        <td>
1430
                                                            <input type="checkbox" id="debarment_[% restriction.borrower_debarment_id | html %]" name="remove_debarment" value="[% restriction.borrower_debarment_id | html %]" />
1431
                                                        </td>
1432
                                                    [% END %]
1433
                                                </tr>
1434
                                            [% END # /FOREACH d %]
1435
                                        </tbody>
1436
                                    </table>
1437
                                [% ELSE %]
1438
                                    <p>Patron is currently unrestricted.</p>
1439
                                [% END # /IF ( patron.restrictions.count ) %]
1440
1441
                                [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
1442
                                    <p
1443
                                        ><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p
1444
                                    >
1445
                                    <fieldset id="manual_restriction_form">
1446
                                        <input type="hidden" id="add_debarment" name="add_debarment" value="0" />
1447
                                        <legend id="manual_restriction_lgd">Add manual restriction</legend>
1448
                                        <ol>
1449
                                            [% IF Koha.Preference('PatronRestrictionTypes') %]
1450
                                                <li>
1451
                                                    <label for="debarred_type">Type:</label>
1452
                                                    <select name="debarred_type">
1453
                                                        [% FOREACH restriction_type IN restriction_types %]
1454
                                                            [% IF !restriction_type.is_system %]
1455
                                                                [% IF restriction_type.is_default %]
1456
                                                                    <option value="[% restriction_type.code | html %]" selected>[% PROCESS restriction_type_description %]</option>
1457
                                                                [% ELSE %]
1458
                                                                    <option value="[% restriction_type.code | html %]">[% PROCESS restriction_type_description %]</option>
1459
                                                                [% END %]
1460
                                                            [% END %]
1461
                                                        [% END %]
1462
                                                    </select>
1463
                                                </li>
1464
                                            [% END %]
1465
                                            <li>
1466
                                                <label for="debarred_comment">Comment: </label>
1467
                                                <input type="text" id="debarred_comment" name="debarred_comment" />
1468
                                            </li>
1469
                                            <li>
1470
                                                <label for="debarred_expiration">Expiration: </label>
1471
                                                <input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="flatpickr" type="text" />
1472
                                                <a href="#" id="clear_debarred_expiration">Clear date</a>
1473
                                            </li>
1474
                                        </ol>
1475
                                        <p>
1476
                                            <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a>
1477
                                        </p>
1478
                                    </fieldset>
1479
                                    <!-- /#manual_restriction_form -->
1480
                                [% END # /IF CAN_user_borrowers_edit_borrowers %]
1481
                            </fieldset>
1482
                            <!-- /#memberentry_restrictions -->
1483
                        [% END # /IF ( step_3 ) %]
1484
1485
                        [% IF ( step_7 ) %]
1486
                            [% IF Koha.Preference('HouseboundModule') %]
1487
                                <fieldset class="rows" id="memberentry_housebound_roles">
1488
                                    <legend class="expanded" id="housebound_roles">
1489
                                        <i class="fa fa-caret-down" aria-hidden="true"></i>
1490
                                        Housebound roles
1491
                                    </legend>
1492
                                    <ol class="radio">
1493
                                        <li>
1494
                                            <label class="radio" for="housebound_chooser"> Chooser: </label>
1495
                                            [% IF ( housebound_role.housebound_chooser == 1 ) %]
1496
                                                <label for="yes_housebound_chooser">Yes </label>
1497
                                                <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" checked="checked" />
1498
                                                <label for="no_housebound_chooser">No </label>
1499
                                                <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" />
1500
                                            [% ELSE %]
1501
                                                <label for="yes_housebound_chooser">Yes </label>
1502
                                                <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" />
1503
                                                <label for="no_housebound_chooser">No </label>
1504
                                                <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" checked="checked" />
1505
                                            [% END %]
1506
                                        </li>
1507
                                        <li>
1508
                                            <label class="radio" for="housebound_deliverer">Deliverer:</label>
1509
                                            [% IF ( housebound_role.housebound_deliverer == 1 ) %]
1510
                                                <label for="yes_housebound_deliverer">Yes </label>
1511
                                                <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" checked="checked" />
1512
                                                <label for="no_housebound_deliverer">No </label>
1513
                                                <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" />
1514
                                            [% ELSE %]
1515
                                                <label for="yes_housebound_deliverer">Yes </label>
1516
                                                <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" />
1517
                                                <label for="no_housebound_deliverer">No </label>
1518
                                                <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" checked="checked" />
1519
                                            [% END %]
1520
                                        </li>
1521
                                    </ol>
1522
                                    <!-- /ol.radio -->
1523
                                </fieldset>
1524
                                <!-- /#memberentry_housebound_roles -->
1525
                            [% END # hide fieldset %]
1526
                        [% END # IF step_7 %]
1527
1528
                        [% IF ( step_4 ) %]
1529
                            [% IF Koha.Preference('ExtendedPatronAttributes') %]
1530
                                [% UNLESS ( no_patron_attribute_types ) %]
1531
                                    <fieldset class="rows" id="memberentry_patron_attributes">
1532
                                        <legend class="expanded" id="patron_attributes_lgd">
1533
                                            <i class="fa fa-caret-down" aria-hidden="true"></i>
1534
                                            Additional attributes and identifiers
1535
                                        </legend>
1536
                                        <input type="hidden" name="setting_extended_patron_attributes" value="1" />
1537
                                        [% FOREACH pa_loo IN patron_attributes %]
1538
                                            <ol class="attributes_table">
1539
                                                <div id="aai_[% pa_loo.class | html %]">
1540
                                                    [% IF pa_loo.class %]
1541
                                                        <h3 id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</h3>
1542
                                                    [% END %]
1543
                                                    [% FOREACH patron_attribute IN pa_loo.items %]
1544
                                                        <li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]">
1545
                                                            [% IF patron_attribute.mandatory %]
1546
                                                                <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label>
1547
                                                            [% ELSE %]
1548
                                                                <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label>
1549
                                                            [% END %]
1550
                                                            [% IF ( patron_attribute.use_dropdown ) %]
1551
                                                                <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" [% IF patron_attribute.mandatory %]required="required"[% END %]>
1552
                                                                    <option value=""></option>
1553
                                                                    [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
1554
                                                                        [% IF auth_val_loo.authorised_value == patron_attribute.value %]
1555
                                                                            <option value="[% auth_val_loo.authorised_value | html %]" selected="selected"> [% auth_val_loo.lib | html %] </option>
1556
                                                                        [% ELSE %]
1557
                                                                            <option value="[% auth_val_loo.authorised_value | html %]"> [% auth_val_loo.lib | html %] </option>
1558
                                                                        [% END %]
1559
                                                                    [% END %]
1560
                                                                </select>
1561
                                                            [% ELSE %]
1562
                                                                [% IF patron_attribute.mandatory %]
1563
                                                                    [% IF patron_attribute.is_date %]
1564
                                                                        <input
1565
                                                                            type="text"
1566
                                                                            id="[% patron_attribute.form_id | html %]"
1567
                                                                            name="[% patron_attribute.form_id | html %]"
1568
                                                                            maxlength="10"
1569
                                                                            size="10"
1570
                                                                            value="[% patron_attribute.value | html %]"
1571
                                                                            required="required"
1572
                                                                            class="flatpickr"
1573
                                                                        />
1574
                                                                    [% ELSE %]
1575
                                                                        <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required">
1576
[% patron_attribute.value | html %]</textarea
1577
                                                                        >
1578
                                                                    [% END %]
1579
                                                                [% ELSE %]
1580
                                                                    [% IF patron_attribute.is_date %]
1581
                                                                        <input
1582
                                                                            type="text"
1583
                                                                            id="[% patron_attribute.form_id | html %]"
1584
                                                                            name="[% patron_attribute.form_id | html %]"
1585
                                                                            maxlength="10"
1586
                                                                            size="10"
1587
                                                                            value="[% patron_attribute.value | html %]"
1588
                                                                            class="flatpickr"
1589
                                                                        />
1590
                                                                    [% ELSE %]
1591
                                                                        <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea>
1592
                                                                    [% END %]
1593
                                                                [% END %]
1594
                                                            [% END # /IF ( patron_attribute.use_dropdown ) %]
1595
                                                            <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" />
1596
                                                            [% IF ( !patron_attribute.is_date ) %]
1597
                                                                <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
1598
                                                            [% END %]
1599
                                                            [% IF ( patron_attribute.repeatable ) %]
1600
                                                                <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a>
1601
                                                            [% END %]
1602
                                                            [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %]
1603
                                                        </li>
1604
                                                    [% END # /FOREACH patron_attribute %]
1605
                                                </div>
1606
                                            </ol>
1607
                                        [% END # /FOREACH pa_loo %]
1608
                                    </fieldset>
1609
                                    <!-- /#memberentry_patron_attributes -->
1610
                                [% END # UNLESS ( no_patron_attribute_types ) %]
1611
                            [% END # IF Koha.Preference('ExtendedPatronAttributes') %]
1612
                        [% END # IF ( step_4 ) %]
1613
1614
                        [% IF ( step_5 ) %]
1615
                            [% IF ( EnhancedMessagingPreferences ) %]
1616
                                <fieldset class="rows" id="memberentry_messaging_prefs">
1617
                                    <legend class="expanded" id="patron_messaging_prefs_lgd">
1618
                                        <i class="fa fa-caret-down" aria-hidden="true"></i>
1619
                                        Patron messaging preferences
1620
                                    </legend>
1621
                                    <div id="messaging_prefs_loading" class="form-message" style="display:none"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading new messaging defaults </div>
1622
                                    <input type="hidden" name="setting_messaging_prefs" value="1" />
1623
                                    [% INCLUDE 'messaging-preference-form.inc' %]
1624
                                    [% IF ( SMSSendDriver ) %]
1625
                                        [% IF !nosmsalertnumber %]
1626
                                            <p>
1627
                                                <label for="SMSnumber">SMS number:</label>
1628
                                                <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" />
1629
                                                <span class="hint sms_number_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span>
1630
                                            </p>
1631
                                        [% END %]
1632
                                        [% IF SMSSendDriver == 'Email' && !nosms_provider_id %]
1633
                                            <p>
1634
                                                <label for="sms_provider_id">SMS provider:</label>
1635
                                                <select id="sms_provider_id" name="sms_provider_id">
1636
                                                    <option value="">Unknown</option>
1637
                                                    [% FOREACH s IN sms_providers %]
1638
                                                        [% IF s.id == borrower_data.sms_provider_id %]
1639
                                                            <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option>
1640
                                                        [% ELSE %]
1641
                                                            <option value="[% s.id | html %]">[% s.name | html %]</option>
1642
                                                        [% END %]
1643
                                                    [% END %]
1644
                                                </select>
1645
                                            </p>
1646
                                        [% END # /UNLESS nosms_provider_id %]
1647
                                    [% END # IF ( SMSSendDriver ) %]
1648
                                </fieldset>
1649
                            [% END # IF ( EnhancedMessagingPreferences ) %]
1650
                        [% END # /IF step_5 %]
1651
                    </form>
1652
                    <!-- /#entryform -->
1653
1654
                    [% IF quickadd && op == 'add_form'  && !check_member %]
1655
                        <form method="get" id="quick_add_form" class="toggler">
1656
                            <fieldset class="rows quick_add"
1657
                                ><legend>Quick add</legend>
1658
                                <ol id="quick_add_list"> </ol>
1659
                            </fieldset>
1660
                        </form>
1661
                    [% END %]
1662
                [% END # /UNLESS ( no_add ) %]
1663
            </main>
1664
        </div>
1665
        <!-- /.col-md-10.order-md-2 -->
1666
1667
        [% UNLESS ( op == 'add_form' ) %]
1668
            <div class="col-md-2 order-sm-2 order-md-1">
1669
                <aside> [% INCLUDE 'circ-menu.inc' %] </aside>
1670
            </div>
1671
            <!-- /.col-md-2.order-md-1 -->
1672
        [% END %]
1673
    </div>
1674
    <!-- /.row -->
1675
</div>
1676
<!-- /.main.container-fluid -->
1677
1678
[% MACRO jsinclude BLOCK %]
1679
    [% INCLUDE 'calendar.inc' %]
1680
    [% INCLUDE 'str/members-menu.inc' %]
1681
    [% Asset.js("js/members-menu.js") | $raw %]
1682
    <script>
1683
        function update_cardnumber_warning(size){
1684
            var max_len = [% maxlength_cardnumber | html %];
1685
            if ( size >= max_len ) {
1686
                $("#cn_max").show();
1687
            } else {
1688
                $("#cn_max").hide();
1689
            }
1690
        }
1691
1692
        function toggle_guarantor_field(rel_number){
1693
            $(".relation-"+rel_number).prop('disabled', (i, v) => !v);
1694
        }
1695
1696
        function showHideFields(){
1697
            $("#messaging_prefs_loading, #guarantor_template").hide();
1698
            [% UNLESS step == 1 %]
1699
                [% IF fieldstohide.match('identity') %]
1700
                    togglePanel( $("#identity_lgd") );
1701
                [% END %]
1702
                [% IF show_guarantor || guarantor %]
1703
                    [% IF fieldstohide.match('guarantor') %]
1704
                        togglePanel( $("#patron_guarantor_lgd") );
1705
                    [% END %]
1706
                    [% IF fieldstohide.match('nonpatron_guarantor') %]
1707
                        togglePanel( $("#non_patron_guarantor_lgd") );
1708
                    [% END %]
1709
                [% END %]
1710
                [% IF fieldstohide.match('primary_address') %]
1711
                    togglePanel( $("#main_address_lgd") );
1712
                [% END %]
1713
                [% IF fieldstohide.match('primary_contact') %]
1714
                    togglePanel( $("#contact_lgd") );
1715
                [% END %]
1716
            [% END %]
1717
            [% UNLESS step == 6 %]
1718
                [% IF fieldstohide.match('alt_address') %]
1719
                    togglePanel( $("#alt_address_lgd") );
1720
                [% END %]
1721
            [% END %]
1722
            [% UNLESS step == 2 %]
1723
                [% IF fieldstohide.match('alt_contact') %]
1724
                    togglePanel( $("#alt_contact_lgd") );
1725
                [% END %]
1726
            [% END %]
1727
            [% UNLESS step == 3 %]
1728
                [% IF fieldstohide.match('lib_mgmt') %]
1729
                    togglePanel( $("#library_management_lgd") );
1730
                [% END %]
1731
                [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1732
                    [% IF fieldstohide.match('lib_setup') %]
1733
                        togglePanel( $("#library_setup_lgd") );
1734
                    [% END %]
1735
                [% END %]
1736
                [% UNLESS nouserid && nopassword %]
1737
                    [% IF fieldstohide.match('login') %]
1738
                        togglePanel( $("#opac_staff_login_lgd") );
1739
                    [% END %]
1740
                [% END %]
1741
                [% UNLESS ( op == 'add_form' || op == 'duplicate' ) %]
1742
                    [% IF fieldstohide.match('flags') %]
1743
                        togglePanel( $("#account_flags_lgd") );
1744
                    [% END %]
1745
                [% END %]
1746
                [% IF fieldstohide.match('debarments') %]
1747
                    togglePanel( $("#restrictions_lgd") );
1748
                [% END %]
1749
            [% END %]
1750
            [% UNLESS step == 7 %]
1751
                [% IF Koha.Preference('HouseboundModule') %]
1752
                    [% IF fieldstohide.match('housebound') %]
1753
                        togglePanel( $("#housebound_roles") );
1754
                    [% END %]
1755
                [% END %]
1756
            [% END %]
1757
            [% UNLESS step == 4 %]
1758
                [% IF Koha.Preference('ExtendedPatronAttributes') %]
1759
                    [% IF fieldstohide.match('additional') %]
1760
                        togglePanel( $("#patron_attributes_lgd") );
1761
                    [% END %]
1762
                [% END %]
1763
            [% END %]
1764
            [% UNLESS step == 5 %]
1765
                [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1766
                    [% IF fieldstohide.match('messaging') %]
1767
                        togglePanel( $("#patron_messaging_prefs_lgd") );
1768
                        $("#messaging_prefs_loading").toggle();
1769
                    [% END %]
1770
                [% END %]
1771
            [% END %]
1772
        }
1773
1774
        function togglePanel( node ){
1775
            var panel = node.nextAll();
1776
            if(panel.is(":visible")){
1777
                node.addClass("collapsed").removeClass("expanded").attr("title", _("Click to expand this section") );
1778
                panel.hide();
1779
            } else {
1780
                node.addClass("expanded").removeClass("collapsed").attr("title", _("Click to collapse this section") );
1781
                panel.show();
1782
                panel.find("input, select, textarea").eq(0).focus();
1783
            }
1784
        }
1785
1786
        $(document).ready(function() {
1787
            showHideFields();
1788
            $("#toggle_hidden_fields").change(function(){
1789
                showHideFields();
1790
            });
1791
1792
            $(".collapsed,.expanded").on("click",function(){
1793
                togglePanel( $(this) );
1794
                $("#messaging_prefs_loading").hide();
1795
                $("#guarantor_template").hide();
1796
            });
1797
1798
            $("#saverecord").css({ 'margin-left': 0 });
1799
1800
            [% IF borrower_data.categorycode %]
1801
                update_category_code( "[% borrower_data.categorycode | html %]" );
1802
            [% ELSE %]
1803
                if ( $("#categorycode_entry").length > 0 ){
1804
                    var category_code = $("#categorycode_entry").find("option:selected").val();
1805
                    update_category_code( category_code );
1806
                }
1807
            [% END %]
1808
1809
            [% IF new_guarantors %]
1810
                [% FOREACH g IN new_guarantors %]
1811
                    select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' );
1812
                [% END %]
1813
            [% END %]
1814
1815
            $("#cn_max").hide();
1816
            var content;
1817
            $("#cardnumber").on("keydown", function(e){
1818
                content = $(this).val();
1819
            });
1820
            $("#cardnumber").on("keyup", function(e){
1821
                // .val() will return the value of the input after the key has been released
1822
                var l = $(this).val().length;
1823
                if ( l == content.length + 1 ) { l--; }
1824
                update_cardnumber_warning(l);
1825
            });
1826
            $("#cardnumber").bind("paste", function(e){
1827
                var pastedData = e.originalEvent.clipboardData.getData('text');
1828
                update_cardnumber_warning(pastedData.length - 1);
1829
            } );
1830
            var toggle_quick_add = $(".toggle_quick_add");
1831
            $(toggle_quick_add).click(function(e){
1832
                toggle_quick_add.toggle();
1833
                e.preventDefault();
1834
                var toggle_to = '';
1835
                var toggle_from = '';
1836
                if( $("#entryform:visible").length ) {
1837
                    toggle_to = "#quick_add_form label";
1838
                    toggle_from = "#entryform label";
1839
                    $("#memberentry_guarantor").appendTo("#quick_add_form");
1840
                } else {
1841
                    toggle_to="#entryform label";
1842
                    toggle_from = "#quick_add_form label";
1843
                    $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1844
                }
1845
                $(toggle_from).each(function() {
1846
                    var input_label = $(this).attr('for');
1847
                    if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' || input_label == 'sex-other' ) {
1848
                        $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') );
1849
                        return;
1850
                    }
1851
                    $(toggle_to+"[for='"+input_label+"']").next().val(  $(this).next().val() );
1852
                });
1853
1854
                $(".toggler").toggle();
1855
            });
1856
1857
            $("#save_quick_add").click(function(){
1858
                $("#quick_add_form").validate();
1859
                if( $("#quick_add_form").valid()){
1860
                    $('.toggle_quick_add').click();
1861
                    $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor");
1862
                    $('#saverecord').click();
1863
                }
1864
                else {return false;}
1865
            });
1866
1867
            $("#saverecord").click(function(){
1868
                if( check_form_borrowers() ){
1869
                    $("#entryform").submit();
1870
                }
1871
            });
1872
1873
            $('#not-duplicate').on('click', function() {
1874
                $("input[name='nodouble']").val('1');
1875
                $('#entryform').submit();
1876
            });
1877
1878
            $(".popup_patronview").on("click", function(e){
1879
                e.preventDefault();
1880
                var url = $(this).attr("href");
1881
                openWindow( url, "patronview" );
1882
            });
1883
1884
            $("#dateofbirth").on("change", function(){
1885
                 write_age();
1886
            });
1887
1888
            $("#debarred_comment, #debarred_expiration").on("change", function(){
1889
                $("#add_debarment").val(1);
1890
            });
1891
1892
            $("#clear_debarred_expiration").on("click", function(e){
1893
                e.preventDefault();
1894
                $('#debarred_expiration').val("");
1895
            });
1896
1897
            $("#memberentry_patron_attributes").on("click", ".clear_attribute", function(e){
1898
                e.preventDefault();
1899
                clear_entry( this );
1900
            });
1901
1902
            $("#memberentry_patron_attributes").on("click", ".clone_attribute", function(e){
1903
                e.preventDefault();
1904
                clone_entry( this );
1905
            });
1906
1907
            $("#categorycode_entry").on("change", function(){
1908
                update_category_code(this);
1909
            });
1910
1911
            [% IF logged_in_user.borrowernumber == borrowernumber %]
1912
                $("#userid").on("change", function(){
1913
                    $(this).parent().find("div.hint").remove();
1914
                    if ( "[% borrower_data.userid | html %]" != $(this).val() ) {
1915
                        $(this).parent().append('<div class="hint">%s</div>'.format(_("You will be logged out if you modify your username")));
1916
                    }
1917
                });
1918
            [% END %]
1919
1920
        });
1921
1922
        [% IF quickadd && op == 'add_form' && !check_member %]
1923
            $(document).ready(function () {
1924
1925
                $("#entryform,#saverecord").hide();
1926
                [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %]
1927
                var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]];
1928
                $("#entryform label").each(function () {
1929
                    var input_label = $(this).attr('for');
1930
                    if ( input_label == 'sex-female' ) {
1931
                        input_label='sex';
1932
                    }
1933
                    else if ( input_label == 'btitle' ) {
1934
                        input_label='title';
1935
                    }
1936
                    if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){
1937
                       let orig_li = $(this).parent();
1938
                       if( orig_li.attr('class') == 'radio' ){
1939
                           let new_field = orig_li.clone();
1940
                           new_field.children('label').each(function(){
1941
                                let child_input = $(this).children('input');
1942
                                child_input.attr("id",child_input.attr("id") + "_quick_add");
1943
                            });
1944
                           new_field.appendTo("#quick_add_list");
1945
                       } else {
1946
                           let orig_input_id = orig_li.children("input,textarea,select").last().attr("id");
1947
                           if ( orig_input_id ) {
1948
                               let new_field = orig_li.clone();
1949
                               new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add");
1950
                               new_field.appendTo("#quick_add_list");
1951
                           }
1952
                           [% UNLESS mandatorypassword %]
1953
                                 if( input_label == 'password' ){
1954
                                     let orig_p2 = $("#entryform label[for='password2']").parent();
1955
                                     let new_p2  = orig_p2.clone();
1956
                                     new_p2.find('input[id="password2"]').attr("id","password2_quick_add");
1957
                                     new_p2.appendTo("#quick_add_list");
1958
                                 }
1959
                           [% END %]
1960
                       }
1961
                    }
1962
                });
1963
                if ( $("#memberentry_guarantor").length ) {
1964
                    $("#memberentry_guarantor").appendTo("#quick_add_form");
1965
                }
1966
                $("#quick_add_form").show();
1967
                $("#quick_add_form").find(".flatpickr:hidden").each( (i, input) => {
1968
                    $(input).siblings(".flatpickr_wrapper").remove(); // Remove leftover from the previous flatpickr that has been cloned
1969
                    apply_flatpickr(input);
1970
                } );
1971
            });
1972
        [% END %]
1973
        $("#guarantor_template").hide();
1974
        var prefill_fields;
1975
        var to_api_mapping;
1976
        [% IF prefill_fields %]
1977
            prefill_fields = [% To.json(prefill_fields)  | $raw %];
1978
        [% END %]
1979
        [% IF to_api_mapping %]
1980
            to_api_mapping = [% To.json(to_api_mapping) | $raw %];
1981
        [% END %]
1982
1983
        var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
1984
        var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
1985
    </script>
1986
    [% Asset.js("js/members.js") | $raw %]
1987
    [% Asset.js("js/messaging-preference-form.js") | $raw %]
1988
    [% PROCESS 'password_check.inc' new_password => 'password', category_selector => '#categorycode_entry', minPasswordLength => patron.category.effective_min_password_length, RequireStrongPassword => patron.category.effective_require_strong_password %]
1989
1990
    [% INCLUDE 'select2.inc' %]
1991
    [% SET columns = ['cardnumber','name','category','branch','dateofbirth','address-library','action'] %]
1992
    [% PROCESS patron_search_modal columns => columns, modal_title => t("Add guarantor") %]
1993
    [% PROCESS patron_search_js columns => columns, actions => ["select"], preview_on_name_click => 1 %]
1994
[% END %]
1995
1996
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt (-331 lines)
Lines 1-331 Link Here
1
[% USE raw %]
2
[% USE Branches %]
3
[% USE Koha %]
4
[% USE Asset %]
5
[% PROCESS 'i18n.inc' %]
6
[% SET footerjs = 1 %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title
9
    >[% FILTER collapse %]
10
        [% IF( do_it ) %]
11
            [% t("Results") | html %]
12
            &rsaquo;
13
        [% END %]
14
        [% t("Patrons statistics") | html %]
15
        &rsaquo; [% t("Reports") | html %] &rsaquo; [% t("Koha") | html %]
16
    [% END %]</title
17
>
18
19
[% INCLUDE 'doc-head-close.inc' %]
20
<style>
21
    .sql {
22
        display: none;
23
    }
24
    .debug {
25
        display: none;
26
    }
27
</style>
28
</head>
29
30
<body id="rep_borrowers_stats" class="rep">
31
[% WRAPPER 'header.inc' %]
32
    [% INCLUDE 'cat-search.inc' %]
33
[% END %]
34
35
[% WRAPPER 'sub-header.inc' %]
36
    [% WRAPPER breadcrumbs %]
37
        [% WRAPPER breadcrumb_item %]
38
            <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
39
        [% END %]
40
        [% IF ( do_it ) %]
41
            [% WRAPPER breadcrumb_item %]
42
                <a href="/cgi-bin/koha/reports/borrowers_stats.pl">Patrons statistics</a>
43
            [% END %]
44
            [% WRAPPER breadcrumb_item bc_active= 1 %]
45
                <span>Results</span>
46
            [% END %]
47
        [% ELSE %]
48
            [% WRAPPER breadcrumb_item bc_active= 1 %]
49
                <span>Patrons statistics</span>
50
            [% END %]
51
        [% END %]
52
    [% END #/ WRAPPER breadcrumbs %]
53
[% END #/ WRAPPER sub-header.inc %]
54
55
[% WRAPPER 'main-container.inc' aside='reports-menu' %]
56
    <h1>Patrons statistics</h1>
57
    [% IF ( do_it ) %]
58
        [% FOREACH mainloo IN mainloop %]
59
            [% IF ( mainloo.loopfilter.size>0 ) %]
60
                <p>Filtered on:</p>
61
                [% FOREACH loopfilte IN mainloo.loopfilter %]
62
                    <p> [% loopfilte.crit | html %] = [% loopfilte.filter | html %] </p>
63
                [% END %]
64
            [% END %]
65
            <table>
66
                <tr>
67
                    <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th>
68
                    [% FOREACH loopco IN mainloo.loopcol %]
69
                        <th>[% IF ( loopco.coltitle_display ) %][% loopco.coltitle_display | html %][% ELSE %][% loopco.coltitle | html %][% END %] </th>
70
                    [% END %]
71
                    <th>TOTAL</th>
72
                </tr>
73
                [% FOREACH loopro IN mainloo.looprow %]
74
                    <tr>
75
                        <td>[% IF ( loopro.rowtitle_display ) %][% loopro.rowtitle_display | html %][% ELSE %][% loopro.rowtitle | html %][% END %] </td>
76
                        [% FOREACH loopcel IN loopro.loopcell %]
77
                            <td>[% IF ( loopcel.value ) %][% loopcel.value | html %][% ELSE %]&nbsp;[% END %] </td>
78
                        [% END %]
79
                        <td>[% loopro.totalrow | html %]</td>
80
                    </tr>
81
                [% END %]
82
                <tr>
83
                    <th>TOTAL</th>
84
                    [% FOREACH loopfoote IN mainloo.loopfooter %]
85
                        <th>[% loopfoote.totalcol | html %]</th>
86
                    [% END %]
87
                    <th>[% mainloo.total | html %]</th>
88
                </tr>
89
            </table>
90
        [% END %]
91
    [% ELSE %]
92
        <form method="get" action="/cgi-bin/koha/reports/borrowers_stats.pl">
93
            <fieldset class="rows"
94
                ><legend>Patrons statistics</legend>
95
                <table>
96
                    <thead>
97
                        <tr>
98
                            <th>Title</th>
99
                            <th>Row</th>
100
                            <th>Column</th>
101
                            <th>Filter</th>
102
                        </tr>
103
                    </thead>
104
                    <tbody>
105
                        <tr>
106
                            <td>Patron category</td>
107
                            <td><input type="radio" name="Line" value="categorycode" /></td>
108
                            <td><input type="radio" checked="checked" name="Column" value="categorycode" /></td>
109
                            <td>
110
                                <select name="Filter" id="catcode">
111
                                    <option value=""></option>
112
                                    [% FOREACH patron_category IN patron_categories %]
113
                                        <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option>
114
                                    [% END %]
115
                                </select>
116
                            </td>
117
                        </tr>
118
                        <tr>
119
                            <td>Patron status</td>
120
                            <td colspan="2"></td>
121
                            <td
122
                                ><select name="status"
123
                                    ><option value=""> </option
124
                                    ><option value="debarred">restricted</option
125
                                    ><option value="gonenoadress">gone no address</option
126
                                    ><option value="lost">lost</option></select
127
                                ></td
128
                            >
129
                        </tr>
130
                        <tr>
131
                            <td>Patron activity</td>
132
                            <td colspan="2"
133
                                ><select name="period" id="period">
134
                                    <option value="1">1</option>
135
                                    <option value="2">2</option>
136
                                    <option value="3">3</option>
137
                                </select>
138
                                <label for="period">years of activity</label>
139
                            </td>
140
                            <td
141
                                ><select name="activity"
142
                                    ><option value=""> </option
143
                                    ><option value="active">active</option
144
                                    ><option value="nonactive">no active</option></select
145
                                ></td
146
                            >
147
                        </tr>
148
149
                        <tr>
150
                            <td rowspan="2">ZIP/Postal code</td>
151
                            <td><input type="radio" name="Line" value="zipcode" /></td>
152
                            <td><input type="radio" name="Column" value="zipcode" /></td>
153
                            <td
154
                                ><select name="Filter" id="zipcode">
155
                                    <option value=""> </option>
156
                                    [% FOREACH ZIP_LOO IN ZIP_LOOP %]
157
                                        <option value="[% ZIP_LOO.zipcode | html %]">[% ZIP_LOO.zipcode | html %]</option>
158
                                    [% END %]
159
                                </select>
160
                            </td>
161
                        </tr>
162
                        <tr>
163
                            <td colspan="2"
164
                                ><select name="digits" id="digits">
165
                                    <option value=""> </option>
166
                                    <option value="1">1</option>
167
                                    <option value="2">2</option>
168
                                    <option value="3">3</option>
169
                                    <option value="4">4</option>
170
                                    <option value="5">5</option>
171
                                    <option value="6">6</option>
172
                                    <option value="7">7</option>
173
                                    <option value="8">8</option>
174
                                    <option value="9">9</option>
175
                                    <option value="10">10</option>
176
                                </select>
177
                                <label for="digits">digits</label>
178
                            </td>
179
                            <td>&nbsp;</td>
180
                        </tr>
181
182
                        <tr>
183
                            <td>Library</td>
184
                            <td><input type="radio" checked="checked" name="Line" value="branchcode" /></td>
185
                            <td><input type="radio" name="Column" value="branchcode" /></td>
186
                            <td>
187
                                <select name="Filter" id="branch">
188
                                    <option value=""></option>
189
                                    [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
190
                                        <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
191
                                    [% END %]
192
                                </select>
193
                            </td>
194
                        </tr>
195
                        <tr>
196
                            <td>Date of birth</td>
197
                            <td colspan="2"></td>
198
                            <td>
199
                                <label for="from">From</label>
200
                                <input type="text" size="10" id="from" name="Filter" class="flatpickr" data-date_to="to" />
201
                                <label for="to">To</label>
202
                                <input size="10" id="to" name="Filter" value="" type="text" class="flatpickr" />
203
                                <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
204
                            </td>
205
                        </tr>
206
                        <tr>
207
                            <td>Gender</td>
208
                            <td><input type="radio" name="Line" value="sex" /></td>
209
                            <td><input type="radio" name="Column" value="sex" /></td>
210
                            <td>
211
                                <select id="sex" name="Filter">
212
                                    <option value="" />
213
                                    <option value="M">Men</option>
214
                                    <option value="F">Women</option>
215
                                </select>
216
                            </td>
217
                        </tr>
218
                        [% IF ( SORT1_LOOP ) %]
219
                            <tr>
220
                                <td>Sort1</td>
221
                                <td><input type="radio" name="Line" value="sort1" /></td>
222
                                <td><input type="radio" name="Column" value="sort1" /></td>
223
                                <td>
224
                                    <select id="sort1" name="Filter">
225
                                        <option value="" />
226
                                        [% FOREACH SORT1_LOO IN SORT1_LOOP %]
227
                                            <option value="[% SORT1_LOO.authorized_value | html %]">[% SORT1_LOO.lib | html %]</option>
228
                                        [% END %]
229
                                    </select>
230
                                </td>
231
                            </tr>
232
                        [% ELSE %]
233
                            <input type="hidden" name="Filter" />
234
                        [% END %]
235
                        [% IF ( SORT2_LOOP ) %]
236
                            <tr>
237
                                <td>Sort2</td>
238
                                <td><input type="radio" name="Line" value="sort2" /></td>
239
                                <td><input type="radio" name="Column" value="sort2" /></td>
240
                                <td>
241
                                    <select id="sort2" name="Filter">
242
                                        <option value="" />
243
                                        [% FOREACH SORT2_LOO IN SORT2_LOOP %]
244
                                            <option value="[% SORT2_LOO.value | html %]">[% SORT2_LOO.value | html %]</option>
245
                                        [% END %]
246
                                    </select>
247
                                </td>
248
                            </tr>
249
                        [% ELSE %]
250
                            <input type="hidden" name="Filter" />
251
                        [% END %]
252
                        [% IF Koha.Preference('ExtendedPatronAttributes') %]
253
                            <tr>
254
                                <th colspan="4">Patron attributes</th>
255
                            </tr>
256
                            [% FOREACH pa_loo IN patron_attributes %]
257
                                [% IF (pa_loo.class) %]
258
                                    <tr>
259
                                        <th>[% pa_loo.class | html %] ([% pa_loo.lib | html %])</th>
260
                                        <th colspan="3"></th>
261
                                    </tr>
262
                                [% END %]
263
                                [% FOREACH patron_attribute IN pa_loo.items %]
264
                                    <tr data-category_code="[% patron_attribute.category_code | html %]">
265
                                        <td> [% patron_attribute.code | html %] ([% patron_attribute.description | html %]) </td>
266
                                        <td>
267
                                            <input type="radio" name="Line" value="patron_attr.[% patron_attribute.code | html %]" />
268
                                        </td>
269
                                        <td>
270
                                            <input type="radio" name="Column" value="patron_attr.[% patron_attribute.code | html %]" />
271
                                        </td>
272
                                        <td>
273
                                            [% IF ( patron_attribute.use_dropdown ) %]
274
                                                <select name="Filter_patron_attr.[% patron_attribute.code | html %]">
275
                                                    <option value="" />
276
                                                    [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
277
                                                        <option value="[% auth_val_loo.authorised_value | html %]"> [% auth_val_loo.lib | html %] </option>
278
                                                    [% END %]
279
                                                </select>
280
                                            [% ELSE %]
281
                                                <input type="text" maxlength="64" name="Filter_patron_attr.[% patron_attribute.code | html %]" />
282
                                            [% END %]
283
                                        </td>
284
                                    </tr>
285
                                [% END %]
286
                            [% END %]
287
                        [% END %]
288
                    </tbody>
289
                </table>
290
            </fieldset>
291
292
            <fieldset class="rows">
293
                <legend>Output</legend>
294
                <ol>
295
                    <li> <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
296
                    <li>
297
                        <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" /> <label class="inline" for="basename">Named: </label
298
                        ><input type="text" name="basename" id="basename" value="Export" />
299
                        <label class="inline" for="MIME">Into an application:</label>
300
                        <select name="MIME" id="MIME">
301
                            [% FOREACH value IN CGIextChoice %]
302
                                <option value="[% value | html %]">[% value | html %]</option>
303
                            [% END %]
304
                        </select>
305
                        <select name="sep" id="sep">
306
                            [% FOREACH value IN CGIsepChoice.values.sort() %]
307
                                [% IF ( value == CGIsepChoice.default ) %]
308
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
309
                                [% ELSE %]
310
                                    <option value="[% value | html %]">[% value | html %]</option>
311
                                [% END %]
312
                            [% END %]
313
                        </select>
314
                    </li>
315
                </ol>
316
            </fieldset>
317
318
            <fieldset class="action">
319
                <input type="submit" class="btn btn-primary" value="Submit" />
320
                <input type="hidden" name="report_name" value="[% report_name | html %]" />
321
                <input type="hidden" name="do_it" value="1" />
322
            </fieldset>
323
        </form>
324
    [% END %]
325
[% END %]
326
327
[% MACRO jsinclude BLOCK %]
328
    [% INCLUDE 'calendar.inc' %]
329
[% END %]
330
331
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-652 lines)
Lines 1-652 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE Branches %]
6
[% USE Categories %]
7
[% USE TablesSettings %]
8
[% PROCESS 'i18n.inc' %]
9
[% SET footerjs = 1 %]
10
[% INCLUDE 'doc-head-open.inc' %]
11
<title
12
    >[% FILTER collapse %]
13
        [% IF ( op == 'show' or op == 'show_results' ) %]
14
            [% IF ( op == 'show' ) %]
15
                [% t("Modifications") | html %]
16
                &rsaquo;
17
            [% ELSE %]
18
                [% t("Results") | html %]
19
                &rsaquo;
20
            [% END %]
21
        [% END %]
22
        [% t("Batch patron modification") | html %]
23
        &rsaquo; [% t("Tools") | html %] &rsaquo; [% t("Koha") | html %]
24
    [% END %]</title
25
>
26
[% INCLUDE 'doc-head-close.inc' %]
27
</head>
28
29
<body id="tools_modborrowers" class="tools">
30
[% WRAPPER 'header.inc' %]
31
    [% INCLUDE 'cat-search.inc' %]
32
[% END %]
33
34
[% WRAPPER 'sub-header.inc' %]
35
    [% WRAPPER breadcrumbs %]
36
        [% WRAPPER breadcrumb_item %]
37
            <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
38
        [% END %]
39
        [% IF ( op == 'show' or op == 'show_results' ) %]
40
            [% WRAPPER breadcrumb_item %]
41
                <a href="/cgi-bin/koha/tools/modborrowers.pl">Batch patron modification</a>
42
            [% END %]
43
            [% IF ( op == 'show' ) %]
44
                [% WRAPPER breadcrumb_item bc_active= 1 %]
45
                    [% t("Modifications") | html %]
46
                [% END %]
47
            [% ELSE %]
48
                [% WRAPPER breadcrumb_item bc_active= 1 %]
49
                    [% t("Results")| html %]
50
                [% END %]
51
            [% END %]
52
        [% ELSE %]
53
            [% WRAPPER breadcrumb_item bc_active= 1 %]
54
                <span>Batch patron modification</span>
55
            [% END %]
56
        [% END %]
57
    [% END #/ WRAPPER breadcrumbs %]
58
[% END #/ WRAPPER sub-header.inc %]
59
60
[% WRAPPER 'main-container.inc' aside='tools-menu' %]
61
62
    [% IF ( op == 'show_form' ) %]
63
        <h1>Batch patron modification</h1>
64
        <form id="patron_batchmod_form" method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl">
65
            [% INCLUDE 'csrf-token.inc' %]
66
            <input type="hidden" name="op" value="cud-show" />
67
68
            [% WRAPPER tabs id= "batch_patron_options" %]
69
                [% WRAPPER tabs_nav %]
70
                    [% WRAPPER tab_item tabname= "usecardnumber" bt_active= 1 %]<span>By card number</span>[% END %]
71
                    [% WRAPPER tab_item tabname= "useborrowernumber" %]<span>By borrowernumber</span>[% END %]
72
                    [% IF patron_lists %]
73
                        [% WRAPPER tab_item tabname= "uselist" %]<span>By patron list</span>[% END %]
74
                    [% END %]
75
                [% END # /WRAPPER tabs_nav %]
76
77
                [% WRAPPER tab_panels %]
78
                    [% WRAPPER tab_panel tabname="usecardnumber" bt_active= 1 %]
79
                        <fieldset class="rows">
80
                            <legend>Use a file of card numbers</legend>
81
                            <ol>
82
                                <li>
83
                                    <label for="cardnumberuploadfile">File: </label> <input type="file" id="cardnumberuploadfile" name="cardnumberuploadfile" />
84
                                    <div class="hint">File must contain one card number per line.</div>
85
                                </li>
86
                            </ol>
87
                        </fieldset>
88
                        <fieldset class="rows">
89
                            <legend>Or list card numbers one by one</legend>
90
                            <ol>
91
                                <li>
92
                                    <label for="cardnumberlist">Card number list (one card number per line): </label>
93
                                    <textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist | html %]</textarea>
94
                                </li>
95
                            </ol>
96
                        </fieldset>
97
                        <fieldset class="action">
98
                            <input type="submit" class="btn btn-primary" value="Continue" />
99
                            <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
100
                        </fieldset>
101
                    [% END # /tab_panel# %]
102
103
                    [% WRAPPER tab_panel tabname="useborrowernumber" %]
104
                        <fieldset class="rows">
105
                            <legend>Use a file of borrowernumbers</legend>
106
                            <ol>
107
                                <li>
108
                                    <label for="borrowernumberuploadfile">File: </label> <input type="file" id="borrowernumberuploadfile" name="borrowernumberuploadfile" />
109
                                    <div class="hint">File must contain one borrowernumber per line.</div>
110
                                </li>
111
                            </ol>
112
                        </fieldset>
113
                        <fieldset class="rows">
114
                            <legend>List borrowernumbers one by one</legend>
115
                            <ol>
116
                                <li>
117
                                    <label for="borrowernumberlist">Borrowernumber list (one number per line): </label>
118
                                    <textarea rows="10" cols="30" id="borrowernumberlist" name="borrowernumberlist">[% borrowernumberlist | html %]</textarea>
119
                                </li>
120
                            </ol>
121
                        </fieldset>
122
                        <fieldset class="action">
123
                            <input type="submit" class="btn btn-primary" value="Continue" />
124
                            <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
125
                        </fieldset>
126
                    [% END # /tab_panel# %]
127
128
                    [% IF patron_lists %]
129
                        [% WRAPPER tab_panel tabname="uselist" %]
130
                            <fieldset class="rows">
131
                                <legend>Use a patron list</legend>
132
                                <ol>
133
                                    <li>
134
                                        <label for="patron_list_id">Patron list: </label>
135
                                        <select id="patron_list_id" name="patron_list_id">
136
                                            <option value=""> -- Choose a patron list -- </option>
137
                                            [% FOREACH pl IN patron_lists %]
138
                                                <option value="[% pl.patron_list_id | html %]">[% pl.name | html %]</option>
139
                                            [% END %]
140
                                        </select>
141
                                    </li>
142
                                </ol>
143
                            </fieldset>
144
                            <fieldset class="action">
145
                                <input type="submit" class="btn btn-primary" value="Continue" />
146
                                <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
147
                            </fieldset>
148
                        [% END # /tab_panel# %]
149
                    [% END %]
150
                [% END # /WRAPPER tab_panels %]
151
            [% END # /WRAPPER tabs %]
152
        </form>
153
    [% END %]
154
155
    [% IF ( op == 'show') && (!borrowers) && (!notfoundcardnumbers) # Alert if no patrons given %]
156
        [% op = 'noshow' # Change op to prevent display in code below %]
157
        <h1>Batch patrons modification</h1>
158
        <div class="alert alert-warning">
159
            <p>No patron card numbers or borrowernumbers given.</p>
160
            <form action="/cgi-bin/koha/tools/modborrowers.pl" method="get">
161
                <button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> OK</button>
162
            </form>
163
        </div>
164
    [% END #Alert if no patrons %]
165
166
    [% IF ( op == 'show' or op == 'show_results' ) %]
167
        <h1>Batch patron modification</h1>
168
        [% UNLESS ( op == 'show' ) %]
169
            <h2>Results</h2>
170
        [% END %]
171
        [% IF ( notfoundcardnumbers ) %]
172
            [% IF ( useborrowernumbers ) -%]
173
                <div class="alert alert-warning"><p>Warning, the following borrowernumbers were not found:</p></div>
174
            [% ELSE -%]
175
                <div class="alert alert-warning"><p>Warning, the following card numbers were not found:</p></div>
176
            [% END %]
177
178
            <div class="page-section">
179
                <table style="margin:auto;">
180
                    <thead>
181
                        [% IF ( useborrowernumbers ) -%]
182
                            <tr><th>Borrowernumbers not found</th></tr>
183
                        [% ELSE -%]
184
                            <tr><th>Card numbers not found</th></tr>
185
                        [% END %]
186
                    </thead>
187
                    <tbody>
188
                        [% FOREACH notfoundcardnumber IN notfoundcardnumbers %]
189
                            <tr><td>[% notfoundcardnumber.cardnumber | html %]</td></tr>
190
                        [% END %]
191
                    </tbody>
192
                </table>
193
            </div>
194
            <!-- /.page-section -->
195
        [% END %]
196
197
        [% IF ( op == 'show_results' ) %]
198
            [% IF ( errors ) %]
199
                <div class="alert alert-warning">
200
                    <h4>Errors occurred:</h4>
201
                    <ul class="warnings">
202
                        [% FOREACH error IN errors %]
203
                            [% IF ( error.error == 'can_not_update' ) %]
204
                                <li>Can not update patron. [% IF ( error.cardnumber ) %]Card number: [% error.cardnumber | html %][% END %] (Borrowernumber: [% error.borrowernumber | html %]) </li>
205
                            [% ELSE %]
206
                                <li>[% error.error | html %]</li>
207
                            [% END %]
208
                        [% END %]
209
                    </ul>
210
                </div>
211
            [% END %]
212
        [% END %]
213
214
        [% BLOCK show_patron_list %]
215
            [% IF borrowers %]
216
                <div id="cataloguing_additem_itemlist" class="page-section">
217
                    <table id="borrowerst">
218
                        <thead>
219
                            <tr>
220
                                [% IF ( op == 'show' ) %]
221
                                    <th class="NoSort">&nbsp;</th>
222
                                [% ELSE %]
223
                                    <th class="NoVisible">&nbsp;</th>
224
                                [% END %]
225
                                <th>Card number</th>
226
                                <th>Surname</th>
227
                                <th>First name</th>
228
                                <th>Library</th>
229
                                <th>Patron category</th>
230
                                <th>Street number</th>
231
                                <th>Address</th>
232
                                <th>Address 2</th>
233
                                <th>City</th>
234
                                <th>State</th>
235
                                <th>ZIP/Postal code</th>
236
                                <th>Country</th>
237
                                <th>Primary email</th>
238
                                <th>Primary phone</th>
239
                                <th>Other phone</th>
240
                                <th>Fax</th>
241
                                <th>Registration date</th>
242
                                <th>Expiry date</th>
243
                                [% IF CanUpdatePasswordExpiration %]
244
                                    <th>Password expiration date</th>
245
                                [% END %]
246
                                [% IF CanUpdateProtectPatron %]
247
                                    <th>Protected</th>
248
                                [% END %]
249
                                <th>Circulation note</th>
250
                                <th>OPAC note</th>
251
                                <th>Message</th>
252
                                <th>Restriction expiration</th>
253
                                <th>Restriction comment</th>
254
                                [% FOREACH attrh IN attributes_header %]
255
                                    <th>[% attrh.attribute | html %]</th>
256
                                [% END %]
257
                            </tr>
258
                        </thead>
259
                        <tbody>
260
                            [% FOREACH borrower IN borrowers %]
261
                                <tr>
262
                                    <td [% IF op != 'show' %]class="NoVisible"[% END %]>
263
                                        <input type="checkbox" name="borrowernumber" value="[% borrower.borrowernumber | html %]" checked="checked" />
264
                                    </td>
265
                                    <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]">[% borrower.cardnumber | html %]</a></td>
266
                                    <td>[% borrower.surname | html %]</td>
267
                                    <td>[% borrower.firstname | html %]</td>
268
                                    <td>[% Branches.GetName( borrower.branchcode ) | html %]</td>
269
                                    <td>[% Categories.GetName(borrower.categorycode) | html %]</td>
270
                                    <td>[% borrower.streetnumber | html %]</td>
271
                                    <td>[% borrower.address | html %]</td>
272
                                    <td>[% borrower.address2 | html %]</td>
273
                                    <td>[% borrower.city | html %]</td>
274
                                    <td>[% borrower.state | html %]</td>
275
                                    <td>[% borrower.zipcode | html %]</td>
276
                                    <td>[% borrower.country | html %]</td>
277
                                    <td>[% borrower.email | html %]</td>
278
                                    <td>[% borrower.phone | html %]</td>
279
                                    <td>[% borrower.mobile | html %]</td>
280
                                    <td>[% borrower.fax | html %]</td>
281
                                    <td data-order="[% borrower.dateenrolled | html %]">[% borrower.dateenrolled | $KohaDates %]</td>
282
                                    <td data-order="[% borrower.dateexpiry | html %]">[% borrower.dateexpiry | $KohaDates %]</td>
283
                                    [% IF CanUpdatePasswordExpiration %]
284
                                        [% IF borrower.password_expiration_date %]
285
                                            <td data-order="[% borrower.password_expiration_date | html %]"> [% borrower.password_expiration_date | $KohaDates %] </td>
286
                                        [% ELSE %]
287
                                            <td data-order="9999-99-99">Never</td>
288
                                        [% END %]
289
                                    [% END %]
290
                                    [% IF CanUpdateProtectPatron %]
291
                                        <td>
292
                                            [% IF borrower.protected %]
293
                                                Yes
294
                                            [% ELSE %]
295
                                                No
296
                                            [% END %]
297
                                        </td>
298
                                    [% END %]
299
                                    <td>[% borrower.borrowernotes | $raw | html_line_break %]</td>
300
                                    <td>[% borrower.opacnote | html %]</td>
301
                                    <td>
302
                                        [% FOREACH patron_message IN borrower.patron_messages %]
303
                                            [% patron_message.message | html %] <br />
304
                                            <strong>
305
                                                [% IF (patron_message.message_type == 'B') %]
306
                                                    ( OPAC )
307
                                                [% ELSE %]
308
                                                    ( Staff )
309
                                                [% END %] </strong
310
                                            ><br /><br />
311
                                        [% END %]
312
                                    </td>
313
                                    <td data-order="[% borrower.debarred | html %]">[% borrower.debarred | $KohaDates %]</td>
314
                                    <td>[% borrower.debarredcomment | html %]</td>
315
                                    [% FOREACH pa IN borrower.patron_attributes %]
316
                                        [% IF ( pa.code ) %]
317
                                            [%# Replace pa.attribute with pa.description if we prefer to display the description %]
318
                                            <td>[% pa.code | html %]=[% pa.attribute | html %]</td>
319
                                        [% ELSE %]
320
                                            <td></td>
321
                                        [% END %]
322
                                    [% END %]
323
                                </tr>
324
                            [% END %]
325
                        </tbody>
326
                    </table>
327
                </div>
328
            [% END %]
329
        [% END %]
330
        [% IF ( op == 'show' ) %]
331
            <form name="f" action="modborrowers.pl" method="post" id="batchmod-borrowers-form">
332
                [% INCLUDE 'csrf-token.inc' %]
333
                <input type="hidden" name="op" value="cud-do" />
334
                [% IF ( borrowers ) %]
335
                    <div class="btn-toolbar selections-toolbar"
336
                        ><a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-times"></i> Clear all</a></div
337
                    >
338
                    [% PROCESS show_patron_list %]
339
                    <div id="cataloguing_additem_newitem">
340
                        <h2>Edit patrons</h2>
341
                        <div class="hint">Checking the box right next to the label will disable the entry and delete the values of that field on all selected patrons</div>
342
                        <fieldset class="rows" id="fields_list">
343
                            <ol>
344
                                [% FOREACH field IN fields %]
345
                                    <li>
346
                                        <label for="[% field.name | html %]" [% IF field.mandatory %]class="required"[% END %]>
347
                                            [% SWITCH ( field.name ) %]
348
                                            [% CASE 'surname' %]
349
                                                <span>Surname:</span>
350
                                            [% CASE 'firstname' %]
351
                                                <span>First name:</span>
352
                                            [% CASE 'branchcode' %]
353
                                                <span>Library:</span>
354
                                            [% CASE 'categorycode' %]
355
                                                <span>Patron category:</span>
356
                                            [% CASE 'streetnumber' %]
357
                                                <span>Street number:</span>
358
                                            [% CASE 'address' %]
359
                                                <span>Address:</span>
360
                                            [% CASE 'address2' %]
361
                                                <span>Address 2:</span>
362
                                            [% CASE 'city' %]
363
                                                <span>City:</span>
364
                                            [% CASE 'state' %]
365
                                                <span>State:</span>
366
                                            [% CASE 'zipcode' %]
367
                                                <span>ZIP/Postal code:</span>
368
                                            [% CASE 'country' %]
369
                                                <span>Country:</span>
370
                                            [% CASE 'email' %]
371
                                                <span>Primary email:</span>
372
                                            [% CASE 'phone' %]
373
                                                <span>Primary phone:</span>
374
                                            [% CASE 'mobile' %]
375
                                                <span>Other phone:</span>
376
                                            [% CASE 'fax' %]
377
                                                <span>Fax:</span>
378
                                            [% CASE 'sort1' %]
379
                                                <span>Sort 1:</span>
380
                                            [% CASE 'sort2' %]
381
                                                <span>Sort 2:</span>
382
                                            [% CASE 'dateenrolled' %]
383
                                                <span>Registration date:</span>
384
                                            [% CASE 'dateexpiry' %]
385
                                                <span>Expiry date:</span>
386
                                            [% CASE 'borrowernotes' %]
387
                                                <span>Circulation note:</span>
388
                                            [% CASE 'opacnote' %]
389
                                                <span>OPAC note:</span>
390
                                            [% CASE "message" %]
391
                                                <span>Message:</span>
392
                                            [% CASE 'debarred' %]
393
                                                <span>Restriction expiration:</span>
394
                                            [% CASE 'debarredcomment' %]
395
                                                <span>Restriction comment:</span>
396
                                            [% CASE 'password_expiration_date' %]
397
                                                <span>Password expiration date:</span>
398
                                            [% CASE 'protected' %]
399
                                                <span>Protected:</span>
400
                                            [% END %]
401
                                        </label>
402
                                        [% IF ( field.type == 'text' ) %]
403
                                            <input type="text" id="[% field.name | html %]" name="[% field.name | html %]" value="" />
404
                                        [% END %]
405
                                        [% IF ( field.type == 'message_type' ) %]
406
                                            <input type="text" name="[% field.name | html %]" value="" />
407
                                            <select name="add_message_type" id="message_type">
408
                                                <option value="L">Staff - Internal note</option>
409
                                                <option value="B">OPAC</option>
410
                                            </select>
411
                                        [% END %]
412
                                        [% IF ( field.type == 'select' ) %]
413
                                            [% IF field.option.size %]
414
                                                <select id="[% field.name | html %]" name="[% field.name | html %]">
415
                                                    [% FOREACH opt IN field.option %]
416
                                                        <option value="[% opt.value | html %]">[% opt.lib | html %]</option>
417
                                                    [% END %]
418
                                                </select>
419
                                            [% ELSE %]
420
                                                There is no value defined for [% field.name | html %]
421
                                            [% END %]
422
                                        [% END %]
423
                                        [% IF ( field.type == 'bool' ) %]
424
                                            <select name="[% field.name | html %]">
425
                                                <option value=""></option>
426
                                                <option value="1">Yes</option>
427
                                                <option value="0">No</option>
428
                                            </select>
429
                                        [% END %]
430
                                        [% IF ( field.type == 'date' ) %]
431
                                            <input type="text" name="[% field.name | html %]" id="[% field.name | html %]" value="" size="10" maxlength="10" class="flatpickr" />
432
                                            <a href="#" class="clear-date" id="clear-date-[% field.name | html %]"><i class="fa fa-fw fa-trash-can"></i> Clear</a>
433
                                        [% END %]
434
                                        [% IF field.mandatory %]
435
                                            <input type="checkbox" title="This field is mandatory" name="disable_input" value="[% field.name | html %]" disabled="disabled" readonly="readonly" />
436
                                            <span class="required">Required fields cannot be cleared</span>
437
                                        [% ELSE %]
438
                                            <input type="checkbox" title="Check to delete this field" name="disable_input" value="[% field.name | html %]" />
439
                                            [% IF ( field.type == 'message_type' ) %]
440
                                                <span class="hint">NOTE: Checking this box will remove ALL messages</span>
441
                                            [% END %]
442
                                        [% END %]
443
                                    </li>
444
                                [% END %]
445
                                [% IF ( patron_attributes_codes ) %]
446
                                    <li class="attributes">
447
                                        <label for="patron_attributes" style="width:auto;">
448
                                            <span>Patron attribute:</span>
449
                                        </label>
450
                                        <select id="patron_attributes" name="patron_attributes">
451
                                            <option value=""></option>
452
                                            [% FOREACH pac IN patron_attributes_codes %]
453
                                                <option value="[% pac.attribute_code | html %]" data-type="[% pac.type | html %]" data-category="[% pac.category_lib | html %]">[% pac.attribute_lib | html %]</option>
454
                                            [% END %]
455
                                        </select>
456
457
                                        <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
458
                                        <span class="patron_attributes_value"><input type="hidden" name="patron_attributes_value" /></span>
459
                                        <a href="#" class="add_attributes" title="Add an attribute"><i class="fa fa-fw fa-plus"></i> New</a>
460
                                        <span class="information_category hint" style="width:25%;float:right;"></span>
461
                                    </li>
462
                                    <div class="hint">NOTE: Attributes set here will replace all attributes of the same type in the patron record.</div>
463
                                [% END %]
464
                            </ol>
465
                        </fieldset>
466
                        <fieldset class="action">
467
                            <input type="submit" name="mainformsubmit" class="btn btn-primary" value="Save" />
468
                            <a href="/cgi-bin/koha/tools/modborrowers.pl" class="cancel">Cancel</a>
469
                            [% PROCESS 'members-patron-selections.inc' id="batchmod-borrowers-form" %]
470
                        </fieldset>
471
                    </div>
472
                [% END %]
473
            </form>
474
        [% END %]
475
    [% END %]
476
    [% IF ( op == 'show_results' ) %]
477
        <p>
478
            <a href="/cgi-bin/koha/tools/modborrowers.pl" title="New batch patrons modification">New batch patron modification</a>
479
        </p>
480
    [% END %]
481
[% END %]
482
483
[% MACRO jsinclude BLOCK %]
484
    [% INCLUDE 'calendar.inc' %]
485
    [% INCLUDE 'datatables.inc' %]
486
    [% INCLUDE 'columns_settings.inc' %]
487
    [% Asset.js("js/tools-menu.js") | $raw %]
488
    [% Asset.js("js/members-patron-selections.js") | $raw %]
489
    <script>
490
        var patron_attributes_lib = new Array();
491
        var patron_attributes_values = new Array();
492
        var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_patron_modification', 'borrowerst', 'json' ) | $raw %];
493
494
        [% FOREACH attrh IN attributes_header %]
495
            table_settings["columns"].push({
496
                columname: "[% attrh.attribute | html %]",
497
                cannot_be_modified: 0,
498
                cannot_be_toggled: 0,
499
                is_hidden: 0
500
            });
501
        [% END %]
502
        $(document).ready(function() {
503
            [% IF borrowers %]
504
                let patron_table = KohaTable("borrowerst", {
505
                    "order": [[ 1, "asc" ]],
506
                    "autoWidth": true,
507
                }, table_settings);
508
509
                $("#selectallbutton").click(function() {
510
                    $("#borrowerst").find("input:checkbox").each(function() {
511
                        $(this).prop("checked", true);
512
                    });
513
                    return false;
514
                });
515
                $("#clearallbutton").click(function() {
516
                    $("#borrowerst").find("input:checkbox").each(function() {
517
                        $(this).prop("checked", false);
518
                    });
519
                    return false;
520
                });
521
            [% END %]
522
523
            var values = new Array();
524
            var lib = new Array();
525
            [% FOREACH pav IN patron_attributes_values %]
526
                values = new Array();
527
                lib = new Array();
528
                [% FOREACH option IN pav.options %]
529
                    values.push("[% option.lib | html %]");
530
                    lib.push("[% option.authorised_value | html %]");
531
                [% END %]
532
                patron_attributes_lib["[% pav.attribute_code | html %]"] = values;
533
                patron_attributes_values["[% pav.attribute_code | html %]"] = lib;
534
            [% END %]
535
536
            $('select[name="patron_attributes"]').change(function() {
537
                updateAttrValues(this);
538
            } );
539
540
            $('select[name="patron_attributes"]').change();
541
542
            $(".clear-date").on("click",function(e){
543
                e.preventDefault();
544
                var fieldID = this.id.replace("clear-date-","");
545
                $("#" + fieldID).val("");
546
            });
547
            $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){
548
                e.preventDefault();
549
                add_attributes();
550
            });
551
            $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){
552
                e.preventDefault();
553
                del_attributes(this);
554
            });
555
            $("#patron_batchmod_form").on("submit", function(){
556
                /* Reset form fields on inactive tabs */
557
                var tab = $(this).find('ul.nav-tabs li a.active').attr('href');
558
                if ( tab == '#usecardnumber_panel' ) {
559
                    $("#borrowernumberuploadfile, #patron_list_id, #borrowernumberlist").val("");
560
                } else if ( tab == '#useborrowernumber_panel' ) {
561
                    $("#cardnumberuploadfile, #cardnumberlist, #patron_list_id").val("");
562
                } else { // uselist_panel
563
                    $("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val("");
564
                }
565
            });
566
567
            $('form[name="f"]').on("submit", function(){
568
                // Add the checkboxes to the DOM before we submit the form
569
                var form = this;
570
                var checkboxes = patron_table.$('input:checkbox:checked').serializeArray();
571
                $.each(checkboxes, function(){
572
                    let borrowernumber = this.value;
573
                    if(!$(form).find('input[name="borrowernumber"][value="'+borrowernumber+'"]').length){
574
                        $(form).append(
575
                            $('<input>')
576
                                .attr('type', 'hidden')
577
                                .attr('name', 'borrowernumber')
578
                                .val(borrowernumber)
579
                        );
580
                    }
581
                });
582
            });
583
        });
584
585
        function updateAttrValues (select_attr) {
586
            var attr_code = $(select_attr).val();
587
            var selected_option = $(select_attr).find("option:selected");
588
            var type = $(selected_option).attr('data-type');
589
            var category = $(selected_option).attr('data-category');
590
            var li_node = $(select_attr).parent();
591
            var span = $(li_node).find('span.patron_attributes_value');
592
            var information_category_node = $(li_node).find('span.information_category');
593
            information_category_node.html("");
594
595
            if ( category && category.length > 0 ) {
596
                information_category_node.html(_("This attribute will be only applied to the patron's category %s").format(category));
597
            }
598
            var disable_input_node = $(li_node).find("input:checkbox[name='disable_input']");
599
            if ( type == 'select' ) {
600
                var options = '<option value = ""></option>';
601
                for ( var i = 0 ; i < patron_attributes_values[attr_code].length ; i++ ) {
602
                    options += '<option value="'+patron_attributes_values[attr_code][i]+'">'+patron_attributes_lib[attr_code][i]+'</option>';
603
                }
604
                span.html('<select name="patron_attributes_value">' + options + '</select>');
605
                $(disable_input_node).show();
606
            } else if ( $(selected_option).val() != "" ) {
607
                span.html('<input type="text" name="patron_attributes_value"/>');
608
                $(disable_input_node).show();
609
            } else {
610
                span.html('<input type="hidden" name="patron_attributes_value" />');
611
                $(disable_input_node).hide();
612
            }
613
        }
614
615
        function add_attributes() {
616
            var count = $("li.attributes").length;
617
            var li_node = $("li.attributes:last");
618
            var li_clone = $(li_node).clone();
619
            if ( $(li_clone).find("a.del_attributes").length == 0 ) {
620
                var add_attributes = $(li_clone).find("a.add_attributes")
621
                $(add_attributes).after('<a href="#" title="' + _("Delete") + '" class="del_attributes"><i class="fa fa-fw fa-trash-can"></i> ' + _("Delete") + '</a>');
622
            }
623
            li_node.find("label").attr("for", li_node.find("label").attr("for") + "_" + count );
624
            li_node.find("input, select").attr("id", li_node.find("select").attr("id") + "_" + count );
625
626
            $(li_clone).find('select[name="patron_attributes"]').change(function() {
627
                updateAttrValues(this);
628
            } );
629
630
            $(li_clone).find('select[name="patron_attributes"]').change();
631
632
            $("#fields_list>ol").append(li_clone);
633
            update_attr_values();
634
        }
635
636
        function del_attributes(a_node) {
637
            $(a_node).parent('li').remove();
638
            update_attr_values();
639
        }
640
641
        function update_attr_values() {
642
            $("li.attributes").each(function(i) {
643
                $(this).find("input:checkbox").val("attr"+i+"_value");
644
            });
645
        }
646
        function clearDate(nodeid) {
647
            $("#"+nodeid).val("");
648
        }
649
    </script>
650
[% END %]
651
652
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/members.js (-1 / +1 lines)
Lines 77-83 function update_category_code(category_code) { Link Here
77
    var mytables = $(".attributes_table");
77
    var mytables = $(".attributes_table");
78
    $(mytables).find("li").hide();
78
    $(mytables).find("li").hide();
79
    $(mytables)
79
    $(mytables)
80
        .find(" li[data-category_code='" + category_code + "']")
80
        .find(" li[data-category_code~='" + category_code + "']")
81
        .show();
81
        .show();
82
    $(mytables).find(" li[data-category_code='']").show();
82
    $(mytables).find(" li[data-category_code='']").show();
83
83
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-1372 lines)
Lines 1-1372 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE AuthorisedValues %]
4
[% USE Categories %]
5
[% USE Koha %]
6
[% USE Branches %]
7
[% USE KohaDates %]
8
[% USE Math %]
9
[% USE AdditionalContents %]
10
[% PROCESS 'i18n.inc' %]
11
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
12
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
13
[% SET userupdateview = 1 %]
14
[% BLOCK streetnumber %]
15
    [% UNLESS hidden.defined('streetnumber') %]
16
        <li>
17
            <label for="borrower_streetnumber" class="[% required.streetnumber | html %]">Street number:</label>
18
19
            <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber | html %]" class="[% required.streetnumber | html %]" size="5" maxlength="10" />
20
            <div class="required_label [% required.streetnumber | html %]">Required</div>
21
        </li>
22
    [% END %]
23
[% END %]
24
[% BLOCK B_streetnumber %]
25
    [% UNLESS hidden.defined('B_streetnumber') %]
26
        <li>
27
            <label for="borrower_B_streetnumber" class="[% required.B_streetnumber | html %]">Street number:</label>
28
29
            <input type="text" id="borrower_B_streetnumber" name="borrower_B_streetnumber" value="[% borrower.B_streetnumber | html %]" class="[% required.B_streetnumber | html %]" size="5" maxlength="10" />
30
            <div class="required_label [% required.B_streetnumber | html %]">Required</div>
31
        </li>
32
    [% END %]
33
[% END %]
34
35
[% INCLUDE 'doc-head-open.inc' %]
36
<title>[% IF op == 'edit' %]Update your personal details[% ELSE %]Register a new account[% END %] &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
37
[% INCLUDE 'doc-head-close.inc' %]
38
[% BLOCK cssinclude %]
39
[% END %]
40
</head>
41
42
[% IF op == 'edit' %]
43
    [% INCLUDE 'bodytag.inc' bodyid='opac-patron-update' %]
44
[% ELSE %]
45
    <body id="opac-patron-registration" class="opac">
46
[% END %]
47
[% INCLUDE 'masthead.inc' %]
48
49
<div class="main">
50
    [% WRAPPER breadcrumbs %]
51
        [% IF op == 'edit' %]
52
            [% WRAPPER breadcrumb_item %]
53
                <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
54
            [% END %]
55
            [% WRAPPER breadcrumb_item bc_active= 1 %]
56
                <span>Your personal details</span>
57
            [% END %]
58
        [% ELSE %]
59
            [% WRAPPER breadcrumb_item bc_active= 1 %]
60
                <span>Register a new account</span>
61
            [% END %]
62
        [% END %]
63
    [% END #/ WRAPPER breadcrumbs %]
64
65
    <div class="container-fluid">
66
        <div class="row">
67
            <div class="col col-lg-2 order-2 order-lg-1">
68
                <div id="navigation"> [% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div>
69
            </div>
70
            <div class="col-md-12 col-lg-10 order-1">
71
                <h1>Your personal details</h1>
72
73
                [% SET container_id = "add-content" %]
74
                [% IF op == 'edit' %]
75
                    [% container_id = "update-account" %]
76
                [% END %]
77
                <div id="[% container_id | html %]" class="maincontent">
78
                    [% IF op == 'edit' %]
79
                        [% UNLESS OPACPatronDetails %]
80
                            <div class="alert alert-info">To make changes to your record please contact the library.</div>
81
                        [% END %]
82
                        [% IF nochanges %]
83
                            <div class="alert alert-error">No changes were made.</div>
84
                        [% END %]
85
                    [% END %]
86
87
                    [% IF empty_mandatory_fields %]
88
                        <div class="alert alert-warning">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
89
                    [% END %]
90
91
                    [% IF invalid_form_fields %]
92
                        <div class="alert alert-error"
93
                            ><strong>The following fields contain invalid information:</strong>
94
                            <ul>
95
                                [% FOREACH field IN invalid_form_fields %]
96
                                    [% IF field == "email" %]<li>Contact information: <a href="#borrower_email">primary email address</a></li>[% END %]
97
                                    [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %]
98
                                    [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %]
99
                                    [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %]
100
                                    [% IF field == "password_too_short" %]
101
                                        <li>Password must be at least [% patron.category.effective_min_password_length | html %] characters long.</li>
102
                                    [% END %]
103
                                    [% IF field == "password_too_weak" %]
104
                                        <li>Password must contain at least one digit, one lowercase and one uppercase.</li>
105
                                    [% END %]
106
                                    [% IF field == "password_has_whitespaces" %]
107
                                        <li>Password must not contain leading or trailing whitespaces.</li>
108
                                    [% END %]
109
                                    [% IF field == "duplicate_email" %]
110
                                        <li>This email address already exists in our database.</li>
111
                                    [% END %]
112
                                    [% IF field == "email_match" %]
113
                                        <li>Emails do not match! <a href="#borrower_repeat_email">confirm email address</a></li>
114
                                    [% END %]
115
                                    [% IF field == "ERROR_age_limitations" %]
116
                                        <li>Patron's age is incorrect for their category.</li>
117
                                    [% END %]
118
                                [% END %]
119
                            </ul>
120
                            <span>Please correct and resubmit.</span>
121
                        </div>
122
                    [% END %]
123
124
                    [% IF cardnumber_wrong_length || cardnumber_already_exists %]
125
                        <div class="alert alert-error">
126
                            [% IF cardnumber_wrong_length %]
127
                                <a href="#borrower_cardnumber"><strong>The entered card number is the wrong length.</strong></a>
128
                            [% ELSIF cardnumber_already_exists %]
129
                                <a href="#borrower_cardnumber"><strong>The entered card number is already in use.</strong></a>
130
                            [% END %]
131
                            <span>Please correct and resubmit.</span>
132
                        </div>
133
                    [% END %]
134
135
                    [% IF error_type OR error_info %]
136
                        <div class="alert alert-error"
137
                            ><li>
138
                                <p>There were problems processing your registration. Please contact your library for help.</p>
139
                                [% IF error_type == 'Koha::Exceptions::Patron::InvalidUserid' %]
140
                                    <p>Error: Userid is not valid</p>
141
                                [% ELSE %]
142
                                    <p>Error [% error_type | html %]: [% error_info | html %]</p>
143
                                [% END %]
144
                            </li></div
145
                        >
146
                    [% END %]
147
148
                    [% IF failed_captcha %]
149
                        <div class="alert alert-warning">You typed in the wrong characters in the box before submitting. Please try again.</div>
150
                    [% END %]
151
152
                    [% IF has_guarantor_flag && !Koha.Preference('OPACPrivacy') && ( Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') || Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') ) %]
153
                        <div class="row">
154
                            <div class="col">
155
                                <fieldset class="rows" id="memberentry_privacy">
156
                                    <legend id="privacy_legend">Privacy</legend>
157
                                    <ol>
158
                                        [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
159
                                            <li>
160
                                                <label>Allow your guarantor to view your current checkouts?</label>
161
                                                <select id="privacy_guarantor_checkouts">
162
                                                    <option value="0">No</option>
163
                                                    [% IF borrower.privacy_guarantor_checkouts %]
164
                                                        <option value="1" selected="selected">Yes</option>
165
                                                    [% ELSE %]
166
                                                        <option value="1">Yes</option>
167
                                                    [% END %]
168
                                                </select>
169
                                                <span class="hint">
170
                                                    <a id="update_privacy_guarantor_checkouts" href="#" class="btn btn-primary">Update</a>
171
                                                    <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
172
                                                </span>
173
                                            </li>
174
                                        [% END %]
175
176
                                        [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
177
                                            <li>
178
                                                <label>Allow your guarantor to view your current fines?</label>
179
                                                <select id="privacy_guarantor_fines">
180
                                                    <option value="0">No</option>
181
                                                    [% IF borrower.privacy_guarantor_fines %]
182
                                                        <option value="1" selected="selected">Yes</option>
183
                                                    [% ELSE %]
184
                                                        <option value="1">Yes</option>
185
                                                    [% END %]
186
                                                </select>
187
                                                <span class="hint">
188
                                                    <a id="update_privacy_guarantor_fines" href="#" class="btn btn-primary">Update</a>
189
                                                    <span id="update_privacy_guarantor_fines_message" class="alert" style="display:none"></span>
190
                                                </span>
191
                                            </li>
192
                                        [% END %]
193
194
                                        <li>
195
                                            <span class="hint">
196
                                                Guaranteed by
197
                                                [% FOREACH gr IN patron.guarantor_relationships %]
198
                                                    [% SET g = gr.guarantor %]
199
                                                    [% g.preferred_name | html %]
200
                                                    [% g.middle_name | html %]
201
                                                    [% g.surname | html %]
202
                                                    [%- IF ! loop.last %],[% END %]
203
                                                [% END %]
204
                                            </span>
205
                                        </li>
206
                                    </ol>
207
                                </fieldset>
208
                            </div>
209
                        </div>
210
                    [% END %]
211
212
                    [% IF ( extended_unique_id_failed_code ) %]
213
                        <div class="alert" id="extended_unique_id_failed"
214
                            ><a href="#patron-attr-start-[% extended_unique_id_failed_code | uri %]">[% extended_unique_id_failed_description _ ': ' | html %]</a> Value is already in use ([% extended_unique_id_failed_value | html %])</div
215
                        >
216
                    [% END %]
217
218
                    <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off">
219
                        [% INCLUDE 'csrf-token.inc' %]
220
221
                        [% FOREACH field = ['streetnumber' 'streettype'  'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'preferred_name' 'middle_name' 'dateofbirth' 'initials' 'pronouns' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_streetnumber' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' 'lang' ] %]
222
                            [% IF mandatory.defined( field ) %]
223
                                [% SET required.$field = 'required' %]
224
                            [% END %]
225
                        [% END %]
226
227
                        [%# Following on one line for translatability %]
228
                        [% UNLESS ( hidden.defined('cardnumber') || ( !borrower && Koha.Preference('autoMemberNum') ) ) && hidden.defined('dateexpiry') && hidden.defined('branchcode') && hidden.defined('categorycode') %]
229
                            <div class="row">
230
                                <div class="col">
231
                                    <fieldset class="rows" id="memberentry_library">
232
                                        <legend id="library_legend">Library</legend>
233
                                        <ol>
234
                                            [% UNLESS hidden.defined('cardnumber') || ( !borrower && Koha.Preference('autoMemberNum') ) %]
235
                                                <li>
236
                                                    <label for="borrower_cardnumber" class="[% required.cardnumber | html %]">Library card number:</label>
237
238
                                                    [% IF borrower && !(cardnumber_wrong_length || cardnumber_already_exists) && op == 'edit' %]
239
                                                        [% borrower.cardnumber | html %]
240
                                                    [% ELSE %]
241
                                                        [% IF minlength_cardnumber == maxlength_cardnumber %]
242
                                                            <input
243
                                                                type="text"
244
                                                                id="borrower_cardnumber"
245
                                                                name="borrower_cardnumber"
246
                                                                size="20"
247
                                                                value="[% borrower.cardnumber | html %]"
248
                                                                minlength="[% minlength_cardnumber | html %]"
249
                                                                maxlength="[% maxlength_cardnumber | html %]"
250
                                                                class="[% required.cardnumber | html %]"
251
                                                            />
252
                                                            <div class="required_label [% required.cardnumber | html %]">Required</div>
253
                                                            <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.</div>
254
                                                        [% ELSIF minlength_cardnumber && maxlength_cardnumber %]
255
                                                            <input
256
                                                                type="text"
257
                                                                id="borrower_cardnumber"
258
                                                                name="borrower_cardnumber"
259
                                                                size="20"
260
                                                                value="[% borrower.cardnumber | html %]"
261
                                                                minlength="[% minlength_cardnumber | html %]"
262
                                                                maxlength="[% maxlength_cardnumber | html %]"
263
                                                                class="[% required.cardnumber | html %]"
264
                                                            />
265
                                                            <div class="required_label [% required.cardnumber | html %]">Required</div>
266
                                                            <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.</div>
267
                                                        [% ELSIF maxlength_cardnumber %]
268
                                                            <input
269
                                                                type="text"
270
                                                                id="borrower_cardnumber"
271
                                                                name="borrower_cardnumber"
272
                                                                size="20"
273
                                                                value="[% borrower.cardnumber | html %]"
274
                                                                maxlength="[% maxlength_cardnumber | html %]"
275
                                                                class="[% required.cardnumber | html %]"
276
                                                            />
277
                                                            <div class="required_label [% required.cardnumber | html %]">Required</div>
278
                                                            <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.</div>
279
                                                        [% ELSE %]
280
                                                            <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber | html %]" class="[% required.cardnumber | html %]" />
281
                                                            <div class="required_label [% required.cardnumber | html %]">Required</div>
282
                                                            <div class="hint">There is no minimum or maximum character length.</div>
283
                                                        [% END %]
284
                                                    [% END %]
285
                                                </li>
286
                                            [% END %]
287
288
                                            [% IF op != 'new' %]
289
                                                [% UNLESS hidden.defined('userid') %]
290
                                                    <li>
291
                                                        <label>Username:</label>
292
                                                        [% borrower.userid | html %]
293
                                                    </li>
294
                                                [% END %]
295
                                            [% END %]
296
297
                                            [% UNLESS hidden.defined('dateexpiry') %]
298
                                                <li>
299
                                                    <label>Expiration date:</label>
300
                                                    [% borrower.dateexpiry | $KohaDates %]
301
                                                </li>
302
                                            [% END %]
303
304
                                            [% UNLESS hidden.defined('branchcode') %]
305
                                                <li>
306
                                                    [% IF libraries.count %]
307
                                                        <label for="borrower_branchcode" class="[% required.branchcode | html %]">Home library:</label>
308
309
                                                        <select id="borrower_branchcode" name="borrower_branchcode" class="[% required.branchcode | html %]">
310
                                                            [% IF required.branchcode %]
311
                                                                <option value=""></option>
312
                                                            [% END %]
313
                                                            [% FOREACH l IN libraries %]
314
                                                                [% IF l.branchcode == borrower.branchcode %]
315
                                                                    <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
316
                                                                [% ELSE %]
317
                                                                    <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
318
                                                                [% END %]
319
                                                            [% END %]
320
                                                        </select>
321
                                                        <div class="required_label [% required.branchcode | html %]">Required</div>
322
                                                    [% ELSE %]
323
                                                        <span class="label">Home library:</span>
324
                                                        [% FOREACH l IN libraries %]
325
                                                            [% l.branchname | html %]
326
                                                            <input type="hidden" name="borrower_branchcode" value="[% l.branchcode | html %]" />
327
                                                        [% END %]
328
                                                    [% END %]
329
                                                </li>
330
                                            [% END %]
331
332
                                            [% UNLESS hidden.defined('categorycode') %]
333
                                                <li>
334
                                                    <label for="borrower_categorycode" class="[% required.categorycode | html %]"> Category:</label>
335
336
                                                    [% IF borrower %]
337
                                                        [% Categories.GetName( borrower.categorycode ) | html %]
338
                                                        <input type="hidden" name="borrower_categorycode" value="[% borrower.categorycode | html %]" />
339
                                                    [% ELSE %]
340
                                                        <select id="borrower_categorycode" name="borrower_categorycode" class="[% required.categorycode | html %]">
341
                                                            [% FOREACH c IN Categories.all() %]
342
                                                                [% IF c.categorycode == Koha.Preference('PatronSelfRegistrationDefaultCategory') %]
343
                                                                    <option
344
                                                                        value="[% c.categorycode | html %]"
345
                                                                        data-pwd-length="[% c.effective_min_password_length | html %]"
346
                                                                        data-pwd-strong="[% c.effective_require_strong_password | html %]"
347
                                                                        selected="selected"
348
                                                                        >[% c.description | html %]</option
349
                                                                    >
350
                                                                [% ELSE %]
351
                                                                    <option
352
                                                                        value="[% c.categorycode | html %]"
353
                                                                        data-pwd-length="[% c.effective_min_password_length | html %]"
354
                                                                        data-pwd-strong="[% c.effective_require_strong_password | html %]"
355
                                                                        >[% c.description | html %]</option
356
                                                                    >
357
                                                                [% END %]
358
                                                            [% END %]
359
                                                        </select>
360
                                                        <div class="required_label [% required.categorycode | html %]">Required</div>
361
                                                    [% END %]
362
                                                </li>
363
                                            [% END %]
364
                                        </ol>
365
                                    </fieldset>
366
                                </div>
367
                                <!-- /.col -->
368
                            </div>
369
                            <!-- /.row -->
370
                        [% END # / defined 'branchcode' %]
371
372
                        [%# Following on one line for translatability %]
373
                        [% UNLESS hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') && hidden.defined('preferred_name') && hidden.defined('middle_name') && hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('pronouns') && hidden.defined('othernames') && hidden.defined('sex') %]
374
                            <div class="row">
375
                                <div class="col">
376
                                    <fieldset class="rows" id="memberentry_identity">
377
                                        <legend id="identity_legend">Identity</legend>
378
379
                                        <ol>
380
                                            [% UNLESS hidden.defined('title') || !Koha.Preference('BorrowersTitles') %]
381
                                                <li>
382
                                                    <label for="borrower_title" class="[% required.title | html %]">Salutation:</label>
383
384
                                                    <select id="borrower_title" name="borrower_title" class="[% required.title | html %]">
385
                                                        <option value=""></option>
386
                                                        [% FOREACH mt IN Koha.Preference('BorrowersTitles').split('\|') %]
387
                                                            [% IF mt == borrower.title %]
388
                                                                <option value="[% mt | html %]" selected="selected">[% mt | html %]</option>
389
                                                            [% ELSE %]
390
                                                                <option value="[% mt | html %]">[% mt | html %]</option>
391
                                                            [% END %]
392
                                                        [% END %]
393
                                                    </select>
394
                                                    <div class="required_label [% required.title | html %]">Required</div>
395
                                                </li>
396
                                            [% END %]
397
398
                                            [% UNLESS hidden.defined('surname') %]
399
                                                <li>
400
                                                    <label for="borrower_surname" class="[% required.surname | html %]">Surname:</label>
401
402
                                                    <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname | html %]" class="[% required.surname | html %]" />
403
                                                    <div class="required_label [% required.surname | html %]">Required</div>
404
                                                </li>
405
                                            [% END %]
406
407
                                            [% UNLESS hidden.defined('firstname') %]
408
                                                <li>
409
                                                    <label for="borrower_firstname" class="[% required.firstname | html %]">First name:</label>
410
411
                                                    <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname | html %]" class="[% required.firstname | html %]" />
412
                                                    <div class="required_label [% required.firstname | html %]">Required</div>
413
                                                </li>
414
                                            [% END %]
415
416
                                            [% UNLESS hidden.defined('middle_name') %]
417
                                                <li>
418
                                                    <label for="borrower_middle_name" class="[% required.middle_name | html %]">Middle name:</label>
419
420
                                                    <input type="text" id="borrower_middle_name" name="borrower_middle_name" value="[% borrower.middle_name | html %]" class="[% required.middle_name | html %]" />
421
                                                    <div class="required_label [% required.middle_name | html %]">Required</div>
422
                                                </li>
423
                                            [% END %]
424
425
                                            [% UNLESS hidden.defined('preferred_name') %]
426
                                                <li>
427
                                                    <label for="borrower_preferred_name" class="[% required.preferred_name | html %]">Preferred name:</label>
428
429
                                                    <input type="text" id="borrower_preferred_name" name="borrower_preferred_name" value="[% borrower.preferred_name | html %]" class="[% required.preferred_name | html %]" />
430
                                                    <div class="required_label [% required.preferred_name | html %]">Required</div>
431
                                                </li>
432
                                            [% END %]
433
434
                                            [% UNLESS hidden.defined('dateofbirth') %]
435
                                                <li>
436
                                                    <label for="borrower_dateofbirth" class="[% required.dateofbirth | html %]">Date of birth:</label>
437
438
                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | html %]" size="10" class="[% required.dateofbirth | html %] flatpickr pastdate" />
439
440
                                                    <div class="required_label [% required.dateofbirth | html %]">Required</div>
441
                                                </li>
442
                                            [% END %]
443
444
                                            [% UNLESS hidden.defined('initials') %]
445
                                                <li>
446
                                                    <label for="borrower_initials" class="[% required.initials | html %]">Initials:</label>
447
448
                                                    <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials | html %]" class="[% required.initials | html %]" />
449
                                                    <div class="required_label [% required.initials | html %]">Required</div>
450
                                                </li>
451
                                            [% END %]
452
453
                                            [% UNLESS hidden.defined('pronouns') %]
454
                                                <li>
455
                                                    <label for="borrower_pronouns" class="[% required.pronouns | html %]">Pronouns:</label>
456
457
                                                    <input type="text" id="borrower_pronouns" name="borrower_pronouns" value="[% borrower.pronouns | html %]" class="[% required.prnouns | html %]" />
458
                                                    <div class="required_label [% required.pronouns | html %]">Required</div>
459
                                                </li>
460
                                            [% END %]
461
462
                                            [% UNLESS hidden.defined('othernames') %]
463
                                                <li>
464
                                                    <label for="borrower_othernames" class="[% required.othernames | html %]">Other names:</label>
465
466
                                                    <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames | html %]" class="[% required.othernames | html %]" />
467
                                                    <div class="required_label [% required.othernames | html %]">Required</div>
468
                                                </li>
469
                                            [% END %]
470
471
                                            [% UNLESS hidden.defined('sex') %]
472
                                                <li class="lradio">
473
                                                    <div class="label"></div>
474
                                                    <label for="sex-female" class="radio inline"><span class="patronsex-female">Female:</span></label>
475
                                                    [% IF borrower.sex == 'F' %]
476
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
477
                                                    [% ELSE %]
478
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" />
479
                                                    [% END %]
480
481
                                                    <label for="sex-male" class="radio inline"><span class="patronsex-male">Male:</span></label>
482
                                                    [% IF borrower.sex == 'M' %]
483
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
484
                                                    [% ELSE %]
485
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" />
486
                                                    [% END %]
487
488
                                                    <label for="sex-other" class="radio inline"><span class="patronsex-other">[% tp('gender','Other:') | html %]</span></label>
489
                                                    [% IF borrower.sex == 'O' %]
490
                                                        <input type="radio" name="borrower_sex" id="sex-other" value="O" checked="checked" />
491
                                                    [% ELSE %]
492
                                                        <input type="radio" name="borrower_sex" id="sex-other" value="O" />
493
                                                    [% END %]
494
495
                                                    <label for="sex-none" class="radio inline"><span class="patronsex-none">None specified:</span></label>
496
                                                    [% IF borrower.sex == '' %]
497
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
498
                                                    [% ELSE %]
499
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" />
500
                                                    [% END %]
501
                                                </li>
502
                                            [% END %]
503
                                        </ol>
504
                                    </fieldset>
505
                                </div>
506
                                <!-- /.col -->
507
                                [% IF ( display_patron_image ) %]
508
                                    <div class="col-sm-2">
509
                                        <p class="patronimage">
510
                                            <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
511
                                        </p>
512
                                    </div>
513
                                [% END %]
514
                            </div>
515
                            <!-- /.row -->
516
                        [% END # /UNLESS fields hidden %]
517
518
                        [%# Following on one line for translatability %]
519
                        [% UNLESS hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') && hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') && hidden.defined('country') %]
520
                            <div class="row">
521
                                <div class="col">
522
                                    <fieldset class="rows" id="memberentry_mainaddress">
523
                                        <legend id="mainaddress_legend">Main address</legend>
524
525
                                        <ol>
526
                                            [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE streetnumber %][% END %]
527
528
                                            [% SET roadtypes = AuthorisedValues.GetAuthValueDropbox('ROADTYPE') %]
529
                                            [% IF roadtypes.count %]
530
                                                [% UNLESS hidden.defined('streettype') %]
531
                                                    <li>
532
                                                        <label for="borrower_streettype" class="[% required.streettype | html %]">Street type:</label>
533
534
                                                        <select name="borrower_streettype" name="borrower_streettype" class="[% required.streettype | html %]">
535
                                                            <option value=""></option>
536
                                                            [% FOR roadtype IN roadtypes %]
537
                                                                [% IF roadtype.authorised_value == patron.streettype %]
538
                                                                    <option value="[% roadtype.authorised_value | html %]" selected="selected">[% roadtype.lib_opac OR roadtype.lib | html %]</option>
539
                                                                [% ELSE %]
540
                                                                    <option value="[% roadtype.authorised_value | html %]">[% roadtype.lib_opac OR roadtype.lib | html %]</option>
541
                                                                [% END %]
542
                                                            [% END %]
543
                                                        </select>
544
                                                        <div class="required_label [% required.streettype | html %]">Required</div>
545
                                                    </li>
546
                                                [% END %]
547
                                            [% END %]
548
549
                                            [% UNLESS hidden.defined('address') %]
550
                                                <li>
551
                                                    <label for="borrower_address" class="[% required.address | html %]">Address:</label>
552
553
                                                    <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address | html %]" class="[% required.address | html %]" />
554
                                                    <div class="required_label [% required.address | html %]">Required</div>
555
                                                </li>
556
                                            [% END %]
557
558
                                            [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %]
559
560
                                            [% UNLESS hidden.defined('address2') %]
561
                                                <li>
562
                                                    <label for="borrower_address2" class="[% required.address2 | html %]">Address 2:</label>
563
564
                                                    <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 | html %]" class="[% required.address2 | html %]" />
565
                                                    <div class="required_label [% required.address2 | html %]">Required</div>
566
                                                </li>
567
                                            [% END %]
568
569
                                            [% UNLESS hidden.defined('city') %]
570
                                                <li>
571
                                                    <label for="borrower_city" class="[% required.city | html %]">City:</label>
572
573
                                                    <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city | html %]" class="[% required.city | html %]" />
574
                                                    <div class="required_label [% required.city | html %]">Required</div>
575
                                                </li>
576
                                            [% END %]
577
578
                                            [% UNLESS hidden.defined('state') %]
579
                                                <li>
580
                                                    <label for="borrower_state" class="[% required.state | html %]">State:</label>
581
582
                                                    <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state | html %]" class="[% required.state | html %]" />
583
                                                    <div class="required_label [% required.state | html %]">Required</div>
584
                                                </li>
585
                                            [% END %]
586
587
                                            [% UNLESS hidden.defined('zipcode') %]
588
                                                <li>
589
                                                    <label for="borrower_zipcode" class="[% required.zipcode | html %]">ZIP/Postal code:</label>
590
591
                                                    <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode | html %]" class="[% required.zipcode | html %]" />
592
                                                    <div class="required_label [% required.zipcode | html %]">Required</div>
593
                                                </li>
594
                                            [% END %]
595
596
                                            [% UNLESS hidden.defined('country') %]
597
                                                <li>
598
                                                    <label for="borrower_country" class="[% required.country | html %]">Country:</label>
599
600
                                                    <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country | html %]" class="[% required.country | html %]" />
601
                                                    <div class="required_label [% required.country | html %]">Required</div>
602
                                                </li>
603
                                            [% END %]
604
                                        </ol>
605
                                    </fieldset>
606
                                </div>
607
                                <!-- /.col -->
608
                            </div>
609
                            <!-- /.row -->
610
                        [% END %]
611
612
                        [%# Following on one line for translatability %]
613
                        [% UNLESS hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') && hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax') %]
614
                            <div class="row">
615
                                <div class="col">
616
                                    <fieldset class="rows" id="memberentry_contact">
617
                                        <legend id="contact_legend">Contact information</legend>
618
619
                                        <ol>
620
                                            [% UNLESS hidden.defined('phone') %]
621
                                                <li>
622
                                                    <label for="borrower_phone" class="[% required.phone | html %]">Primary phone:</label>
623
624
                                                    <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone | html %]" class="[% required.phone | html %]" />
625
                                                    <div class="required_label [% required.phone | html %]">Required</div>
626
                                                </li>
627
                                            [% END %]
628
629
                                            [% UNLESS hidden.defined('phonepro') %]
630
                                                <li>
631
                                                    <label for="borrower_phonepro" class="[% required.phonepro | html %]">Secondary phone:</label>
632
633
                                                    <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro | html %]" class="[% required.phonepro | html %]" />
634
                                                    <div class="required_label [% required.phonepro | html %]">Required</div>
635
                                                </li>
636
                                            [% END %]
637
638
                                            [% UNLESS hidden.defined('mobile') %]
639
                                                <li>
640
                                                    <label for="borrower_mobile" class="[% required.mobile | html %]">Other phone:</label>
641
642
                                                    <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile | html %]" class="[% required.mobile | html %]" />
643
                                                    <div class="required_label [% required.mobile | html %]">Required</div>
644
                                                </li>
645
                                            [% END %]
646
647
                                            [% UNLESS hidden.defined('email') %]
648
                                                <li>
649
                                                    <label for="borrower_email" class="[% required.email | html %]">Primary email:</label>
650
651
                                                    <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email | html %]" class="[% required.email | html %]" />
652
                                                    <div class="required_label [% required.email | html %]">Required</div>
653
                                                </li>
654
655
                                                [% IF op != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %]
656
                                                    <li>
657
                                                        <label for="borrower_repeat_email" class="[% required.email | html %]">Confirm primary email:</label>
658
659
                                                        <input type="text" id="borrower_repeat_email" name="borrower_repeat_email" autocomplete="off" class="[% required.email | html %]" />
660
                                                        <div class="required_label [% required.email | html %]">Required</div>
661
                                                    </li>
662
                                                [% END %]
663
                                            [% END %]
664
665
                                            [% UNLESS hidden.defined('emailpro') %]
666
                                                <li>
667
                                                    <label for="borrower_emailpro" class="[% required.emailpro | html %]">Secondary email:</label>
668
669
                                                    <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro | html %]" class="[% required.emailpro | html %]" />
670
                                                    <div class="required_label [% required.emailpro | html %]">Required</div>
671
                                                </li>
672
                                            [% END %]
673
674
                                            [% UNLESS hidden.defined('fax') %]
675
                                                <li>
676
                                                    <label for="borrower_fax" class="[% required.fax | html %]">Fax:</label>
677
678
                                                    <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax | html %]" class="[% required.fax | html %]" />
679
                                                    <div class="required_label [% required.fax | html %]">Required</div>
680
                                                </li>
681
                                            [% END %]
682
683
                                            [% UNLESS hidden.defined('primary_contact_method') %]
684
                                                <li>
685
                                                    [% IF ( mandatory.defined('primary_contact_method') ) %]
686
                                                        <label for="borrower_primary_contact_method" class="required">Main contact method:</label>
687
                                                    [% ELSE %]
688
                                                        <label for="borrower_primary_contact_method">Main contact method:</label>
689
                                                    [% END %]
690
691
                                                    <select id="borrower_primary_contact_method" name="borrower_primary_contact_method">
692
                                                        <option value=""></option>
693
                                                        [% UNLESS hidden.defined('phone') %]
694
                                                            [% IF ( borrower.primary_contact_method == 'phone' ) %]
695
                                                                <option value="phone" selected="selected">Primary phone</option>
696
                                                            [% ELSE %]
697
                                                                <option value="phone">Primary phone</option>
698
                                                            [% END %]
699
                                                        [% END %]
700
                                                        [% UNLESS hidden.defined('phonepro') %]
701
                                                            [% IF ( borrower.primary_contact_method == 'phonepro' ) %]
702
                                                                <option value="phonepro" selected="selected">Secondary phone</option>
703
                                                            [% ELSE %]
704
                                                                <option value="phonepro">Secondary phone</option>
705
                                                            [% END %]
706
                                                        [% END %]
707
                                                        [% UNLESS hidden.defined('mobile') %]
708
                                                            [% IF ( borrower.primary_contact_method == 'mobile' ) %]
709
                                                                <option value="mobile" selected="selected">Other phone</option>
710
                                                            [% ELSE %]
711
                                                                <option value="mobile">Other phone</option>
712
                                                            [% END %]
713
                                                        [% END %]
714
                                                        [% UNLESS hidden.defined('email') %]
715
                                                            [% IF ( borrower.primary_contact_method == 'email' ) %]
716
                                                                <option value="email" selected="selected">Primary email</option>
717
                                                            [% ELSE %]
718
                                                                <option value="email">Primary email</option>
719
                                                            [% END %]
720
                                                        [% END %]
721
                                                        [% UNLESS hidden.defined('emailpro') %]
722
                                                            [% IF ( borrower.primary_contact_method == 'emailpro' ) %]
723
                                                                <option value="emailpro" selected="selected">Secondary email</option>
724
                                                            [% ELSE %]
725
                                                                <option value="emailpro">Secondary email</option>
726
                                                            [% END %]
727
                                                        [% END %]
728
                                                        [% UNLESS hidden.defined('fax') %]
729
                                                            [% IF ( borrower.primary_contact_method == 'fax' ) %]
730
                                                                <option value="fax" selected="selected">Fax</option>
731
                                                            [% ELSE %]
732
                                                                <option value="fax">Fax</option>
733
                                                            [% END %]
734
                                                        [% END %]
735
                                                    </select>
736
                                                    [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %]
737
                                                </li>
738
                                                [% UNLESS hidden.defined('lang') %]
739
                                                    <li>
740
                                                        [% IF ( mandatory.defined('lang') ) %]
741
                                                            <label for="borrower_lang" class="required">Preferred language for notices: </label>
742
                                                        [% ELSE %]
743
                                                            <label for="borrower_lang">Preferred language for notices: </label>
744
                                                        [% END %]
745
                                                        <select id="borrower_lang" name="borrower_lang">
746
                                                            <option value="default">Default</option>
747
                                                            [% FOR language IN languages %]
748
                                                                [% FOR sublanguage IN language.sublanguages_loop %]
749
                                                                    [% IF language.plural %]
750
                                                                        [% IF sublanguage.rfc4646_subtag == borrower.lang %]
751
                                                                            <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected"
752
                                                                                >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
753
                                                                            >
754
                                                                        [% ELSE %]
755
                                                                            <option value="[% sublanguage.rfc4646_subtag | html %]"
756
                                                                                >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
757
                                                                            >
758
                                                                        [% END %]
759
                                                                    [% ELSE %]
760
                                                                        [% IF sublanguage.rfc4646_subtag == borrower.lang %]
761
                                                                            <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected"
762
                                                                                >[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option
763
                                                                            >
764
                                                                        [% ELSE %]
765
                                                                            <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option>
766
                                                                        [% END %]
767
                                                                    [% END # /IF language.plural %]
768
                                                                [% END # /FOR sublanguage %]
769
                                                            [% END #/FOR language %]
770
                                                        </select>
771
                                                        <!-- /#lang -->
772
                                                        [% IF ( mandatory.defined('lang') ) %]<div class="required_label required">Required</div>[% END %]
773
                                                    </li>
774
                                                [% END %]
775
                                            [% END %]
776
                                        </ol>
777
                                    </fieldset>
778
                                </div>
779
                                <!-- /.col -->
780
                            </div>
781
                            <!-- /.row -->
782
                        [% END %]
783
784
                        [%# Following on one line for translatability %]
785
                        [% UNLESS hidden.defined('B_streetnumber') && hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') && hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_country') && hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote') %]
786
                            <div class="row">
787
                                <div class="col">
788
                                    <fieldset class="rows" id="memberentry_alternateaddress">
789
                                        <legend id="alternateaddress_legend">Alternate address</legend>
790
791
                                        <ol>
792
                                            [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE B_streetnumber %][% END %]
793
794
                                            [% SET roadtypes = AuthorisedValues.GetAuthValueDropbox('ROADTYPE') %]
795
                                            [% IF roadtypes.count %]
796
                                                [% UNLESS hidden.defined('B_streettype') %]
797
                                                    <li>
798
                                                        <label for="borrower_B_streettype" class="[% required.B_streettype | html %]">Street type:</label>
799
800
                                                        <select name="borrower_B_streettype" name="borrower_B_streettype" class="[% required.B_streettype | html %]">
801
                                                            <option value=""></option>
802
                                                            [% FOR roadtype IN roadtypes %]
803
                                                                [% IF roadtype.authorised_value == patron.streettype %]
804
                                                                    <option value="[% roadtype.authorised_value | html %]" selected="selected">[% roadtype.lib | html %]</option>
805
                                                                [% ELSE %]
806
                                                                    <option value="[% roadtype.authorised_value | html %]">[% roadtype.lib | html %]</option>
807
                                                                [% END %]
808
                                                            [% END %]
809
                                                        </select>
810
                                                        <div class="required_label [% required.B_streettype | html %]">Required</div>
811
                                                    </li>
812
                                                [% END %]
813
                                            [% END %]
814
                                            [% UNLESS hidden.defined('B_address') %]
815
                                                <li>
816
                                                    <label for="borrower_B_address" class="[% required.B_address | html %]">Address:</label>
817
818
                                                    <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address | html %]" class="[% required.B_address | html %]" />
819
                                                    <div class="required_label [% required.B_address | html %]">Required</div>
820
                                                </li>
821
                                            [% END %]
822
823
                                            [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %]
824
825
                                            [% UNLESS hidden.defined('B_address2') %]
826
                                                <li>
827
                                                    <label for="borrower_B_address2" class="[% required.B_address | html %]">Address 2:</label>
828
829
                                                    <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 | html %]" class="[% required.B_address2 | html %]" />
830
                                                    <div class="required_label [% required.B_address2 | html %]">Required</div>
831
                                                </li>
832
                                            [% END %]
833
834
                                            [% UNLESS hidden.defined('B_city') %]
835
                                                <li>
836
                                                    <label for="borrower_B_city" class="[% required.B_city | html %]">City:</label>
837
838
                                                    <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city | html %]" class="[% required.B_city | html %]" />
839
                                                    <div class="required_label [% required.B_city | html %]">Required</div>
840
                                                </li>
841
                                            [% END %]
842
843
                                            [% UNLESS hidden.defined('B_state') %]
844
                                                <li>
845
                                                    <label for="borrower_B_state" class="[% required.B_state | html %]">State:</label>
846
847
                                                    <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state | html %]" class="[% required.B_state | html %]" />
848
                                                    <div class="required_label [% required.B_state | html %]">Required</div>
849
                                                </li>
850
                                            [% END %]
851
852
                                            [% UNLESS hidden.defined('B_zipcode') %]
853
                                                <li>
854
                                                    <label for="borrower_B_zipcode" class="[% required.B_zipcode | html %]">ZIP/Postal code:</label>
855
856
                                                    <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode | html %]" class="[% required.B_zipcode | html %]" />
857
                                                    <div class="required_label [% required.B_zipcode | html %]">Required</div>
858
                                                </li>
859
                                            [% END %]
860
861
                                            [% UNLESS hidden.defined('B_country') %]
862
                                                <li>
863
                                                    <label for="borrower_B_country" class="[% required.B_country | html %]">Country:</label>
864
865
                                                    <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country | html %]" class="[% required.B_country | html %]" />
866
                                                    <div class="required_label [% required.B_country | html %]">Required</div>
867
                                                </li>
868
                                            [% END %]
869
870
                                            [% UNLESS hidden.defined('B_phone') %]
871
                                                <li>
872
                                                    <label for="borrower_B_phone" class="[% required.B_phone | html %]">Phone:</label>
873
874
                                                    <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone | html %]" class="[% required.B_phone | html %]" />
875
                                                    <div class="required_label [% required.B_phone | html %]">Required</div>
876
                                                </li>
877
                                            [% END %]
878
879
                                            [% UNLESS hidden.defined('B_email') %]
880
                                                <li>
881
                                                    <label for="borrower_B_email" class="[% required.B_email | html %]">Email:</label>
882
883
                                                    <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email | html %]" class="[% required.B_email | html %]" />
884
                                                    <div class="required_label [% required.B_email | html %]">Required</div>
885
                                                </li>
886
                                            [% END %]
887
888
                                            [% UNLESS hidden.defined('contactnote') %]
889
                                                <li>
890
                                                    <label for="borrower_contactnote" class="[% required.contactnote | html %]">Contact note:</label>
891
892
                                                    <textarea id="borrower_contactnote" name="borrower_contactnote" cols="30" rows="2" class="[% required.contactnote | html %]">[% borrower.contactnote | html %]</textarea>
893
                                                    <div class="required_label [% required.contactnote | html %]">Required</div>
894
                                                </li>
895
                                            [% END %]
896
                                        </ol>
897
                                    </fieldset>
898
                                </div>
899
                                <!-- /.col -->
900
                            </div>
901
                            <!-- /.row -->
902
                        [% END %]
903
904
                        [%# Following on one line for translatability %]
905
                        [% UNLESS hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') && hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') && hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone') %]
906
                            <div class="row">
907
                                <div class="col">
908
                                    <fieldset class="rows" id="memberentry_alternatecontact">
909
                                        <legend id="alternatecontact_legend">Alternate contact</legend>
910
911
                                        <ol>
912
                                            [% UNLESS hidden.defined('altcontactsurname') %]
913
                                                <li>
914
                                                    <label for="borrower_altcontactsurname" class="[% required.altcontactsurname | html %]">Surname:</label>
915
916
                                                    <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname | html %]" class="[% required.altcontactsurname | html %]" />
917
                                                    <div class="required_label [% required.altcontactsurname | html %]">Required</div>
918
                                                </li>
919
                                            [% END %]
920
921
                                            [% UNLESS hidden.defined('altcontactfirstname') %]
922
                                                <li>
923
                                                    <label for="borrower_altcontactfirstname" class="[% required.altcontactfirstname | html %]">First name:</label>
924
925
                                                    <input
926
                                                        type="text"
927
                                                        id="borrower_altcontactfirstname"
928
                                                        name="borrower_altcontactfirstname"
929
                                                        value="[% borrower.altcontactfirstname | html %]"
930
                                                        class="[% required.altcontactfirstname | html %]"
931
                                                    />
932
                                                    <div class="required_label [% required.altcontactfirstname | html %]">Required</div>
933
                                                </li>
934
                                            [% END %]
935
936
                                            [% UNLESS hidden.defined('altcontactaddress1') %]
937
                                                <li>
938
                                                    <label for="borrower_altcontactaddress1" class="[% required.altcontactaddress1 | html %]">Address:</label>
939
940
                                                    <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 | html %]" class="[% required.altcontactaddress1 | html %]" />
941
                                                    <div class="required_label [% required.altcontactaddress1 | html %]">Required</div>
942
                                                </li>
943
                                            [% END %]
944
945
                                            [% UNLESS hidden.defined('altcontactaddress2') %]
946
                                                <li>
947
                                                    <label for="borrower_altcontactaddress2" class="[% required.altcontactaddress2 | html %]">Address 2:</label>
948
949
                                                    <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 | html %]" class="[% required.altcontactaddress2 | html %]" />
950
                                                    <div class="required_label [% required.altcontactaddress2 | html %]">Required</div>
951
                                                </li>
952
                                            [% END %]
953
954
                                            [% UNLESS hidden.defined('altcontactaddress3') %]
955
                                                <li>
956
                                                    <label for="borrower_altcontactaddress3" class="[% required.altcontactaddress3 | html %]">City:</label>
957
958
                                                    <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 | html %]" class="[% required.altcontactaddress3 | html %]" />
959
                                                    <div class="required_label [% required.altcontactaddress3 | html %]">Required</div>
960
                                                </li>
961
                                            [% END %]
962
963
                                            [% UNLESS hidden.defined('altcontactstate') %]
964
                                                <li>
965
                                                    <label for="borrower_altcontactstate" class="[% required.altcontactstate | html %]">State:</label>
966
967
                                                    <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate | html %]" class="[% required.altcontactstate | html %]" />
968
                                                    <div class="required_label [% required.altcontactstate | html %]">Required</div>
969
                                                </li>
970
                                            [% END %]
971
972
                                            [% UNLESS hidden.defined('altcontactzipcode') %]
973
                                                <li>
974
                                                    <label for="borrower_altcontactzipcode" class="[% required.altcontactzipcode | html %]">ZIP/Postal code:</label>
975
976
                                                    <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode | html %]" class="[% required.altcontactzipcode | html %]" />
977
                                                    <div class="required_label [% required.altcontactzipcode | html %]">Required</div>
978
                                                </li>
979
                                            [% END %]
980
981
                                            [% UNLESS hidden.defined('altcontactcountry') %]
982
                                                <li>
983
                                                    <label for="borrower_altcontactcountry" class="[% required.altcontactcountry | html %]">Country:</label>
984
985
                                                    <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry | html %]" class="[% required.altcontactcountry | html %]" />
986
                                                    <div class="required_label [% required.altcontactcountry | html %]">Required</div>
987
                                                </li>
988
                                            [% END %]
989
990
                                            [% UNLESS hidden.defined('altcontactphone') %]
991
                                                <li>
992
                                                    <label for="borrower_altcontactphone" class="[% required.altcontactphone | html %]">Phone:</label>
993
994
                                                    <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone | html %]" class="[% required.altcontactphone | html %]" />
995
                                                    <div class="required_label [% required.altcontactphone | html %]">Required</div>
996
                                                </li>
997
                                            [% END %]
998
                                        </ol>
999
                                    </fieldset>
1000
                                </div>
1001
                                <!-- /.col -->
1002
                            </div>
1003
                            <!-- /.row -->
1004
                        [% END %]
1005
1006
                        [% UNLESS op == 'edit' || hidden.defined('password') %]
1007
                            <div class="row">
1008
                                <div class="col">
1009
                                    <fieldset class="rows" id="memberentry_password">
1010
                                        <legend id="contact_legend">Password</legend>
1011
                                        <div class="alert alert-info">
1012
                                            [% IF patron %]
1013
                                                [% IF ( patron.category.effective_require_strong_password ) %]
1014
                                                    <p>Your password must contain at least [% patron.category.effective_min_password_length | html %] characters, including UPPERCASE, lowercase and numbers.</p>
1015
                                                [% ELSE %]
1016
                                                    <p>Your password must be at least [% patron.category.effective_min_password_length | html %] characters long.</p>
1017
                                                [% END %]
1018
                                            [% ELSE %]
1019
                                                <p id="password_alert"></p>
1020
                                            [% END %]
1021
                                            [% UNLESS mandatory.defined('password') %]
1022
                                                <p>If you do not enter a password a system generated password will be created.</p>
1023
                                            [% END %]
1024
                                        </div>
1025
1026
                                        <ol>
1027
                                            <li
1028
                                                ><label for="password" class="[% required.password | html %]">Password:</label>
1029
                                                <input type="password" name="borrower_password" id="password" class="[% required.password | html %]" autocomplete="new-password" />
1030
                                                <div class="required_label [% required.password | html %]">Required</div>
1031
                                            </li>
1032
                                            <li
1033
                                                ><label for="password2" class="[% required.password | html %]">Confirm password:</label>
1034
                                                <input type="password" name="borrower_password2" id="password2" autocomplete="new-password" />
1035
                                                <div class="required_label [% required.password | html %]">Required</div>
1036
                                            </li>
1037
                                        </ol>
1038
                                    </fieldset>
1039
                                </div>
1040
                                <!-- /.col -->
1041
                            </div>
1042
                            <!-- /.row -->
1043
                        [% END %]
1044
1045
                        [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size ) %]
1046
                            <div class="row">
1047
                                <div class="col">
1048
                                    [% SET fieldset_id = "" %]
1049
                                    [% SET legend = "Additional information" %]
1050
                                    [% FOREACH pa_class IN patron_attribute_classes %]
1051
                                        [% IF pa_class.class %]
1052
                                            [% fieldset_id = "aai_" _ pa_loo.class %]
1053
                                            [% legend = pa_class.lib %]
1054
                                        [% END %]
1055
                                        <fieldset id="[% fieldset_id | html %]" class="rows patron-attributes">
1056
                                            <legend>[% legend | html %]</legend>
1057
                                            <ol class="attributes_table">
1058
                                                [% FOREACH pa IN pa_class.items %]
1059
                                                    [% FOREACH pa_value IN pa.values %]
1060
                                                        [% IF loop.first %]<a id="patron-attr-start-[% pa.type.code | html %]"></a>[% END %]
1061
                                                        [% form_id = 'patron-attr-' _ Math.int( Math.rand(1000000) ) %]
1062
                                                        <li data-category_code="[% pa.type.category_code | html %]">
1063
                                                            [% IF pa.type.mandatory && pa.type.opac_editable %]
1064
                                                                <label for="[% form_id | html %]" class="required">[% pa.type.description | html %]: </label>
1065
                                                            [% ELSE %]
1066
                                                                <label for="[% form_id | html %]">[% pa.type.description | html %]: </label>
1067
                                                            [% END %]
1068
                                                            [% IF pa.type.opac_editable %]
1069
                                                                <input type="hidden" name="patron_attribute_code" value="[% pa.type.code | html %]" />
1070
                                                                [% IF ( pa.type.authorised_value_category ) %]
1071
                                                                    <select id="[% form_id | html %]" name="patron_attribute_value">
1072
                                                                        <option value=""></option>
1073
                                                                        [% FOREACH auth_val IN AuthorisedValues.Get( pa.type.authorised_value_category, 1 ) %]
1074
                                                                            [% IF ( auth_val.authorised_value == pa_value ) %]
1075
                                                                                <option value="[% auth_val.authorised_value | html %]" selected="selected"> [% auth_val.lib | html %] </option>
1076
                                                                            [% ELSE %]
1077
                                                                                <option value="[% auth_val.authorised_value | html %]"> [% auth_val.lib | html %] </option>
1078
                                                                            [% END %]
1079
                                                                        [% END %]
1080
                                                                    </select>
1081
                                                                [% ELSE %]
1082
                                                                    [% IF ( pa.type.is_date && pa.type.mandatory ) %]
1083
                                                                        <input type="text" id="[% form_id | html %]" name="patron_attribute_value" value="[% pa_value | html %]" size="10" required="required" class="flatpickr" />
1084
                                                                    [% ELSIF ( pa.type.is_date && !pa.type.mandatory ) %]
1085
                                                                        <input type="text" id="[% form_id | html %]" name="patron_attribute_value" value="[% pa_value | html %]" size="10" class="flatpickr" />
1086
                                                                    [% ELSE %]
1087
                                                                        <textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea>
1088
                                                                    [% END %]
1089
                                                                [% END %]
1090
                                                                <div class="attr-control">
1091
                                                                    [% IF ( !pa.type.is_date ) %]
1092
                                                                        <a href="#" class="btn btn-sm btn-link clear-attribute"><i class="fa fa-remove" aria-hidden="true"></i> Clear</a>
1093
                                                                    [% END %]
1094
                                                                    [% IF ( pa.type.repeatable ) %]
1095
                                                                        <a href="#" class="btn btn-sm btn-link clone-attribute"><i class="fa fa-plus" aria-hidden="true"></i> New</a>
1096
                                                                    [% END %]
1097
                                                                    [% IF pa.type.mandatory %]
1098
                                                                        <span class="required_label required">Required</span>
1099
                                                                    [% END %]
1100
                                                                </div>
1101
                                                            [% ELSE %]
1102
                                                                [% IF ( pa.type.authorised_value_category ) %]
1103
                                                                    [% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %]
1104
                                                                [% ELSIF ( pa.type.is_date ) %]
1105
                                                                    [% pa_value | $KohaDates %]
1106
                                                                [% ELSE %]
1107
                                                                    [% pa_value | html_line_break %]
1108
                                                                [% END %]
1109
                                                            [% END %]
1110
                                                        </li>
1111
                                                    [% END %]
1112
                                                [% END %]
1113
                                            </ol>
1114
                                        </fieldset>
1115
                                    [% END %]
1116
                                </div>
1117
                                <!-- /.col -->
1118
                            </div>
1119
                            <!-- /.row -->
1120
                        [% END %]
1121
1122
                        [% IF Koha.Preference('PrivacyPolicyConsent') && op != 'edit' %]
1123
                            <div class="row">
1124
                                <div class="col">
1125
                                    <fieldset class="rows" id="memberentry_gdpr_consent">
1126
                                        <legend>Data privacy policy consent</legend>
1127
                                        <ol>
1128
                                            <li>
1129
                                                <div class="label"></div>
1130
                                                <label class="checkbox-label" for="borrower_gdpr_proc_consent">
1131
                                                    <input type="checkbox" name="borrower_gdpr_proc_consent" id="borrower_gdpr_proc_consent" class="required" value="agreed" />
1132
                                                    <span>I agree with your processing of my personal data as outlined in the <a target="_blank" href="[% Koha.Preference('PrivacyPolicyURL') | url %]">privacy policy</a>.</span>
1133
                                                </label>
1134
                                                <label class="error" for="borrower_gdpr_proc_consent" style="display: none;"></label>
1135
                                                <div class="required_label required">Required</div>
1136
                                            </li>
1137
                                        </ol>
1138
                                    </fieldset>
1139
                                </div>
1140
                                <!-- /.col -->
1141
                            </div>
1142
                            <!-- /.row -->
1143
                        [% END %]
1144
1145
                        [% UNLESS op == 'edit' %]
1146
                            <div class="row">
1147
                                <div class="col">
1148
                                    <fieldset class="rows" id="memberentry_captcha">
1149
                                        <legend>Verification</legend>
1150
                                        <ol>
1151
                                            <li>
1152
                                                <label for="captcha" class="required">Verification:</label>
1153
1154
                                                <input type="text" name="captcha" id="captcha" style="text-transform: uppercase;" />
1155
                                                <div class="required_label required">Required</div>
1156
                                                <input type="hidden" name="captcha_digest" value="[% captcha_digest | html %]" />
1157
1158
                                                <span class="hint">Please type the following characters into the preceding box: <strong>[% captcha | html %]</strong></span>
1159
                                            </li>
1160
                                        </ol>
1161
                                    </fieldset>
1162
                                </div>
1163
                                <!-- /.col -->
1164
                            </div>
1165
                            <!-- /.row -->
1166
                        [% END %]
1167
1168
                        <div class="row">
1169
                            <div class="col">
1170
                                [% IF op == 'edit' %]
1171
                                    [% IF OPACPatronDetails %]
1172
                                        <fieldset class="action">
1173
                                            <input type="hidden" name="op" value="cud-update" />
1174
                                            <input type="submit" class="btn btn-primary" value="Submit update request" />
1175
                                        </fieldset>
1176
                                    [% END %]
1177
                                [% ELSE %]
1178
                                    <fieldset class="action">
1179
                                        <input type="hidden" name="op" value="cud-create" />
1180
                                        <input type="submit" class="btn btn-primary" value="Submit" />
1181
                                    </fieldset>
1182
                                [% END %]
1183
                            </div>
1184
                            <!-- /.col -->
1185
                        </div>
1186
                        <!-- /.row -->
1187
                    </form> </div
1188
                ><!--/div#update-account -->
1189
            </div>
1190
        </div>
1191
    </div>
1192
</div>
1193
1194
[% INCLUDE 'opac-bottom.inc' %]
1195
[% BLOCK jsinclude %]
1196
    [% INCLUDE 'validator-strings.inc' %]
1197
    [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
1198
    [% INCLUDE 'calendar.inc' %]
1199
    <script>
1200
        $(document).ready(function() {
1201
                [% IF op == 'edit' && !OPACPatronDetails %]
1202
                    $("#memberentry-form :input").attr('readonly', true);
1203
                    $("#borrower_branchcode").attr('disabled',true);
1204
                    $("#borrower_title").attr('disabled',true);
1205
                    $('#memberentry-form :radio').attr('disabled',true);
1206
                    $('span.required').remove();
1207
                    $('label.required').removeClass('required');
1208
                [% END %]
1209
1210
                $("#memberentry-form").validate({
1211
                    rules: {
1212
                        borrower_email: {
1213
                            email: true
1214
                        },
1215
                        borrower_repeat_email: {
1216
                            equalTo: '#borrower_email'
1217
                        },
1218
                        borrower_emailpro: {
1219
                            email: true
1220
                        },
1221
                        borrower_B_email: {
1222
                            email: true
1223
                        },
1224
                        borrower_password: {
1225
                            password_strong: true,
1226
                            password_no_spaces: true
1227
                        },
1228
                        borrower_password2: {
1229
                            password_match: true
1230
                        },
1231
                        captcha: {
1232
                            required: true,
1233
                        }
1234
                    },
1235
                    submitHandler: function(form) {
1236
                        if (form.beenSubmitted) {
1237
                            return false;
1238
                        }
1239
                        else {
1240
                            form.beenSubmitted = true;
1241
                            form.submit();
1242
                        }
1243
                    }
1244
                });
1245
1246
                if ( $("input.required").length ) {
1247
                    $("input.required").rules("add", {
1248
                        required: true
1249
                    });
1250
                }
1251
                if ( $("select.required").length ) {
1252
                    $("select.required").rules("add", {
1253
                        required: true
1254
                    });
1255
                }
1256
                if ( $("textarea.required").length ) {
1257
                    $("textarea.required").rules("add", {
1258
                        required: true
1259
                    });
1260
                }
1261
1262
                [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') %]
1263
1264
                    [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
1265
                        $('#update_privacy_guarantor_checkouts').click( function() {
1266
                            var can_see_checkouts = $('#privacy_guarantor_checkouts').val() == 1;
1267
                            $.ajax({
1268
                                url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_checkouts",
1269
                                type: "PUT",
1270
                                data: JSON.stringify({
1271
                                    allowed: can_see_checkouts
1272
                                }),
1273
                                contentType: "application/json",
1274
                                success: function () {
1275
                                    $('#update_privacy_guarantor_checkouts_message')
1276
                                        .fadeIn("slow")
1277
                                        .text(_("Your setting has been updated!"))
1278
                                        .delay(5000)
1279
                                        .fadeOut("slow");
1280
                                },
1281
                                error: function () {
1282
                                    $('#update_privacy_guarantor_checkouts_message')
1283
                                        .fadeIn("slow")
1284
                                        .text(_("Unable to update your setting!"))
1285
                                        .delay(5000)
1286
                                        .fadeOut("slow");
1287
                                }
1288
                            });
1289
                        });
1290
                    [% END %]
1291
1292
                    [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
1293
                        $('#update_privacy_guarantor_fines').click( function() {
1294
                            var can_see_charges = $('#privacy_guarantor_fines').val() == 1;
1295
                            $.ajax({
1296
                                url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_charges",
1297
                                type: 'PUT',
1298
                                data: JSON.stringify({
1299
                                    allowed: can_see_charges
1300
                                }),
1301
                                contentType: 'application/json',
1302
                                success: function() {
1303
                                    $('#update_privacy_guarantor_fines_message')
1304
                                        .fadeIn("slow")
1305
                                        .text( _("Your setting has been updated!") )
1306
                                        .delay( 5000 )
1307
                                        .fadeOut("slow");
1308
                                },
1309
                                error: function() {
1310
                                    $('#update_privacy_guarantor_fines_message')
1311
                                        .fadeIn("slow")
1312
                                        .text( _("Unable to update your setting!") )
1313
                                        .delay( 5000 )
1314
                                        .fadeOut("slow");
1315
                                }
1316
                            });
1317
                        });
1318
                    [% END %]
1319
                [% END %]
1320
1321
                $(".patron-attributes").on( 'click', '.clear-attribute', function(e) {
1322
                    e.preventDefault();
1323
                    $(this).closest("li")
1324
                        .find('textarea').val("").end()
1325
                        .find('select').val("").end();
1326
                } );
1327
1328
                $(".patron-attributes").on( 'click', '.clone-attribute', function() {
1329
                    let li = $(this).closest("li");
1330
                    var clone = li.clone().insertAfter( li );
1331
1332
                    var newId = 50 + parseInt(Math.random() * 100000);
1333
                    $('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', '');
1334
                    $("label", clone).attr('for', 'patron-attr-' + newId).attr('value', '');
1335
1336
                    return false;
1337
                } );
1338
            });
1339
1340
        [% IF op != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %]
1341
            $("#borrower_email").bind("cut copy paste", function(e){
1342
                e.preventDefault();
1343
                $("#borrower_email").bind("contextmenu", function(e){
1344
                    e.preventDefault();
1345
                });
1346
            });
1347
            $("#borrower_repeat_email").bind("cut copy paste", function(e){
1348
                e.preventDefault();
1349
                $("#borrower_repeat_email").bind("contextmenu", function(e){
1350
                    e.preventDefault();
1351
                });
1352
            });
1353
        [% END %]
1354
1355
        [% UNLESS patron %]
1356
            var PWD_STRONG_MSG = _("Password must contain at least %s characters, including UPPERCASE, lowercase and numbers");
1357
            var PWD_WEAK_MSG = _("Password must contain at least %s characters");
1358
            var default_password_length = [% defaultCategory.effective_min_password_length | html %];
1359
            var default_strong_password = [% defaultCategory.effective_require_strong_password ? defaultCategory.effective_require_strong_password : 0 | html %];
1360
            $(document).ready(function() {
1361
                var setPwdMessage = function() {
1362
                    var require_strong = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdStrong') : default_strong_password;
1363
                    var min_length = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdLength') : default_password_length;
1364
                    $('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_length));
1365
                };
1366
                setPwdMessage();
1367
                $('select#borrower_categorycode').change(setPwdMessage);
1368
            });
1369
        [% END %]
1370
    </script>
1371
    [% PROCESS 'password_check.inc' new_password => 'borrower_password', category_selector => '#borrower_categorycode', RequireStrongPassword => patron ? patron.category.effective_require_strong_password : defaultCategory.effective_require_strong_password, minPasswordLength => patron ? patron.category.effective_min_password_length : defaultCategory.effective_min_password_length %]
1372
[% END %]
(-)a/members/memberentry.pl (-3 / +2 lines)
Lines 297-304 foreach my $guarantor (@guarantors) { Link Here
297
    if (   ( $op eq 'cud-save' || $op eq 'cud-insert' )
297
    if (   ( $op eq 'cud-save' || $op eq 'cud-insert' )
298
        && ( $guarantor->is_child || $guarantor->is_guarantee || ( $patron && $patron->is_guarantor ) ) )
298
        && ( $guarantor->is_child || $guarantor->is_guarantee || ( $patron && $patron->is_guarantor ) ) )
299
    {
299
    {
300
        push @errors, 'ERROR_child_is_guarantor'     if ( $guarantor->is_child );
300
        push @errors, 'ERROR_guarantor_is_guarantee';
301
        push @errors, 'ERROR_guarantor_is_guarantee' if ( !$guarantor->is_child );
302
    }
301
    }
303
}
302
}
304
303
Lines 986-992 sub patron_attributes_form { Link Here
986
            description   => $attr_type->description(),
985
            description   => $attr_type->description(),
987
            repeatable    => $attr_type->repeatable(),
986
            repeatable    => $attr_type->repeatable(),
988
            category      => $attr_type->authorised_value_category(),
987
            category      => $attr_type->authorised_value_category(),
989
            category_code => $attr_type->category_code(),
988
            categorycodes => [ map { $_->categorycode } $attr_type->categories->as_list ],
990
            mandatory     => $attr_type->mandatory(),
989
            mandatory     => $attr_type->mandatory(),
991
            is_date       => $attr_type->is_date(),
990
            is_date       => $attr_type->is_date(),
992
        };
991
        };
(-)a/reports/borrowers_stats.pl (-6 / +5 lines)
Lines 506-517 sub patron_attributes_form { Link Here
506
506
507
        # TODO The following can be simplified easily
507
        # TODO The following can be simplified easily
508
        my $entry = {
508
        my $entry = {
509
            class         => $attr_type->class(),
509
            class       => $attr_type->class(),
510
            code          => $attr_type->code(),
510
            code        => $attr_type->code(),
511
            description   => $attr_type->description(),
511
            description => $attr_type->description(),
512
            repeatable    => $attr_type->repeatable(),
512
            repeatable  => $attr_type->repeatable(),
513
            category      => $attr_type->authorised_value_category(),
513
            category    => $attr_type->authorised_value_category(),
514
            category_code => $attr_type->category_code(),
515
        };
514
        };
516
515
517
        my $newentry = {%$entry};
516
        my $newentry = {%$entry};
(-)a/t/db_dependent/Auth_with_ldap.t (-3 lines)
Lines 94-106 my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; Link Here
94
my $attr_type    = $builder->build(
94
my $attr_type    = $builder->build(
95
    {
95
    {
96
        source => 'BorrowerAttributeType',
96
        source => 'BorrowerAttributeType',
97
        value  => { category_code => $categorycode }
98
    }
97
    }
99
);
98
);
100
my $attr_type2 = $builder->build(
99
my $attr_type2 = $builder->build(
101
    {
100
    {
102
        source => 'BorrowerAttributeType',
101
        source => 'BorrowerAttributeType',
103
        value  => { category_code => $categorycode }
104
    }
102
    }
105
);
103
);
106
104
Lines 708-711 sub is_admin_bind { Link Here
708
}
706
}
709
707
710
$schema->storage->txn_rollback();
708
$schema->storage->txn_rollback();
711
(-)a/t/db_dependent/Koha/Patron/Attribute.t (-5 / +4 lines)
Lines 328-338 subtest 'store() tests' => sub { Link Here
328
            {
328
            {
329
                class => 'Koha::Patron::Attribute::Types',
329
                class => 'Koha::Patron::Attribute::Types',
330
                value => {
330
                value => {
331
                    mandatory     => 0,
331
                    mandatory  => 0,
332
                    repeatable    => 0,
332
                    repeatable => 0,
333
                    unique_id     => 1,
333
                    unique_id  => 1,
334
                    is_date       => 0,
334
                    is_date    => 0,
335
                    category_code => undef
336
                }
335
                }
337
            }
336
            }
338
        );
337
        );
(-)a/t/db_dependent/Koha/Patron/Attribute/Type.t (+37 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
5
use Test::More;
6
use Koha::Database;
7
use t::lib::TestBuilder;
8
9
plan tests => 2;
10
11
my $schema  = Koha::Database->new->schema;
12
my $builder = t::lib::TestBuilder->new;
13
14
use_ok('Koha::Patron::Attribute::Type');
15
16
subtest 'categories' => sub {
17
    plan tests => 1;
18
19
    $schema->storage->txn_begin;
20
21
    my $category1 = $builder->build_object( { class => 'Koha::Patron::Categories' } );
22
    my $category2 = $builder->build_object( { class => 'Koha::Patron::Categories' } );
23
    Koha::Patron::Attribute::Types->delete();
24
    my $attribute_type = Koha::Patron::Attribute::Type->new(
25
        {
26
            code        => 'TEST',
27
            description => 'Test attribute type',
28
        }
29
    );
30
    $attribute_type->store();
31
    $attribute_type->categories( [ $category1, $category2 ] );
32
    $attribute_type->store();
33
    my @categories = $attribute_type->categories->as_list;
34
    is( scalar @categories, 2 );
35
36
    $schema->storage->txn_rollback;
37
};
(-)a/t/db_dependent/Koha/Patron/Attribute/Types.t (-8 / +4 lines)
Lines 55-68 subtest 'new() tests' => sub { Link Here
55
        1, 'Only one object created'
55
        1, 'Only one object created'
56
    );
56
    );
57
57
58
    my $cateogory_code = $builder->build( { source => 'Category' } )->{categorycode};
58
    my $attribute_type_2 = Koha::Patron::Attribute::Type->new(
59
60
    my $attribute_type_with_category = Koha::Patron::Attribute::Type->new(
61
        {
59
        {
62
            code          => 'code_2',
60
            code        => 'code_2',
63
            description   => 'description',
61
            description => 'description',
64
            category_code => $cateogory_code,
62
            repeatable  => 0
65
            repeatable    => 0
66
        }
63
        }
67
    )->store();
64
    )->store();
68
65
Lines 464-467 subtest 'search_with_library_limits() tests' => sub { Link Here
464
461
465
    $schema->storage->txn_rollback;
462
    $schema->storage->txn_rollback;
466
};
463
};
467
(-)a/t/db_dependent/api/v1/patrons.t (-8 / +6 lines)
Lines 626-635 subtest 'add() tests' => sub { Link Here
626
                {
626
                {
627
                    class => 'Koha::Patron::Attribute::Types',
627
                    class => 'Koha::Patron::Attribute::Types',
628
                    value => {
628
                    value => {
629
                        mandatory     => 0,
629
                        mandatory  => 0,
630
                        repeatable    => 1,
630
                        repeatable => 1,
631
                        unique_id     => 0,
631
                        unique_id  => 0,
632
                        category_code => 'ST'
633
                    }
632
                    }
634
                }
633
                }
635
            );
634
            );
Lines 637-646 subtest 'add() tests' => sub { Link Here
637
                {
636
                {
638
                    class => 'Koha::Patron::Attribute::Types',
637
                    class => 'Koha::Patron::Attribute::Types',
639
                    value => {
638
                    value => {
640
                        mandatory     => 0,
639
                        mandatory  => 0,
641
                        repeatable    => 1,
640
                        repeatable => 1,
642
                        unique_id     => 0,
641
                        unique_id  => 0,
643
                        category_code => 'ST'
644
                    }
642
                    }
645
                }
643
                }
646
            );
644
            );
(-)a/t/db_dependent/api/v1/patrons_extended_attributes.t (-36 / +27 lines)
Lines 115-124 subtest 'add() tests' => sub { Link Here
115
        {
115
        {
116
            class => 'Koha::Patron::Attribute::Types',
116
            class => 'Koha::Patron::Attribute::Types',
117
            value => {
117
            value => {
118
                mandatory     => 1,
118
                mandatory  => 1,
119
                repeatable    => 0,
119
                repeatable => 0,
120
                unique_id     => 0,
120
                unique_id  => 0,
121
                category_code => undef
122
            }
121
            }
123
        }
122
        }
124
    );
123
    );
Lines 126-135 subtest 'add() tests' => sub { Link Here
126
        {
125
        {
127
            class => 'Koha::Patron::Attribute::Types',
126
            class => 'Koha::Patron::Attribute::Types',
128
            value => {
127
            value => {
129
                mandatory     => 0,
128
                mandatory  => 0,
130
                repeatable    => 1,
129
                repeatable => 1,
131
                unique_id     => 0,
130
                unique_id  => 0,
132
                category_code => undef
133
            }
131
            }
134
        }
132
        }
135
    );
133
    );
Lines 137-146 subtest 'add() tests' => sub { Link Here
137
        {
135
        {
138
            class => 'Koha::Patron::Attribute::Types',
136
            class => 'Koha::Patron::Attribute::Types',
139
            value => {
137
            value => {
140
                mandatory     => 0,
138
                mandatory  => 0,
141
                repeatable    => 0,
139
                repeatable => 0,
142
                unique_id     => 1,
140
                unique_id  => 1,
143
                category_code => undef
144
            }
141
            }
145
        }
142
        }
146
    );
143
    );
Lines 238-247 subtest 'overwrite() tests' => sub { Link Here
238
        {
235
        {
239
            class => 'Koha::Patron::Attribute::Types',
236
            class => 'Koha::Patron::Attribute::Types',
240
            value => {
237
            value => {
241
                mandatory     => 1,
238
                mandatory  => 1,
242
                repeatable    => 0,
239
                repeatable => 0,
243
                unique_id     => 0,
240
                unique_id  => 0,
244
                category_code => undef
245
            }
241
            }
246
        }
242
        }
247
    );
243
    );
Lines 249-258 subtest 'overwrite() tests' => sub { Link Here
249
        {
245
        {
250
            class => 'Koha::Patron::Attribute::Types',
246
            class => 'Koha::Patron::Attribute::Types',
251
            value => {
247
            value => {
252
                mandatory     => 0,
248
                mandatory  => 0,
253
                repeatable    => 1,
249
                repeatable => 1,
254
                unique_id     => 0,
250
                unique_id  => 0,
255
                category_code => undef
256
            }
251
            }
257
        }
252
        }
258
    );
253
    );
Lines 260-269 subtest 'overwrite() tests' => sub { Link Here
260
        {
255
        {
261
            class => 'Koha::Patron::Attribute::Types',
256
            class => 'Koha::Patron::Attribute::Types',
262
            value => {
257
            value => {
263
                mandatory     => 0,
258
                mandatory  => 0,
264
                repeatable    => 0,
259
                repeatable => 0,
265
                unique_id     => 1,
260
                unique_id  => 1,
266
                category_code => undef
267
            }
261
            }
268
        }
262
        }
269
    );
263
    );
Lines 380-389 subtest 'delete() tests' => sub { Link Here
380
        {
374
        {
381
            class => 'Koha::Patron::Attribute::Types',
375
            class => 'Koha::Patron::Attribute::Types',
382
            value => {
376
            value => {
383
                mandatory     => 0,
377
                mandatory  => 0,
384
                repeatable    => 1,
378
                repeatable => 1,
385
                unique_id     => 0,
379
                unique_id  => 0,
386
                category_code => undef
387
            }
380
            }
388
        }
381
        }
389
    );
382
    );
Lines 426-435 subtest 'update() tests' => sub { Link Here
426
        {
419
        {
427
            class => 'Koha::Patron::Attribute::Types',
420
            class => 'Koha::Patron::Attribute::Types',
428
            value => {
421
            value => {
429
                mandatory     => 0,
422
                mandatory  => 0,
430
                repeatable    => 1,
423
                repeatable => 1,
431
                unique_id     => 0,
424
                unique_id  => 0,
432
                category_code => undef
433
            }
425
            }
434
        }
426
        }
435
    );
427
    );
Lines 437-446 subtest 'update() tests' => sub { Link Here
437
        {
429
        {
438
            class => 'Koha::Patron::Attribute::Types',
430
            class => 'Koha::Patron::Attribute::Types',
439
            value => {
431
            value => {
440
                mandatory     => 0,
432
                mandatory  => 0,
441
                repeatable    => 0,
433
                repeatable => 0,
442
                unique_id     => 1,
434
                unique_id  => 1,
443
                category_code => undef
444
            }
435
            }
445
        }
436
        }
446
    );
437
    );
(-)a/tools/modborrowers.pl (-8 / +8 lines)
Lines 38-44 use Koha::Libraries; Link Here
38
use Koha::Patron::Categories;
38
use Koha::Patron::Categories;
39
use Koha::Patron::Debarments qw( AddDebarment DelDebarment );
39
use Koha::Patron::Debarments qw( AddDebarment DelDebarment );
40
use Koha::Patrons;
40
use Koha::Patrons;
41
use List::MoreUtils qw(uniq);
41
use List::MoreUtils qw(uniq none);
42
use Koha::Patron::Messages;
42
use Koha::Patron::Messages;
43
43
44
my $input = CGI->new;
44
my $input = CGI->new;
Lines 164-173 if ( $op eq 'cud-show' || $op eq 'show' ) { Link Here
164
            options        => $options,
164
            options        => $options,
165
            };
165
            };
166
166
167
        my $category_code = $attr_type->category_code;
167
        my @categories = $attr_type->categories->as_list;
168
        my ($category_lib) =
168
        my ($category_lib) = join( ', ', map { $_->description } @categories );
169
            map { ( defined $category_code and $attr_type->category_code eq $_->categorycode ) ? $_->description : () }
170
            @patron_categories;
171
        push @patron_attributes_codes,
169
        push @patron_attributes_codes,
172
            {
170
            {
173
            attribute_code => $attr_type->code,
171
            attribute_code => $attr_type->code,
Lines 433-440 if ( $op eq 'cud-do' ) { Link Here
433
431
434
            next unless $attr_type;
432
            next unless $attr_type;
435
433
436
            # If this borrower is not in the category of this attribute, we don't want to modify this attribute
434
            # If this borrower is not in one of the categories of this attribute, we don't want to modify this attribute
437
            next if $attr_type->category_code and $attr_type->category_code ne $patron->categorycode;
435
            my @attr_type_categories = $attr_type->categories->as_list;
436
            if (@attr_type_categories) {
437
                next if none { $patron->categorycode eq $_->categorycode } @attr_type_categories;
438
            }
438
439
439
            if ( $attributes->{$code}->{disabled} ) {
440
            if ( $attributes->{$code}->{disabled} ) {
440
441
441
- 

Return to bug 26573