Bugzilla – Attachment 178171 Details for
Bug 26573
Limit patron attribute types to more than one patron category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26573: Limit patron attribute types to more than one patron category
Bug-26573-Limit-patron-attribute-types-to-more-tha.patch (text/plain), 352.37 KB, created by
Martin Renvoize (ashimema)
on 2025-02-18 11:16:03 UTC
(
hide
)
Description:
Bug 26573: Limit patron attribute types to more than one patron category
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-02-18 11:16:03 UTC
Size:
352.37 KB
patch
obsolete
>From ef307c24088e3127a14dd0dfd6d181d64aed4af3 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 26 Aug 2022 11:25:24 +0200 >Subject: [PATCH] Bug 26573: Limit patron attribute types to more than one > patron category > >Test plan: >1. Create patron attribute types, some with a category limit, some > without >2. Apply patch >3. Run installer/data/mysql/updatedatabase.pl >4. Run misc/devel/update_dbix_class_files.pl --koha-conf >5. Restart koha >6. Verify that existing category limits were kept >7. Create a new patron attribute type and select multiple category > limits. Verify that they have been saved correctly. >8. Edit this patron attribute type and modify category limits. Verify > that the changes have been saved correctly >9. Go to the patron creation form, and verify that patron attributes are > shown/hidden accordingly when categorycode is changed. >10. Go to patron batch modification tool, enter a cardnumber (or a > borrowernumber) and submit the form to go to the next step. > Now select a patron attribute type that has category limits and > verify that the message shown to the right is correct > >Signed-off-by: Aude Charillon <aude-charillon@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Patron.pm | 8 +- > Koha/Patron/Attribute/Type.pm | 22 + > admin/patron-attr-types.pl | 6 +- > .../data/mysql/atomicupdate/bug-26573.pl | 54 + > installer/data/mysql/kohastructure.sql | 25 +- > .../en/modules/admin/patron-attr-types.tt | 458 ---- > .../prog/en/modules/members/memberentrygen.tt | 1996 ----------------- > .../en/modules/reports/borrowers_stats.tt | 331 --- > .../prog/en/modules/tools/modborrowers.tt | 652 ------ > koha-tmpl/intranet-tmpl/prog/js/members.js | 2 +- > .../bootstrap/en/modules/opac-memberentry.tt | 1372 ----------- > members/memberentry.pl | 5 +- > reports/borrowers_stats.pl | 11 +- > t/db_dependent/Auth_with_ldap.t | 3 - > t/db_dependent/Koha/Patron/Attribute.t | 9 +- > t/db_dependent/Koha/Patron/Attribute/Type.t | 37 + > t/db_dependent/Koha/Patron/Attribute/Types.t | 12 +- > t/db_dependent/api/v1/patrons.t | 14 +- > .../api/v1/patrons_extended_attributes.t | 63 +- > tools/modborrowers.pl | 15 +- > 20 files changed, 198 insertions(+), 4897 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-26573.pl > create mode 100755 t/db_dependent/Koha/Patron/Attribute/Type.t > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index ec7f6704983..3552db2f542 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -2272,9 +2272,9 @@ sub extended_attributes { > # Check globally mandatory types > my $interface = C4::Context->interface; > my $params = { >- mandatory => 1, >- category_code => [ undef, $self->categorycode ], >- 'borrower_attribute_types_branches.b_branchcode' => undef, >+ mandatory => 1, >+ 'borrower_attribute_types_categories.categorycode' => [ undef, $self->categorycode ], >+ 'borrower_attribute_types_branches.b_branchcode' => undef, > }; > > if ( $interface eq 'opac' ) { >@@ -2283,7 +2283,7 @@ sub extended_attributes { > > my @required_attribute_types = Koha::Patron::Attribute::Types->search( > $params, >- { join => 'borrower_attribute_types_branches' } >+ { join => [ 'borrower_attribute_types_branches', 'borrower_attribute_types_categories' ] } > )->get_column('code'); > for my $type (@required_attribute_types) { > Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw( >diff --git a/Koha/Patron/Attribute/Type.pm b/Koha/Patron/Attribute/Type.pm >index 75caa255d00..67eda5d6a9f 100644 >--- a/Koha/Patron/Attribute/Type.pm >+++ b/Koha/Patron/Attribute/Type.pm >@@ -60,6 +60,28 @@ sub attributes { > Koha::Patron::Attributes->_new_from_dbic($attributes_rs); > } > >+=head3 categories >+ >+Get or set attribute type's categories >+ >+ my @categories = $attribute_type->categories->as_list; >+ $attribute_type->categories(\@categories); >+ >+=cut >+ >+sub categories { >+ my ( $self, $categories ) = @_; >+ >+ if ($categories) { >+ my @categorycodes = map { $_->_result } @$categories; >+ $self->_result->set_categorycodes( \@categorycodes ); >+ return $self; >+ } >+ >+ my $rs = $self->_result->categorycodes; >+ return Koha::Patron::Categories->_new_from_dbic($rs); >+} >+ > =head2 Internal Methods > > =cut >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index 9b771b1ae3e..03e8b601ef5 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -118,7 +118,6 @@ sub add_update_attribute_type { > my $mandatory = $input->param('mandatory') ? 1 : 0; > my $authorised_value_category = $input->param('authorised_value_category'); > my $display_checkout = $input->param('display_checkout') ? 1 : 0; >- my $category_code = $input->param('category_code') || undef; > my $class = $input->param('class'); > > my $attr_type = Koha::Patron::Attribute::Types->find($code); >@@ -154,7 +153,6 @@ sub add_update_attribute_type { > mandatory => $mandatory, > authorised_value_category => $authorised_value_category, > display_checkout => $display_checkout, >- category_code => $category_code, > class => $class, > } > )->store; >@@ -162,6 +160,9 @@ sub add_update_attribute_type { > my @branches = grep { !/^\s*$/ } $input->multi_param('branches'); > $attr_type->library_limits( \@branches ); > >+ my @categories = grep { !/^\s*$/ } $input->multi_param('category_code'); >+ $attr_type->categories( [ Koha::Patron::Categories->search( { categorycode => \@categories } )->as_list ] ); >+ > if ( $op eq 'edit' ) { > $template->param( edited_attribute_type => $attr_type->code() ); > } else { >@@ -235,6 +236,7 @@ sub edit_attribute_type_form { > $can_be_set_to_unique = 0 if $@; > $attr_type->unique_id(0); > } >+ > $template->param( > attribute_type => $attr_type, > attribute_type_form => 1, >diff --git a/installer/data/mysql/atomicupdate/bug-26573.pl b/installer/data/mysql/atomicupdate/bug-26573.pl >new file mode 100755 >index 00000000000..b081280d551 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-26573.pl >@@ -0,0 +1,54 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => '26573', >+ description => 'Add table borrower_attribute_types_categories', >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ CREATE TABLE IF NOT EXISTS `borrower_attribute_types_categories` ( >+ `borrower_attribute_type_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, >+ `categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, >+ KEY `borrower_attribute_type_code` (`borrower_attribute_type_code`), >+ KEY `categorycode` (`categorycode`), >+ 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, >+ CONSTRAINT `borrower_attribute_types_categories_categorycode` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE, >+ PRIMARY KEY (`borrower_attribute_type_code`, `categorycode`) >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ } >+ ); >+ >+ say $out "Table 'borrower_attribute_types_categories' created"; >+ >+ if ( column_exists( 'borrower_attribute_types', 'category_code' ) ) { >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO borrower_attribute_types_categories (borrower_attribute_type_code, categorycode) >+ SELECT `code`, `category_code` FROM `borrower_attribute_types` >+ WHERE `category_code` IS NOT NULL >+ } >+ ); >+ >+ say $out >+ "Data migrated from 'borrower_attribute_types.category_code' to 'borrower_attribute_types_categories'"; >+ >+ $dbh->do( >+ q{ >+ ALTER TABLE `borrower_attribute_types` >+ DROP FOREIGN KEY `borrower_attribute_types_ibfk_1` >+ } >+ ); >+ $dbh->do( >+ q{ >+ ALTER TABLE `borrower_attribute_types` >+ DROP COLUMN `category_code` >+ } >+ ); >+ >+ say $out "Column 'borrower_attribute_types.category_code' deleted"; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 3bf15c1007d..e21ee8a756e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1257,14 +1257,11 @@ CREATE TABLE `borrower_attribute_types` ( > `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)', > `authorised_value_category` varchar(32) DEFAULT NULL COMMENT 'foreign key from authorised_values that links this custom field to an authorized value category', > `display_checkout` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field displays in checkout screens', >- `category_code` varchar(10) DEFAULT NULL COMMENT 'defines a category for an attribute_type', > `class` varchar(255) NOT NULL DEFAULT '' COMMENT 'defines a class for an attribute_type', > `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)', > `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not', > PRIMARY KEY (`code`), >- KEY `auth_val_cat_idx` (`authorised_value_category`), >- KEY `category_code` (`category_code`), >- CONSTRAINT `borrower_attribute_types_ibfk_1` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`) >+ KEY `auth_val_cat_idx` (`authorised_value_category`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >@@ -1285,6 +1282,24 @@ CREATE TABLE `borrower_attribute_types_branches` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `borrower_attribute_types_categories` >+-- >+ >+DROP TABLE IF EXISTS `borrower_attribute_types_categories`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `borrower_attribute_types_categories` ( >+ `borrower_attribute_type_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, >+ `categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, >+ KEY `borrower_attribute_type_code` (`borrower_attribute_type_code`), >+ KEY `categorycode` (`categorycode`), >+ 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, >+ CONSTRAINT `borrower_attribute_types_categories_categorycode` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`) ON DELETE CASCADE ON UPDATE CASCADE, >+ PRIMARY KEY (`borrower_attribute_type_code`, `categorycode`) >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+ > -- > -- Table structure for table `borrower_attributes` > -- >@@ -6755,4 +6770,4 @@ CREATE TABLE `zebraqueue` ( > /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; > /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; > >--- Dump completed on 2024-11-25 12:13:27 >+-- Dump completed on 2024-11-25 12:13:27 >\ No newline at end of file >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >index 2b916c26917..e69de29bb2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >@@ -1,458 +0,0 @@ >-[% USE raw %] >-[% USE Asset %] >-[% USE Koha %] >-[% USE AuthorisedValues %] >-[% USE Branches %] >-[% USE scalar %] >-[% PROCESS 'i18n.inc' %] >-[% SET footerjs = 1 %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title >- >[% FILTER collapse %] >- [% IF ( attribute_type_form ) %] >- [% IF ( edit_attribute_type ) %] >- [% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %] >- › >- [% ELSE %] >- [% t("New patron attribute type") | html %] >- › >- [% END %] >- [% END %] >- [% IF ( delete_attribute_type_form ) %] >- [% tx("Confirm deletion of patron attribute type '{code}'", { code = code }) | html %] >- › >- [% END %] >- [% t("Patron attribute types") | html %] >- › [% t("Administration") | html %] › [% t("Koha") | html %] >- [% END %]</title >-> >-[% INCLUDE 'doc-head-close.inc' %] >-</head> >- >-<body id="admin_patron-attr-types" class="admin"> >-[% WRAPPER 'header.inc' %] >- [% INCLUDE 'prefs-admin-search.inc' %] >-[% END %] >- >-[% WRAPPER 'sub-header.inc' %] >- [% WRAPPER breadcrumbs %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> >- [% END %] >- >- [% IF ( attribute_type_form || delete_attribute_type_form ) %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a> >- [% END %] >- [% END %] >- >- [% IF ( attribute_type_form ) %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- [% IF ( edit_attribute_type ) %] >- [% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %] >- [% ELSE %] >- <span>New patron attribute type</span> >- [% END %] >- [% END %] >- [% ELSIF ( delete_attribute_type_form ) %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- [% tx("Confirm deletion of patron attribute type '{code}'", { code = code }) | html %] >- [% END %] >- [% ELSE %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Patron attribute types</span> >- [% END %] >- [% END %] >- [% END #/ WRAPPER breadcrumbs %] >-[% END #/ WRAPPER sub-header.inc %] >- >-[% WRAPPER 'main-container.inc' aside='admin-menu' %] >- >- [% IF ( WARNING_extended_attributes_off ) %] >- <div class="alert alert-info" >- >Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records. <br />Go to the >- <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExtendedPatronAttributes">ExtendedPatronAttributes</a> system preference if you wish to enable this feature.</div >- > >- [% END %] >- >- [% IF ( attribute_type_form ) %] >- [% IF ( edit_attribute_type ) %] >- <h1>[% tx("Modify patron attribute type '{code}'", { code = attribute_type.code }) | html %]</h1> >- [% ELSE %] >- <h1>New patron attribute type</h1> >- [% END %] >- [% IF ( duplicate_code_error ) %] >- <div class="alert alert-info">Could not add patron attribute type "[% duplicate_code_error | html %]" — one with that code already exists. </div> >- [% END %] >- <form action="/cgi-bin/koha/admin/patron-attr-types.pl" class="validated" method="post"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="[% confirm_op | html %]" /> >- <fieldset class="rows"> >- <ol> >- <li> >- [% IF attribute_type %] >- <span class="label">Patron attribute type code: </span> >- <input type="hidden" name="code" value="[% attribute_type.code |html %]" /> >- [% attribute_type.code |html %] >- [% ELSE %] >- <label for="code" class="required">Patron attribute type code: </label> >- <input type="text" id="code" name="code" required="required" class="required focus" maxlength="64" /> >- <span class="required">Required</span> >- [% END %] >- </li> >- <li >- ><label for="description" class="required">Description: </label> >- <input type="text" id="description" name="description" required="required" class="required" size="50" maxlength="250" value="[% attribute_type.description |html %]" /> >- <span class="required">Required</span> >- </li> >- >- <li [% IF attribute_type AND attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]aria-disabled="true"[% END %]> >- <label for="repeatable">Repeatable: </label> >- [% IF attribute_type %] >- [% IF attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %] >- <input type="checkbox" id="repeatable" name="repeatable" checked="checked" disabled="disabled" title="At least one patron has more than one value for this attribute" /> >- <input type="hidden" name="repeatable" value="1" /> >- [% ELSIF attribute_type.repeatable %] >- <input type="checkbox" id="repeatable" name="repeatable" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="repeatable" name="repeatable" /> >- [% END %] >- [% ELSE %] >- <input type="checkbox" id="repeatable" name="repeatable" /> >- [% END %] >- <span class="hint">Check to let a patron record have multiple values of this attribute.</span> >- </li> >- >- <li [% IF attribute_type AND not can_be_set_to_unique %]aria-disabled="true"[% END %]> >- <label for="unique_id">Unique identifier: </label> >- [% IF attribute_type %] >- [% IF attribute_type.unique_id %] >- <input type="checkbox" id="unique_id" name="unique_id" checked="checked" /> >- [% ELSIF can_be_set_to_unique %] >- <input type="checkbox" id="unique_id" name="unique_id" /> >- [% ELSE %] >- <input type="checkbox" id="unique_id" name="unique_id" disabled="disabled" title="At least two patrons have the same value for this attribute" /> >- <input type="hidden" name="unique_id" value="0" /> >- [% END %] >- [% ELSE %] >- <input type="checkbox" id="unique_id" name="unique_id" /> >- [% END %] >- <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> >- </li> >- <li >- ><label for="is_date">Is a date: </label> >- [% IF attribute_type AND attribute_type.is_date %] >- <input type="checkbox" id="is_date" name="is_date" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="is_date" name="is_date" /> >- [% END %] >- <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> >- </li> >- <li >- ><label for="opac_display">Display in OPAC: </label> >- [% IF attribute_type AND attribute_type.opac_display %] >- <input type="checkbox" id="opac_display" name="opac_display" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="opac_display" name="opac_display" /> >- [% END %] >- <span class="hint">Check to display this attribute on a patron's details page in the OPAC.</span> >- </li> >- <li >- ><label for="opac_editable">Editable in OPAC: </label> >- [% IF attribute_type AND attribute_type.opac_editable %] >- <input type="checkbox" id="opac_editable" name="opac_editable" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="opac_editable" name="opac_editable" /> >- [% END %] >- <span class="hint">Check to allow patrons to edit this attribute from their details page in the OPAC. (Requires above)</span> >- </li> >- <li >- ><label for="staff_searchable">Searchable: </label> >- [% IF attribute_type AND attribute_type.staff_searchable %] >- <input type="checkbox" id="staff_searchable" name="staff_searchable" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="staff_searchable" name="staff_searchable" /> >- [% END %] >- <span class="hint"> Check to make this attribute searchable in staff patron searches. If checked, this attribute will appear in patron search dropdowns. </span> >- </li> >- <li >- ><label for="searched_by_default">Search by default: </label> >- [% IF attribute_type AND attribute_type.searched_by_default %] >- <input type="checkbox" id="searched_by_default" name="searched_by_default" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="searched_by_default" name="searched_by_default" /> >- [% END %] >- <span class="hint"> If checked, this field will be included in 'Standard' patron searches. Requires field to be marked as searchable above </span> >- </li> >- <li >- ><label for="mandatory">Mandatory: </label> >- [% IF attribute_type AND attribute_type.mandatory %] >- <input type="checkbox" id="mandatory" name="mandatory" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="mandatory" name="mandatory" /> >- [% END %] >- <span class="hint">Check to make this attribute mandatory when creating or editing a patron.</span> >- </li> >- <li >- ><label for="display_checkout">Display in patron's brief information: </label> >- [% IF attribute_type AND attribute_type.display_checkout %] >- <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="display_checkout" name="display_checkout" /> >- [% END %] >- <span class="hint">Check to show this attribute in the brief information panel in the patron's record (staff interface).</span> >- </li> >- >- [% IF Koha.Preference('Pseudonymization') %] >- <li> >- <label for="keep_for_pseudonymization">Keep for pseudonymization: </label> >- [% IF attribute_type AND attribute_type.keep_for_pseudonymization %] >- <input type="checkbox" id="keep_for_pseudonymization" name="keep_for_pseudonymization" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="keep_for_pseudonymization" name="keep_for_pseudonymization" /> >- [% END %] >- <span class="hint">Check to make this attribute copied to the patron's pseudonymized attributes.</span> >- </li> >- [% END %] >- >- <li >- ><label for="authorised_value_category">Authorized value category: </label> >- <select name="authorised_value_category" id="authorised_value_category"> >- <option value=""></option> >- [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => attribute_type.authorised_value_category ) %] >- </select> >- <div class="hint" >- >If one is selected, the patron record input page will only allow values to be chosen from the authorized value list. However, an authorized value list is not enforced during batch patron import.</div >- > >- </li> >- <li >- ><label for="branches">Library limitation: </label> >- <select id="branches" name="branches" multiple size="10"> >- <option value="">All libraries</option> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => attribute_type.library_limits ) %] >- </select> >- <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> >- </li> >- <li> >- <label for="category">Category: </label> >- <select name="category_code" id="category"> >- <option value=""></option> >- [% FOREACH cat IN categories %] >- [% IF ( cat.categorycode == attribute_type.category_code ) %] >- <option value="[% cat.categorycode | html %]" selected="selected">[% cat.description |html %]</option> >- [% ELSE %] >- <option value="[% cat.categorycode | html %]">[% cat.description |html %]</option> >- [% END %] >- [% END %] >- </select> >- <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> >- </li> >- <li> >- <label for="class">Class: </label> >- [% PROCESS 'av-build-dropbox.inc' name="class", category="PA_CLASS" default=attribute_type.class empty=1 %] >- <div class="hint"> >- [% IF ( CAN_user_parameters_manage_auth_values ) %] >- 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>) >- [% ELSE %] >- Group attributes types with a block title (based on authorized values category 'PA_CLASS') >- [% END %] >- </div> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" class="btn btn-primary" value="Save" /> >- <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a> >- </fieldset> >- </form> >- [% END %] >- >- [% IF ( delete_attribute_type_form ) %] >- <div class="alert alert-warning"> >- <h1> [% tx("Confirm deletion of patron attribute type '{code}' ({description})?", { code = code, description = description }) | html %] </h1> >- <form action="/cgi-bin/koha/admin/patron-attr-types.pl" name="Aform" method="post"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="[% confirm_op | html %]" /> >- <input type="hidden" name="code" value="[% code | html %]" /> >- <button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete patron attribute type</button> >- </form> >- <form action="/cgi-bin/koha/admin/patron-attr-types.pl" method="get"> >- <button type="submit" class="btn btn-default deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button> >- </form> >- </div> >- [% END %] >- >- [% IF ( display_list ) %] >- <div id="toolbar" class="btn-toolbar"> >- <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> >- </div> >- >- <h1>Patron attribute types</h1> >- [% IF ( added_attribute_type ) %] >- <div class="alert alert-info">Added patron attribute type "[% added_attribute_type | html %]"</div> >- [% END %] >- [% IF ( edited_attribute_type ) %] >- <div class="alert alert-info">Modified patron attribute type "[% edited_attribute_type | html %]"</div> >- [% END %] >- [% IF ( deleted_attribute_type ) %] >- <div class="alert alert-info">Deleted patron attribute type "[% deleted_attribute_type | html %]"</div> >- [% END %] >- [% IF ( ERROR_delete_in_use ) %] >- <div class="alert alert-info">Could not delete patron attribute type "[% ERROR_delete_in_use | html %]" — it is in use by [% ERROR_num_patrons | html %] patron records</div> >- [% END %] >- [% IF ( ERROR_delete_not_found ) %] >- <div class="alert alert-info">Could not delete patron attribute type "[% ERROR_delete_not_found | html %]" — it was already absent from the database.</div> >- [% END %] >- [% IF ( available_attribute_types ) %] >- [% FOREACH attribute IN available_attribute_types %] >- <div class="page-section"> >- [% IF attribute.class %] >- <h2>[% attribute.lib | html %]</h2> >- [% ELSE %] >- <h2>Unclassified types</h2> >- [% END %] >- <table class="patron_attributes_types" id="patron_attr[% attribute.class | html %]"> >- <thead> >- <tr> >- <th>Code</th> >- <th>Description</th> >- <th>Library limitation</th> >- <th>Authorized value category</th> >- <th>Mandatory</th> >- <th>Searching</th> >- <th class="NoSort noExport">Actions</th> >- </tr> >- </thead> >- <tbody> >- [% FOREACH item IN attribute.items %] >- <tr> >- <td>[% item.code | html %]</td> >- <td>[% item.description | html %]</td> >- <td> >- [% SET libraries = item.library_limits %] >- [% IF ( libraries && libraries.count > 0 ) %] >- [% branches_str = "" %] >- [% FOREACH branch IN libraries %] >- [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %] >- [% END %] >- <span title="[% branches_str | html %]"> >- [% IF libraries.count > 1 %] >- <span>[% libraries.count | html %] library limitations</span> >- [% ELSE %] >- <span>[% libraries.count | html %] library limitation</span> >- [% END %] >- </span> >- [% ELSE %] >- No limitation >- [% END %] >- </td> >- <td> >- [% IF ( CAN_user_parameters_manage_auth_values ) %] >- <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% item.authorised_value_category | uri %]">[% item.authorised_value_category | html %]</a> >- [% ELSE %] >- [% item.authorised_value_category | html %] >- [% END %] >- </td> >- <td> >- [% IF ( item.mandatory ) -%] >- <span>Yes</span> >- [% ELSE -%] >- <span>No</span> >- [% END %] >- </td> >- <td> >- [% IF ( item.staff_searchable ) %] >- [% IF( item.searched_by_default ) %] >- <span>Searched by default</span> >- [% ELSE %] >- <span>Searchable</span> >- [% END %] >- [% ELSE %] >- <span>Not searchable</span> >- [% END %] >- </td> >- <td class="actions"> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/patron-attr-types.pl?op=edit_attribute_type&code=[% item.code | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/patron-attr-types.pl?op=delete_attribute_type&code=[% item.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a> >- </td> >- </tr> >- [% END %] >- </tbody> >- </table> </div >- ><!-- ./page-section --> >- [% END %] >- [% ELSE %] >- <p>There are no saved patron attribute types.</p> >- [% END %] >- >- <div class="pages">[% pagination_bar | $raw %]</div> >- [% END %] >-[% END %] >-[% MACRO jsinclude BLOCK %] >- [% Asset.js("js/admin-menu.js") | $raw %] >- [% INCLUDE 'datatables.inc' %] >- [% INCLUDE 'columns_settings.inc' %] >- <script> >- $(document).ready(function () { >- function toggle_search_default() { >- if ($("#staff_searchable").is(":checked")) { >- $("#searched_by_default").prop("disabled", false); >- } else { >- $("#searched_by_default").prop("disabled", true).prop("checked", false); >- } >- } >- $("#staff_searchable").on("change", function () { >- toggle_search_default(); >- }); >- >- toggle_search_default(); >- >- if ($("#branches option:selected").length < 1) { >- $("#branches option:first").attr("selected", "selected"); >- } >- >- $("#opac_display") >- .change(function () { >- if (this.checked) { >- $("#opac_editable").removeAttr("disabled").parent().removeAttr("aria-disabled"); >- } else { >- $("#opac_editable").attr("disabled", true).parent().attr("aria-disabled", "true"); >- } >- }) >- .change(); >- >- $("#is_date") >- .change(function () { >- if (this.checked) { >- $("#authorised_value_category").attr("disabled", true).parent().attr("aria-disabled", "true"); >- } else { >- $("#authorised_value_category").removeAttr("disabled").parent().removeAttr("aria-disabled"); >- } >- }) >- .change(); >- >- $("#authorised_value_category") >- .change(function () { >- if ($(this).val() != "") { >- $("#is_date").attr("disabled", true).parent().attr("aria-disabled", "true"); >- } else { >- $("#is_date").removeAttr("disabled").parent().removeAttr("aria-disabled"); >- } >- }) >- .change(); >- >- $(".patron_attributes_types").each(function () { >- var tableid = $(this).attr("id"); >- KohaTable( >- tableid, >- { >- paginate: false, >- autoWidth: false, >- }, >- null >- ); >- }); >- }); >- </script> >-[% END %] >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index a4f415881b8..e69de29bb2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1,1996 +0,0 @@ >-[% USE raw %] >-[% USE Asset %] >-[% USE To %] >-[% USE Koha %] >-[% USE KohaDates %] >-[% USE Branches %] >-[% PROCESS 'member-main-address-style.inc' %] >-[% PROCESS 'member-alt-address-style.inc' %] >-[% PROCESS 'member-alt-contact-style.inc' %] >-[% PROCESS 'restriction-types.inc' %] >-[% PROCESS 'i18n.inc' %] >-[% SET footerjs = 1 %] >-[% PROCESS 'patron-search.inc' %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title >- >[% FILTER collapse %] >- [% UNLESS blocking_error %] >- [% IF ( op == 'add_form' ) %] >- [% t("Add patron") | html %] >- [% ELSE %] >- [% t("Modify patron") | html %] >- [% END %] >- [% INCLUDE 'patron-title.inc' no_html = 1 %] >- [% IF patron_category %]([% patron_category.description | html %])[% END %] >- [% END %] >- › [% t("Patrons") | html %] › [% t("Koha") | html %] >- [% END %]</title >-> >-[% INCLUDE 'doc-head-close.inc' %] >-[% FILTER collapse %] >- <style> >- fieldset legend { >- border: 1px solid #fff; >- margin-left: -0.5em; >- margin-top: -0.5em; >- padding: 0.7em; >- } >- fieldset legend:hover { >- border: 1px solid #6faf44; >- cursor: pointer; >- } >- >- fieldset legend i { >- color: #4c7aa8; >- font-size: 80%; >- padding-right: 0.2rem; >- } >- >- fieldset legend.collapsed { >- margin-bottom: -0.5em; >- } >- >- legend.collapsed i.fa.fa-caret-down::before { >- content: "\f0da"; >- } >- </style> >-[% END %] >-</head> >- >-<body id="pat_memberentrygen" class="pat"> >-[% WRAPPER 'header.inc' %] >- [% INCLUDE 'patron-search-header.inc' %] >-[% END %] >- >-[% WRAPPER 'sub-header.inc' %] >- [% WRAPPER breadcrumbs %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> >- [% END %] >- [% UNLESS blocking_error %] >- [% UNLESS op == 'add_form' %] >- [% IF (borrower_data.firstname || borrower_data.surname ) %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | uri %]"> [% INCLUDE 'patron-title.inc' %] </a> >- [% END %] >- [% END %] >- [% END %] >- [% END %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- [% IF ( op == 'add_form' ) %] >- <span>Add patron</span> >- [% ELSE %] >- <span>Modify patron</span> >- [% END %] >- [% IF patron_category %] >- ([% patron_category.description | html %]) >- [% END %] >- [% END %] >- [% END #/ WRAPPER breadcrumbs %] >-[% END #/ WRAPPER sub-header.inc %] >- >-<div class="main container-fluid"> >- <div class="row"> >- [% IF borrower_data.messages %] >- [% FOR message IN borrower_data.messages %] >- [% SWITCH message.error %] >- [% CASE 'error_on_insert_patron' %] >- <div class="alert alert-warning">Something went wrong when creating the patron. Check the logs for details.</div> >- [% CASE 'error_on_update_patron' %] >- <div class="alert alert-warning">Something went wrong when updating the patron. Check the logs for details.</div> >- [% CASE %] >- <div class="alert alert-warning">Unhandled error: [% message.error | html %]</div> >- [% END %] >- [% END %] >- [% END %] >- [% IF ( op == 'add_form' ) %] >- [% SET div_class = 'col-md-10 offset-md-1 col-lg-8 offset-lg-2' %] >- [% ELSE %] >- [% SET div_class = 'col-md-10 order-md-2 order-sm-1' %] >- [% END %] >- <div class="[% div_class | html %]"> >- <main class="clearfix"> >- [% INCLUDE 'messages.inc' %] >- >- [% IF error_alert %] >- [% IF ( error_alert == "no_email" ) %] >- <div class="alert alert-warning">This member has no email</div> >- [% ELSE %] >- <div class="alert alert-warning">[% error_alert | html %]</div> >- [% END %] >- [% END %] >- [% IF info_alert %] >- <div class="alert alert-info">Email has been sent.</div> >- [% END %] >- >- [% INCLUDE 'noadd-warnings.inc' %] >- >- [% UNLESS ( no_add ) %] >- <h1> >- [% IF ( op == 'add_form' ) %] >- <span>Add patron</span> >- [% ELSIF ( op == 'duplicate' ) %] >- <span>Duplicate patron</span> >- [% ELSE %] >- <span>Modify patron</span> >- [% END %] >- [% INCLUDE 'patron-title.inc' %] >- [% IF patron_category %]([% patron_category.description | html %])[% END %] >- </h1> >- >- [% IF quickadd && op == 'add_form' && !check_member %] >- <a href="#" class="toggle_quick_add"><i class="fa fa-plus-square"></i> Show full form</a> >- <a href="#" class="toggle_quick_add" style="display:none"><i class="fa fa-minus-square"></i> Show brief form</a> >- [% END %] >- >- [% IF ( check_member ) %] >- <div class="alert alert-warning"> >- <h3>Duplicate patron record?</h3> >- <p>[%- INCLUDE 'patron-title.inc' patron => check_patron hide_patron_infos_if_needed => 1 -%]</p> >- [% IF logged_in_user.can_see_patron_infos( check_patron ) %] >- <p >- ><a class="popup_patronview" href="/cgi-bin/koha/members/moremember.pl?print=brief&borrowernumber=[% check_member | uri %]"><i class="fa-solid fa-window-restore"></i> View existing record</a></p >- > >- [% END %] >- <a href="/cgi-bin/koha/members/memberentry.pl?op=edit_form&borrowernumber=[% check_member | uri %]" class="btn btn-default" id="duplicate"> >- <i class="fa-solid fa-pencil" aria-hidden="true"></i> It is a duplicate. Edit existing record >- </a> >- <button type="submit" id="not-duplicate" class="new"> <i class="fa fa-plus"></i> Not a duplicate. Save as new record </button> >- </div> >- [% END %] >- >- [% IF ( nok ) %] >- <div class="alert alert-warning"> >- <p>The following fields are wrong. Please fix them.</p> >- <ul> >- [% IF ( ERROR_login_exist ) %] >- <li id="ERROR_login_exist">Username already exists or could not create unique new one.</li> >- [% END %] >- [% IF ERROR_cardnumber_already_exists %] >- <li id="ERROR_cardnumber">Card number already in use.</li> >- [% END %] >- [% IF ERROR_cardnumber_length %] >- <li id="ERROR_cardnumber">Card number length is incorrect.</li> >- [% END %] >- [% IF ( ERROR_age_limitations ) %] >- <li id="ERROR_age_limitations">Patron's age is incorrect for their category. Ages allowed are [% age_low | html %]-[% age_high | html %].</li> >- [% END %] >- [% IF ( ERROR_branch ) %] >- <li id="ERROR_branch">Library is invalid.</li> >- [% END %] >- [% IF ( ERROR_dateofbirth ) %] >- <li id="ERROR_dateofbirth">Date of birth is invalid.</li> >- [% END %] >- [% IF ( ERROR_dateenrolled ) %] >- <li id="ERROR_dateenrolled">Date of enrollment is invalid.</li> >- [% END %] >- [% IF ( ERROR_dateexpiry ) %] >- <li id="ERROR_dateexpiry">Date of expiration is invalid.</li> >- [% END %] >- [% IF ( ERROR_password_too_short ) %] >- <li id="ERROR_short_password">Password must be at least [% minPasswordLength | html %] characters long.</li> >- [% END %] >- [% IF ( ERROR_password_too_weak ) %] >- <li id="ERROR_weak_password">Password must contain at least one digit, one lowercase and one uppercase.</li> >- [% END %] >- [% IF ( ERROR_password_has_whitespaces ) %] >- <li id="ERROR_weak_password">Password must not contain leading or trailing whitespaces.</li> >- [% END %] >- [% IF ( ERROR_password_mismatch ) %] >- <li id="ERROR_password_mismatch">Passwords do not match.</li> >- [% END %] >- [% IF ( ERROR_password_expiration_date ) %] >- <li id="ERROR_dateexpiry">Password expiration date is invalid.</li> >- [% END %] >- [% IF ( ERROR_extended_unique_id_failed ) %] >- <li id="ERROR_extended_unique_id_failed" >- ><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 >- > >- [% END %] >- [% IF ERROR_bad_email %] >- <li id="ERROR_bad_email">The primary email is invalid.</li> >- [% END %] >- [% IF ERROR_bad_email_secondary %] >- <li id="ERROR_bad_email_secondary">The secondary email is invalid.</li> >- [% END %] >- [% IF ERROR_bad_email_alternative %] >- <li id="ERROR_bad_email_alternative">The alternative email is invalid.</li> >- [% END %] >- [% IF ( ERROR_child_no_guarantor ) %] >- <li id="ERROR_child_no_guarantor">A child patron needs a guarantor.</li> >- [% END %] >- [% IF ( ERROR_child_is_guarantor ) %] >- <li id="ERROR_child_is_guarantor">Child patron cannot be a guarantor.</li> >- [% END %] >- [% IF ( ERROR_guarantor_is_guarantee ) %] >- <li id="ERROR_guarantor_is_guarantee">A guarantor cannot be a guarantee.</li> >- [% END %] >- [% IF ( ERROR_cannot_delete_guarantor ) %] >- <li id="ERROR_cannot_delete_guarantor">Cannot delete guarantor(s). A child patron needs a guarantor.</li> >- [% END %] >- [% IF ( ERROR_invalid_relationship ) %] >- <li id="ERROR_invalid_relationship">Guarantor relationship cannot be left blank according to configuration.</li> >- [% END %] >- </ul> >- </div> >- [% END %] >- >- [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm') %] >- [% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %] >- <p id="selections"> >- <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> >- [% FOREACH field IN fieldstohide.split(',') %] >- [% SWITCH field %] >- [% CASE 'identity' %] >- <span>Patron identity</span> | >- [% CASE 'guarantor' %] >- <span>Guarantor information</span> | >- [% CASE 'nonpatron_guarantor' %] >- <span>Non-patron guarantor</span> | >- [% CASE 'primary_address' %] >- <span>Main address</span> | >- [% CASE 'primary_contact' %] >- <span>Contact information</span> | >- [% CASE 'alt_address' %] >- <span>Alternate address</span> | >- [% CASE 'alt_contact' %] >- <span>Alternate contact</span> | >- [% CASE 'lib_mgmt' %] >- <span>Library management</span> | >- [% CASE 'lib_setup' %] >- <span>Library setup</span> | >- [% CASE 'login' %] >- <span>OPAC/Staff interface login</span> | >- [% CASE 'flags' %] >- <span>Patron account flags</span> | >- [% CASE 'debarments' %] >- <span>Patron restrictions</span> | >- [% CASE 'housebound' %] >- [% IF Koha.Preference('HouseboundModule') %]<span>Housebound roles</span> |[% END %] >- [% CASE 'additional' %] >- <span>Additional attributes and identifiers</span> | >- [% CASE 'messaging' %] >- <span>Patron messaging preferences</span> | >- [% END %] >- [% END %] >- </p> >- [% END %][% END %] >- >- [% UNLESS ( check_member ) %] >- <div id="toolbar" class="btn-toolbar sticky"> >- [% IF quickadd && op == 'add_form' %] >- <button class="btn btn-primary toggler" id="save_quick_add" name="save"><i class="fa fa-save"></i> Save</button> >- [% END %] >- <button class="btn btn-primary toggler" id="saverecord" name="save"><i class="fa fa-save"></i> Save</button> >- [% IF op == 'add_form' %] >- <a class="btn btn-link toggler save_entryform" href="/cgi-bin/koha/members/member.pl"> <i class="fa fa-times"></i> Cancel </a> >- [% ELSE %] >- <a class="btn btn-link" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]"> <i class="fa fa-times"></i> Cancel </a> >- [% END %] >- </div> >- [% END %] >- >- <form name="form" id="entryform" action="/cgi-bin/koha/members/memberentry.pl" method="post" autocomplete="off" class="toggler"> >- [% UNLESS ( check_member ) %] >- <input type="hidden" name="nodouble" value="[% nodouble | html %]" /> >- [% END %] >- <!-- field always hidden in different form (1,2,3) --> >- <input type="hidden" name="BorrowerMandatoryField" value="[% BorrowerMandatoryField | html %]" /> >- <input type="hidden" name="updtype" value="[% updtype | html %]" /> >- <input type="hidden" name="destination" value="[% destination | html %]" /> >- <input type="hidden" name="check_member" value="[% check_member | html %]" /> >- <input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS op == 'duplicate' %]" /> >- <input type="hidden" name="nodouble" value="[% nodouble | html UNLESS op == 'duplicate' %]" /> >- [% INCLUDE 'csrf-token.inc' %] >- [% IF ( step ) %] >- <input type="hidden" name="step" value="[% step | html %]" /> >- [% END %] >- [% IF ( op == 'add_form' ) %] >- <input type="hidden" name="op" value="cud-insert" /> >- [% ELSIF ( op == 'duplicate' ) %] >- <input type="hidden" name="op" value="cud-insert" /> >- [% ELSE %] >- <input type="hidden" name="op" value="cud-save" /> >- [% IF step == 4 || step == 5 || step == 6 || step == 2 || step == 1 || step == 7 %] >- [%# Only put the card number if we arent showing it in the form later %] >- [% IF borrower_data.cardnumber %] >- <input type="hidden" name="cardnumber" value="[% borrower_data.cardnumber | html %]" /> >- [% END %] >- [% END %] >- [% END %] >- >- [% IF ( step_1 ) %] >- [% UNLESS notitle && nosurname && nofirstname && nopreferred_name && nomiddle_name && nodateofbirth && noinitials && noothernames &&nosex && nopronouns %] >- <fieldset class="rows" id="memberentry_identity"> >- <legend class="expanded" id="identity_lgd"> >- <i class="fa fa-caret-down" title="Collapse this section"></i> >- [% IF ( patron_category.category_type == 'I' ) %] >- <span>Organization identity</span> >- [% ELSE %] >- <span>Patron identity</span> >- [% END %] >- </legend> >- <ol> >- [% UNLESS ( patron_category.category_type == 'I' ) %] >- [% UNLESS notitle %] >- [% IF Koha.Preference('BorrowersTitles') %] >- <li> >- <label for="btitle" [% IF mandatorytitle %]class="required"[% END %]> Salutation: </label> >- <select id="btitle" name="title"> >- <option value=""></option> >- [% FOREACH patron_title IN Koha.Preference('BorrowersTitles').split('\|') %] >- [% IF btitle == patron_title %] >- <option value="[% patron_title | html %]" selected="selected">[% patron_title | html %]</option> >- [% ELSE %] >- <option value="[% patron_title | html %]">[% patron_title | html %]</option> >- [% END %] >- [% END %] >- </select> >- [% IF ( mandatorytitle ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /IF Koha.Preference('BorrowersTitles') %] >- [% END # /UNLESS notitle %] >- [% END # /UNLESS ( I ) %] >- >- [% UNLESS nosurname %] >- <li> >- [% IF ( patron_category.category_type == 'I' ) %] >- <label for="surname" class="required"> Name: </label> >- [% ELSE %] >- <label for="surname" [% IF mandatorysurname %]class="required"[% END %]> Surname: </label> >- [% END %] >- >- [% IF ( uppercasesurnames ) %] >- <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20" value="[% patron.surname | html %]" /> >- [% ELSE %] >- <input type="text" id="surname" name="surname" size="20" value="[% patron.surname | html %]" /> >- [% END %] >- [% IF ( mandatorysurname ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nosurname %] >- >- [% UNLESS ( patron_category.category_type == 'I' ) %] >- [% UNLESS nofirstname %] >- <li> >- <label for="firstname" [% IF mandatoryfirstname %]class="required"[% END %]> First name: </label> >- <input type="text" id="firstname" name="firstname" size="20" value="[% borrower_data.firstname | html UNLESS op == 'duplicate' %]" /> >- [% IF ( mandatoryfirstname ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END #/UNLESS nofirstname %] >- [% UNLESS nopreferred_name %] >- <li> >- <label for="preferred_name" [% IF mandatorypreferred_name %]class="required"[% END %]> Preferred name: </label> >- <input type="text" id="preferred_name" name="preferred_name" size="20" value="[% borrower_data.preferred_name | html UNLESS op == 'duplicate' %]" /> >- [% IF ( mandatorypreferred_name ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END #/UNLESS nopreferred_name %] >- [% UNLESS nomiddle_name %] >- <li> >- <label for="middle_name" [% IF mandatorymiddle_name %]class="required"[% END %]> Middle name: </label> >- <input type="text" id="middle_name" name="middle_name" size="20" value="[% borrower_data.middle_name | html UNLESS op == 'duplicate' %]" /> >- [% IF ( mandatorymiddle_name ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END #/UNLESS nomiddle_name %] >- [% UNLESS nodateofbirth %] >- <li> >- <label for="dateofbirth" [% IF mandatorydateofbirth %]class="required"[% END %]> Date of birth: </label> >- <input >- type="text" >- id="dateofbirth" >- name="dateofbirth" >- size="20" >- value="[% borrower_data.dateofbirth | html UNLESS op == 'duplicate' %]" >- class="flatpickr" >- data-flatpickr-pastinclusive="true" >- /> >- [% IF ( mandatorydateofbirth ) %] >- <span class="required">Required</span> >- [% END %] >- [% IF ( ERROR_dateofbirth ) %] >- <span class="required">(Error)</span> >- [% END %] >- <div id="dateofbirth_hint" class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >- [% END # /UNLESS nodateofbirth %] >- [% UNLESS noinitials %] >- <li> >- <label for="initials" [% IF mandatoryinitials %]class="required"[% END %]> Initials: </label> >- <input type="text" id="initials" name="initials" size="20" value="[% borrower_data.initials | html UNLESS op == 'duplicate' %]" /> >- [% IF ( mandatoryinitials ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS noinitials %] >- [% UNLESS nopronouns %] >- <li> >- <label for="pronouns" [% IF mandatorypronouns %]class="required"[% END %]> Pronouns: </label> >- <input type="text" id="pronouns" name="pronouns" size="20" value="[% borrower_data.pronouns | html UNLESS op == 'duplicate' %]" /> >- [% IF ( mandatorypronouns ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nopronouns %] >- [% END #/UNLESS ( I ) %] >- [% UNLESS noothernames %] >- <li> >- <label for="othernames" [% IF mandatoryothernames %]class="required"[% END %]> Other name: </label> >- <input type="text" id="othernames" name="othernames" size="20" value="[% borrower_data.othernames | html UNLESS op == 'duplicate' %]" /> >- [% IF ( mandatoryothernames ) %] >- <span class="required">Required</span> >- [% END %] >- [% IF ( patron_category.category_type == 'I' ) %]<input type="hidden" name="sex" value="N" />[% END %] >- </li> >- [% END #/UNLESS noothernames %] >- >- [% UNLESS ( patron_category.category_type == 'I' ) %] >- [% UNLESS nosex %] >- <li class="radio"> >- [% UNLESS ( op == 'duplicate' ) %] >- [% IF ( female ) %] >- <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /><span class="patronsex-female"> Female</span></label> >- [% ELSE %] >- <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /><span class="patronsex-female"> Female</span></label> >- [% END %] >- [% IF ( male ) %] >- <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /><span class="patronsex-male"> Male</span></label> >- [% ELSE %] >- <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /><span class="patronsex-male"> Male</span></label> >- [% END %] >- [% IF ( other ) %] >- <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> >- [% ELSE %] >- <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" /><span class="patronsex-other"> [% tp('gender', 'Other') | html %]</span></label> >- [% END %] >- [% IF ( none ) %] >- <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" checked="checked" /><span class="patronsex-none"> None specified</span></label> >- [% ELSE %] >- <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /><span class="patronsex-none"> None specified</span></label> >- [% END %] >- [% ELSE %] >- <label for="sex-female"><span class="patronsex-female">Female </span></label><input type="radio" name="sex" id="sex-female" value="F" /> >- <label for="sex-male"><span class="patronsex-male">Male </span></label><input type="radio" name="sex" id="sex-male" value="M" /> >- <label for="sex-other"><span class="patronsex-other">[% tp('gender', 'Other') | html %] </span></label><input type="radio" name="sex" id="sex-other" value="O" /> >- <label for="sex-none"><span class="patronsex-none">None specified </span></label><input type="radio" name="sex" id="sex-none" value="" checked="checked" /> >- [% END # /UNLESS ( op == 'duplicate' ) %] >- </li> >- [% END # /UNLESS nosex %] >- [% END # /UNLESS ( I ) %] >- </ol> >- </fieldset> >- <!-- /#memberentry_identity --> >- [% END # hide fieldset %] >- >- [% IF show_guarantor || guarantor %] >- [% SET possible_relationships = Koha.Preference('borrowerRelationship') %] >- <div id="memberentry_guarantor_anchor"> >- <fieldset id="memberentry_guarantor" class="rows"> >- <legend class="expanded" id="patron_guarantor_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Patron guarantor >- </legend> >- >- <div id="guarantor_relationships"> >- [% FOREACH r IN relationships %] >- <fieldset> >- <ol> >- [% IF patron_category.category_type == 'I' %] >- <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]"> >- <span class="label">Organization:</span> >- [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %] >- </li> >- <li> >- <span class="label">Relationship:</span> >- <span>[% r.relationship | html %]</span> >- </li> >- [% ELSE %] >- <li class="guarantor-details" data-borrowernumber="[% r.guarantor_id | $raw %]"> >- <span class="label">Guarantor:</span> >- [% INCLUDE 'patron-title.inc' patron=r.guarantor hide_patron_infos_if_needed=1 %] >- <input type="hidden" class="new_guarantor_id relation-[% r.id | html %]" name="new_guarantor_id" value="[% r.guarantor_id | html %]" /> >- </li> >- <li> >- <span class="label">Relationship:</span> >- <span>[% r.relationship | html %]</span> >- <input type="hidden" class="new_guarantor_relationship relation-[% r.id | html %]" name="new_guarantor_relationship" value="[% r.relationship | html %]" /> >- </li> >- >- <li> >- <label for="delete_guarantor-[% r.id | uri %]">Remove: </label> >- <input type="checkbox" id="delete_guarantor-[% r.id | uri %]" name="delete_guarantor" value="[% r.id | html %]" onclick="toggle_guarantor_field([% r.id | html %])" /> >- </li> >- [% END %] >- </ol> >- </fieldset> >- [% END # END relationships foreach %] >- [% IF guarantor && (!relationships) %] >- <fieldset class="guarantor"> >- <ol> >- <li class="guarantor-details" data-borrowernumber="0"> >- <span class="label">Guarantor:</span> >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]" target="blank" >- >[% guarantor.firstname | html %] [% guarantor.surname | html %] ([% guarantor.cardnumber | html %])</a >- > >- <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="[% guarantor.borrowernumber | html %]" /> >- </li> >- >- [% UNLESS norelationship %] >- <li> >- <label for="guarantor_relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label> >- <select class="new_guarantor_relationship" name="new_guarantor_relationship" [% IF mandatoryrelationship %]required="required"[% END %]> >- <option value=""></option> >- [% FOREACH pr IN possible_relationships.split('\|') %] >- [% IF pr != "" %] >- <option value="[% pr | html %]">[% pr | html %]</option> >- [% END %] >- [% END %] >- </select> >- [% IF mandatoryrelationship %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% ELSE %] >- <input type="hidden" name="new_guarantor_relationship" value="" /> >- [% END %] >- >- <li> >- <label for="guarantor_cancel"> </label> >- <span >- ><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can" aria-hidden="true"></i> Remove</a></span >- > >- </li> >- </ol> >- </fieldset> >- [% END %] >- </div> >- <!-- #/guarantor_relationships --> >- >- <fieldset class="guarantor" id="guarantor_template"> >- <ol> >- <li class="guarantor-details" data-borrowernumber="0"> >- <span class="label">Guarantor:</span> >- <a class="new_guarantor_link" href="#" target="blank"> >- <span class="new_guarantor_firstname_text"></span> <span class="new_guarantor_surname_text"></span> (<span class="new_guarantor_id_text"></span>) >- </a> >- <input type="hidden" class="new_guarantor_id" name="new_guarantor_id" value="" /> >- </li> >- >- [% UNLESS norelationship %] >- <li> >- <label for="guarantor_relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label> >- <select class="new_guarantor_relationship" name="new_guarantor_relationship" [% IF mandatoryrelationship %]required="required"[% END %]> >- <option value="" selected></option> >- [% FOREACH pr IN possible_relationships.split('\|') %] >- [% IF pr != "" %] >- <option value="[% pr | html %]">[% pr | html %]</option> >- [% END %] >- [% END %] >- </select> >- [% IF mandatoryrelationship %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% ELSE %] >- <input type="hidden" name="new_guarantor_relationship" value="" /> >- [% END %] >- >- <li> >- <label for="guarantor_cancel"> </label> >- <span >- ><a href="#" class="guarantor_cancel"><i class="fa fa-trash-can"></i> Remove</a></span >- > >- </li> >- </ol> >- </fieldset> >- >- <ol> >- <input type="hidden" id="guarantor_id" value="" /> >- <input name="guarantor_surname" id="guarantor_surname" type="hidden" /> >- <input name="guarantor_firstname" id="guarantor_firstname" type="hidden" /> >- >- <li> >- <a href="#patron_search_modal" class="btn btn-default" data-bs-toggle="modal"><i class="fa fa-plus"></i> Add guarantor</a> >- </li> >- >- [% IF Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %] >- <li> >- <label for="privacy_guarantor_checkouts">Show checkouts to guarantors:</label> >- <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts"> >- [% IF borrower_data.privacy_guarantor_checkouts %] >- <option value="0">No</option> >- <option value="1" selected>Yes</option> >- [% ELSE %] >- <option value="0" selected>No</option> >- <option value="1">Yes</option> >- [% END %] >- </select> >- <div class="hint">Allow guarantors of this patron to view this patron's checkouts from the OPAC</div> >- </li> >- [% END %] >- [% IF Koha.Preference('AllowStaffToSetFinesVisibilityForGuarantor') %] >- <li> >- <label for="privacy_guarantor_fines">Show charges to guarantors:</label> >- <select name="privacy_guarantor_fines" id="privacy_guarantor_fines"> >- [% IF borrower_data.privacy_guarantor_fines %] >- <option value="0">No</option> >- <option value="1" selected>Yes</option> >- [% ELSE %] >- <option value="0" selected>No</option> >- <option value="1">Yes</option> >- [% END %] >- </select> >- <div class="hint">Allow guarantors of this patron to view this patron's charges from the OPAC</div> >- </li> >- [% END %] >- </ol> >- </fieldset> >- <!-- /#memberentry_guarantor --> >- </div> >- <!-- #/memberentry_guarantor_anchor --> >- >- [% UNLESS nocontactname && nocontactfirstname && norelationship %] >- <fieldset class="rows" id="non_patron_guarantor"> >- <legend class="expanded" id="non_patron_guarantor_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Non-patron guarantor >- </legend> >- <ol> >- [% UNLESS nocontactname %] >- <li> >- <label for="contactname" [% IF mandatorycontactname %]class="required"[% END %]> Guarantor surname: </label> >- <input type="text" id="contactname" name="contactname" value="[% patron.contactname | html %]" /> >- [% IF ( mandatorycontactname ) %] >- <span class="required">Required</span> >- [% END %] >- <div class="hint">Non-patron guarantor surname</div> >- </li> >- [% END # /UNLESS nocontactname %] >- >- [% UNLESS nocontactfirstname %] >- <li> >- <label for="contactfirstname" [% IF mandatorycontactfirstname %]class="required"[% END %]> Guarantor first name: </label> >- <input type="text" id="contactfirstname" name="contactfirstname" value="[% patron.contactfirstname | html %]" /> >- [% IF ( mandatorycontactfirstname ) %] >- <span class="required">Required</span> >- [% END %] >- <div class="hint">Non-patron guarantor first name</div> >- </li> >- [% END # /UNLESS noaltcontactfirstname %] >- >- [% UNLESS norelationship %] >- <li> >- <label for="relationship" [% IF mandatoryrelationship %]class="required"[% END %]>Relationship: </label> >- <select class="relationship" name="relationship" id="relationship" [% IF mandatoryrelationship %]required="required"[% END %]> >- <option value=""></option> >- [% FOREACH pr IN possible_relationships.split('\|') %] >- [% IF pr == borrower_data.relationship %] >- <option value="[% pr | html %]" selected="selected">[% pr | html %]</option> >- [% ELSE %] >- <option value="[% pr | html %]">[% pr | html %]</option> >- [% END %] >- [% END %] >- </select> >- [% IF mandatoryrelationship %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS norelationship %] >- </ol> >- </fieldset> >- <!-- /#non_patron_guarantor --> >- [% END # /UNLESS nocontactname && nocontactfirstname && norelationship %] >- [% END # /IF show_guarantor || guarantor %] >- >- [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %] >- [% PROCESS 'main-address-style' %] >- [% END # /UNLESS nostreet && nocity etc group %] >- >- [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %] >- <fieldset class="rows" id="memberentry_contact"> >- <legend class="expanded" id="contact_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Contact information >- </legend> >- <ol> >- [% UNLESS nophone %] >- <li> >- <label for="phone" [% IF mandatoryphone %]class="required"[% END %]> Primary phone: </label> >- <input type="text" id="phone" name="phone" value="[% patron.phone | html %]" /> >- [% IF ( mandatoryphone ) %] >- <span class="required">Required</span> >- [% END %] >- <div class="hint">Shows on transit slips</div> >- </li> >- [% END # /UNLESS nophone %] >- >- [% UNLESS nophonepro %] >- <li> >- <label for="phonepro" [% IF mandatoryphonepro %]class="required"[% END %]> Secondary phone: </label> >- <input type="text" id="phonepro" name="phonepro" value="[% patron.phonepro | html %]" /> >- [% IF ( mandatoryphonepro ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nophonepro %] >- >- [% UNLESS nomobile %] >- <li> >- <label for="mobile" [% IF mandatorymobile %]class="required"[% END %]> Other phone: </label> >- <input type="text" id="mobile" name="mobile" value="[% patron.mobile | html %]" /> >- [% IF ( mandatorymobile ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nomobile %] >- >- [% UNLESS noemail %] >- <li> >- <label for="email" [% IF mandatoryemail %]class="required"[% END %]> Primary email: </label> >- [% IF ( NoUpdateEmail ) %] >- <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" disabled="disabled" /> >- [% ELSE %] >- <input type="text" id="email" name="email" size="45" value="[% patron.email | html %]" /> >- [% END %] >- [% IF ( mandatoryemail ) %] >- <span class="required">Required</span> >- [% END %] >- <div class="hint">Shows on transit slips</div> >- </li> >- [% END #/UNLESS noemail %] >- >- [% UNLESS noemailpro %] >- <li> >- <label for="emailpro" [% IF mandatoryemailpro %]class="required"[% END %]> Secondary email: </label> >- [% IF ( NoUpdateEmail ) %] >- <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" disabled="disabled" /> >- [% ELSE %] >- <input type="text" id="emailpro" name="emailpro" size="45" value="[% patron.emailpro | html %]" /> >- [% END %] >- [% IF ( mandatoryemailpro ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END #/UNLESS noemailpro %] >- >- [% UNLESS nofax %] >- <li> >- <label for="fax" [% IF mandatoryfax %]class="required"[% END %]> Fax: </label> >- <input type="text" id="fax" name="fax" value="[% patron.fax | html %]" /> >- [% IF ( mandatoryfax ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END #/UNLESS nofax %] >- >- [% UNLESS noprimary_contact_method %] >- <li> >- <label for="primary_contact_method" [% IF mandatoryprimary_contact_method %]class="required"[% END %]> Main contact method: </label> >- >- <select id="primary_contact_method" name="primary_contact_method"> >- <option value=""></option> >- [% UNLESS nophone %] >- [% IF ( borrower_data.primary_contact_method == 'phone' ) %] >- <option value="phone" selected="selected">Primary phone</option> >- [% ELSE %] >- <option value="phone">Primary phone</option> >- [% END %] >- [% END %] >- [% UNLESS nophonepro %] >- [% IF ( borrower_data.primary_contact_method == 'phonepro' ) %] >- <option value="phonepro" selected="selected">Secondary phone</option> >- [% ELSE %] >- <option value="phonepro">Secondary phone</option> >- [% END %] >- [% END %] >- [% UNLESS nomobile %] >- [% IF ( borrower_data.primary_contact_method == 'mobile' ) %] >- <option value="mobile" selected="selected">Other phone</option> >- [% ELSE %] >- <option value="mobile">Other phone</option> >- [% END %] >- [% END %] >- [% UNLESS noemail %] >- [% IF ( borrower_data.primary_contact_method == 'email' ) %] >- <option value="email" selected="selected">Primary email</option> >- [% ELSE %] >- <option value="email">Primary email</option> >- [% END %] >- [% END %] >- [% UNLESS noemailpro %] >- [% IF ( borrower_data.primary_contact_method == 'emailpro' ) %] >- <option value="emailpro" selected="selected">Secondary email</option> >- [% ELSE %] >- <option value="emailpro">Secondary email</option> >- [% END %] >- [% END %] >- [% UNLESS nofax %] >- [% IF ( borrower_data.primary_contact_method == 'fax' ) %] >- <option value="fax" selected="selected">Fax</option> >- [% ELSE %] >- <option value="fax">Fax</option> >- [% END %] >- [% END %] >- </select> >- [% IF mandatoryprimary_contact_method %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END %] >- </ol> >- </fieldset> >- <!-- /#memberentry_contact --> >- [% END # hide fieldset %] >- >- <!-- ************************ STEP_1 *********************** --> >- [% END # /IF ( step_1 ) %] >- >- [% IF ( step_6 ) %] >- [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %] >- [% PROCESS 'alt-address-style' %] >- [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %] >- [% END # /IF ( step_6 ) %] >- >- [% IF ( step_2 ) %] >- [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %] >- [% PROCESS 'alt-contact-style' %] >- [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %] >- [% END # /IF ( step_2 ) %] >- >- [% IF ( step_3 ) %] >- [% SET autoMemberNum = Koha.Preference('autoMemberNum') %] >- <fieldset class="rows" id="memberentry_library_management"> >- <legend class="expanded" id="library_management_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Library management >- </legend> >- <ol> >- [% UNLESS nocardnumber %] >- <li> >- <label for="cardnumber" class="[% mandatorycardnumber ? 'required' : 'validated' | html %]"> Card number: </label> >- >- [% IF minlength_cardnumber == maxlength_cardnumber %] >- <input >- type="text" >- id="cardnumber" >- name="cardnumber" >- size="20" >- value="[% borrower_data.cardnumber | html %]" >- minlength="[% minlength_cardnumber | html %]" >- maxlength="[% maxlength_cardnumber | html %]" >- /> >- [% IF mandatorycardnumber %] >- <span class="required">Required</span> >- [% END %] >- <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span> >- <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.</div> >- [% ELSIF minlength_cardnumber && maxlength_cardnumber %] >- <input >- type="text" >- id="cardnumber" >- name="cardnumber" >- size="20" >- value="[% borrower_data.cardnumber | html %]" >- minlength="[% minlength_cardnumber | html %]" >- maxlength="[% maxlength_cardnumber | html %]" >- /> >- [% IF mandatorycardnumber %] >- <span class="required">Required</span> >- [% END %] >- <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span> >- <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.</div> >- [% ELSIF maxlength_cardnumber %] >- <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" maxlength="[% maxlength_cardnumber | html %]" /> >- [% IF mandatorycardnumber %] >- <span class="required">Required</span> >- [% END %] >- <span id="cn_max" class="required">Card number must not be more than [% maxlength_cardnumber | html %] characters.</span> >- <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.</div> >- [% ELSE %] >- <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% borrower_data.cardnumber | html %]" /> >- [% IF mandatorycardnumber %] >- <span class="required">Required</span> >- [% END %] >- <div class="hint">There is no minimum or maximum character length.</div> >- [% END %] >- [% IF autoMemberNum %] >- [% IF mandatorycardnumber %] >- <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> >- [% ELSE %] >- <div class="hint">Leave blank for auto calc during registration</div> >- [% END %] >- [% END %] >- </li> >- [% END # /UNLESS nocardnumber %] >- >- [% UNLESS nobranchcode %] >- <li> >- <label for="libraries" class="required">Library:</label> >- <select name="branchcode" id="libraries"> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %] >- </select> >- <span class="required">Required</span> >- </li> >- [% END %] >- >- <li> >- <label for="categorycode_entry" class="required">Category: </label> >- <select id="categorycode_entry" name="categorycode"> >- [% FOREACH category_type IN patron_categories.keys.sort %] >- [% SET optgroup_label = t("Unknown") %] >- [% SWITCH category_type %] >- [% CASE 'C' %] >- [% optgroup_label = t("Child") %] >- [% CASE 'A' %] >- [% optgroup_label = t("Adult") %] >- [% CASE 'S' %] >- [% optgroup_label = t("Staff") %] >- [% CASE 'I' %] >- [% optgroup_label = t("Organization") %] >- [% CASE 'P' %] >- [% optgroup_label = t("Professional") %] >- [% CASE 'X' %] >- [% optgroup_label = t("Statistical") %] >- [% END %] >- <optgroup label="[% optgroup_label | html %]"> >- [% FOREACH category IN patron_categories.$category_type %] >- [% IF category.categorycode == patron_category.categorycode %] >- <option >- value="[% category.categorycode | html %]" >- selected="selected" >- data-pwd-length="[% category.effective_min_password_length | html %]" >- data-pwd-strong="[% category.effective_require_strong_password | html %]" >- data-typename="[% category_type | html %]" >- >[% category.description | html %]</option >- > >- [% ELSE %] >- <option >- value="[% category.categorycode | html %]" >- data-pwd-length="[% category.effective_min_password_length | html %]" >- data-pwd-strong="[% category.effective_require_strong_password | html %]" >- data-typename="[% category_type | html %]" >- >[% category.description | html %]</option >- > >- [% END %] >- [% END %] >- </optgroup> >- [% END %] >- </select> >- [% IF limited_category %] >- <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> >- [% END %] >- <span class="required">Required</span> >- </li> >- >- [% UNLESS nosort1 %] >- <li> >- <label for="sort1" [% IF mandatorysort1 %]class="required"[% END %]> Sort 1: </label> >- [% PROCESS 'av-build-dropbox.inc' name="sort1", category="Bsort1", default=borrower_data.sort1, empty=1, size = 20 %] >- [% IF ( mandatorysort1 ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nosort1 %] >- >- [% UNLESS nosort2 %] >- <li> >- <label for="sort2" [% IF mandatorysort2 %]class="required"[% END %]> Sort 2: </label> >- [% PROCESS 'av-build-dropbox.inc' name="sort2", category="Bsort2", default=borrower_data.sort2, empty=1, size = 20 %] >- [% IF ( mandatorysort2 ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nosort2 %] >- >- [% UNLESS noautorenew_checkouts %] >- <li class="radio"> >- <label for="yes-autorenew_checkouts"> Allow auto-renewal of items: </label> >- [% IF ( borrower_data.autorenew_checkouts || op == 'add_form' ) %] >- <label for="yes-autorenew_checkouts"> >- Yes >- <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" checked="checked" /> >- </label> >- <label for="no-autorenew_checkouts"> >- No >- <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" /> >- </label> >- [% ELSE %] >- <label for="yes-autorenew_checkouts"> >- Yes >- <input type="radio" id="yes-autorenew_checkouts" name="autorenew_checkouts" value="1" /> >- </label> >- <label for="no-autorenew_checkouts"> >- No >- <input type="radio" id="no-autorenew_checkouts" name="autorenew_checkouts" value="0" checked="checked" /> >- </label> >- [% END %] >- </li> >- [% END %] >- >- [% UNLESS noprotected || !CanUpdateProtectPatron %] >- <li class="radio"> >- <label for="protected">Protected:</label> >- [% IF ( patron.protected == 1 ) %] >- <label for="yes-protected"> >- Yes >- <input type="radio" id="yes-protected" name="protected" value="1" checked="checked" /> >- </label> >- <label for="no-protected"> >- No >- <input type="radio" id="no-protected" name="protected" value="0" /> >- </label> >- [% ELSE %] >- <label for="yes-protected"> >- Yes >- <input type="radio" id="yes-protected" name="protected" value="1" /> >- </label> >- <label for="no-protected"> >- No >- <input type="radio" id="no-protected" name="protected" value="0" checked="checked" /> >- </label> >- [% END %] >- </li> >- [% END %] >- >- [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %] >- <li> >- <label for="checkprevcheckout">Check for previous checkouts: </label> >- <select name="checkprevcheckout" id="checkprevcheckout"> >- [% IF ( borrower_data.checkprevcheckout == 'yes' ) %] >- <option value="yes" selected="selected">Yes if settings allow it</option> >- <option value="no">No if settings allow it</option> >- <option value="inherit">Inherit from settings</option> >- [% ELSIF ( borrower_data.checkprevcheckout == 'no' ) %] >- <option value="yes">Yes if settings allow it</option> >- <option value="no" selected="selected">No if settings allow it</option> >- <option value="inherit">Inherit from settings</option> >- [% ELSE %] >- <option value="yes">Yes if settings allow it</option> >- <option value="no">No if settings allow it</option> >- <option value="inherit" selected="selected">Inherit from settings</option> >- [% END %] >- </select> >- </li> >- [% END # /IF ( Koha.Preference('CheckPrevCheckout') %] >- >- [% IF Koha.Preference('TranslateNotices') %] >- <li> >- <label for="lang">Preferred language for notices: </label> >- <select id="lang" name="lang"> >- <option value="default">Default</option> >- [% FOR language IN languages %] >- [% FOR sublanguage IN language.sublanguages_loop %] >- [% IF language.plural %] >- [% IF sublanguage.rfc4646_subtag == borrower_data.lang %] >- <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected" >- >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option >- > >- [% ELSE %] >- <option value="[% sublanguage.rfc4646_subtag | html %]" >- >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option >- > >- [% END %] >- [% ELSE %] >- [% IF sublanguage.rfc4646_subtag == borrower_data.lang %] >- <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >- [% ELSE %] >- <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >- [% END %] >- [% END # /IF language.plural %] >- [% END # /FOR sublanguage %] >- [% END #/FOR language %] >- </select> >- <!-- /#lang --> >- </li> >- [% END #/IF Koha.Preference('TranslateNotices') %] >- </ol> >- </fieldset> >- <!-- /#memberentry_library_management --> >- >- [% UNLESS nodateenrolled && noopacnote && noborrowernotes %] >- <fieldset class="rows" id="memberentry_subscription"> >- <legend class="expanded" id="library_setup_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Library setup >- </legend> >- <ol> >- [% UNLESS nodateenrolled %] >- <li> >- <label for="from" [% IF mandatorydateenrolled %]class="required"[% END %]> Registration date: </label> >- <input type="text" id="from" name="dateenrolled" maxlength="10" size="10" value="[% borrower_data.dateenrolled | html %]" class="flatpickr" data-date_to="to" /> >- [% IF ( mandatorydateenrolled ) %] >- <span class="required">Required</span> >- [% END %] >- [% IF ( ERROR_dateenrolled ) %] >- <span class="required">(Error)</span> >- [% END %] >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >- [% END # /UNLESS nodateenrolled %] >- >- <li [% IF nodateexpiry %]style="display:none"[% END %]> >- <label for="to" [% IF mandatorydateexpiry %]class="required"[% END %]> Expiry date (leave blank for auto calc): </label> >- [% UNLESS ( op == 'add_form' ) %] >- <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html UNLESS op == 'duplicate' %]" class="flatpickr" /> >- [% ELSE %] >- <input type="text" id="to" name="dateexpiry" maxlength="10" size="10" value="[% borrower_data.dateexpiry | html %]" class="flatpickr" /> >- [% END %] >- [% IF ( mandatorydateexpiry ) %] >- <span class="required">Required</span> >- [% END %] >- [% IF ( ERROR_dateexpiry ) %] >- <span class="required">(Error)</span> >- [% END %] >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >- </li> >- >- [% UNLESS noopacnote %] >- <li> >- <label for="opacnote" [% IF mandatoryopacnote %]class="required"[% END %]> OPAC note: </label> >- <textarea id="opacnote" name="opacnote" cols="55" rows="5">[% borrower_data.opacnote | html UNLESS op == 'duplicate' %]</textarea> >- <div class="hint">This message appears on this patron's user page in the OPAC</div> >- [% IF ( mandatoryopacnote ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS noopacnote %] >- >- [% UNLESS noborrowernotes %] >- <li> >- <label for="borrowernotes" [% IF mandatoryborrowernotes %]class="required"[% END %]> Circulation note: </label> >- <textarea id="borrowernotes" name="borrowernotes" cols="55" rows="5">[% borrower_data.borrowernotes | $raw UNLESS op == 'duplicate' %]</textarea> >- <div class="hint">This message displays when checking out to this patron</div> >- [% IF ( mandatoryborrowernotes ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS noborrowernotes %] >- </ol> >- </fieldset> >- <!-- /#memberentry_subscription --> >- [% END # hide fieldset %] >- >- [% UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %] >- <fieldset class="rows" id="memberentry_userid"> >- <legend class="expanded" id="opac_staff_login_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- OPAC/Staff interface login >- </legend> >- <ol> >- [% UNLESS nouserid %] >- <li> >- <label for="userid" [% IF mandatoryuserid %]class="required"[% END %]> Username: </label> >- >- [% IF ( NoUpdateLogin ) %] >- [% IF ( op == 'duplicate' ) %] >- <input type="text" id="userid" name="userid" size="20" disabled="disabled" /> >- [% ELSE %] >- <input type="text" id="userid" name="userid" size="20" disabled="disabled" value="[% borrower_data.userid | html %]" /> >- [% END %] >- [% ELSE %] >- [% IF ( op == 'duplicate' ) %] >- <input type="text" id="userid" name="userid" size="20" value="" /> >- [% ELSE %] >- <input type="text" id="userid" name="userid" size="20" value="[% borrower_data.userid | html %]" /> >- [% END %] >- [% END # /IF ( NoUpdateLogin ) %] >- >- [%# Dummy input to avoid Firefox from using userid/password saved for authentication %] >- <input type="text" disabled="disabled" style="display:none" /> >- >- [% IF ( mandatoryuserid ) %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nouserid %] >- >- [% UNLESS nopassword %] >- <li> >- <label for="password" [% IF mandatorypassword %]class="required"[% END %]> Password: </label> >- [% IF ( op == 'add_form' ) %] >- [% IF ( NoUpdateLogin ) %] >- [% IF ( op == 'duplicate' ) %] >- <input type="password" id="password" name="password" size="20" disabled="disabled" /> >- [% ELSE %] >- <input type="password" id="password" name="password" size="20" disabled="disabled" value="[% borrower_data.password | html %]" /> >- [% END %] >- [% ELSE %] >- [% IF ( op == 'duplicate' ) %] >- <input type="password" id="password" name="password" size="20" autocomplete="new-password" /> >- [% ELSE %] >- <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="[% borrower_data.password | html %]" /> >- [% END %] >- [% END # /IF ( NoUpdateLogin ) %] >- [% ELSE # IF ( op == 'add_form' ) %] >- >- [% IF ( borrower_data.password ) %] >- [% IF ( NoUpdateLogin ) %] >- <input type="password" id="password" name="password" size="20" disabled="disabled" value="****" /> >- [% ELSE %] >- [% IF ( op == 'duplicate' ) %] >- <input type="password" id="password" name="password" autocomplete="new-password" size="20" /> >- [% ELSE %] >- <input type="password" id="password" name="password" size="20" value="****" /> >- [% END %] >- [% END %] >- [% ELSE %] >- [% IF ( NoUpdateLogin ) %] >- <input type="password" id="password" name="password" size="20" disabled="disabled" value="" /> >- [% ELSE %] >- <input type="password" id="password" name="password" size="20" autocomplete="new-password" value="" /> >- [% END %] >- [% END # /IF ( password ) %] >- [% END # /IF ( op == 'add_form' ) %] >- [% IF ( mandatorypassword ) %] >- <span class="required">Required</span> >- [% END %] >- [% IF ( ERROR_password_too_short ) %] >- <span class="required">Password is too short</span> >- [% END %] >- [% IF ( ERROR_password_too_weak ) %] >- <span class="required">Password is too weak</span> >- [% END %] >- [% IF ( ERROR_password_has_whitespaces ) %] >- <span class="required">Password has leading or trailing whitespaces</span> >- [% END %] >- <div class="hint">Minimum password length: [% patron.category.effective_min_password_length | html %]</div> >- </li> >- >- <li> >- <label for="password2" [% IF mandatorypassword %]class="required"[% END %]> Confirm password: </label> >- [% IF ( op == 'add_form' ) %] >- [% IF ( NoUpdateLogin ) %] >- [% IF ( op == 'duplicate' ) %] >- <input type="password" id="password2" name="password2" size="20" disabled="disabled" /> >- [% ELSE %] >- <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="[% borrower_data.password | html %]" /> >- [% END %] >- [% ELSE %] >- [% IF ( op == 'duplicate' ) %] >- <input type="password" id="password2" name="password2" size="20" /> >- [% ELSE %] >- <input type="password" id="password2" name="password2" size="20" value="[% borrower_data.password | html %]" /> >- [% END %] >- [% END %] >- [% ELSE # IF ( op == 'add_form' ) %] >- [% IF ( borrower_data.password ) %] >- [% IF ( NoUpdateLogin ) %] >- <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="****" /> >- [% ELSE %] >- [% IF ( op == 'duplicate' ) %] >- <input type="password" id="password2" name="password2" size="20" /> >- [% ELSE %] >- <input type="password" id="password2" name="password2" size="20" value="****" /> >- [% END %] >- [% END %] >- [% ELSE %] >- [% IF ( NoUpdateLogin ) %] >- <input type="password" id="password2" name="password2" size="20" disabled="disabled" value="" /> >- [% ELSE %] >- <input type="password" id="password2" name="password2" size="20" value="" /> >- [% END %] >- [% END %] >- [% END # /IF ( op == 'add_form' ) %] >- >- [% IF ( mandatorypassword ) %] >- <span class="required">Required</span> >- [% END %] >- [% IF ( ERROR_password_mismatch ) %] >- <span class="required">Passwords do not match</span> >- [% END %] >- </li> >- [% END # /UNLESS nopassword %] >- [% UNLESS ( !CanUpdatePasswordExpiration ) %] >- <li> >- <label for="password_expiration_date">Password expiration date:</label> >- <input type="text" id="password_expiration_date" name="password_expiration_date" maxlength="10" size="10" value="[% borrower_data.password_expiration_date | html %]" class="flatpickr" /> >- </li> >- [% END %] >- </ol> >- </fieldset> >- <!-- /#memberentry_userid --> >- [% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %] >- >- <!--this zones are not necessary in modif mode --> >- [% UNLESS ( op == 'add_form' || op == 'duplicate' || ( nogonenoaddress && nolost ) ) %] >- <fieldset class="rows" id="memberentry_account_flags"> >- <legend class="expanded" id="account_flags_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Patron account flags >- </legend> >- <p>Setting a value here will prevent patron from circulating materials and placing holds on the OPAC</p> >- <ol class="radio"> >- [% UNLESS nogonenoaddress %] >- <li> >- <label class="radio [% IF mandatorygonenoaddress %]required[% END %]" for="yesgonenoaddress"> Gone no address: </label> >- [% IF CAN_user_circulate_manage_restrictions %] >- <label for="yesgonenoaddress"> >- [% IF ( borrower_data.gonenoaddress ) %] >- <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" checked="checked" /> >- [% ELSE %] >- <input type="radio" id="yesgonenoaddress" name="gonenoaddress" value="1" /> >- [% END %] >- Yes >- </label> >- <label for="nogonenoaddress"> >- [% IF ( borrower_data.gonenoaddress ) %] >- <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" /> >- [% ELSE %] >- <input type="radio" id="nogonenoaddress" name="gonenoaddress" value="0" checked="checked" /> >- [% END %] >- No >- </label> >- [% ELSE %] >- [% IF borrower_data.gonenoaddress %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %] >- [% END # /IF CAN_user_circulate_manage_restrictions %] >- [% IF mandatorygonenoaddress %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nogonenoaddress %] >- [% UNLESS nolost %] >- <li> >- <label class="radio [% IF mandatorylost %]required[% END %]" for="yeslost"> Lost card: </label> >- [% IF CAN_user_circulate_manage_restrictions %] >- <label for="yeslost"> >- [% IF ( borrower_data.lost ) %] >- <input type="radio" id="yeslost" name="lost" value="1" checked="checked" /> >- [% ELSE %] >- <input type="radio" id="yeslost" name="lost" value="1" /> >- [% END %] >- Yes >- </label> >- <label for="nolost"> >- [% IF ( borrower_data.lost ) %] >- <input type="radio" id="nolost" name="lost" value="0" /> >- [% ELSE %] >- <input type="radio" id="nolost" name="lost" value="0" checked="checked" /> >- [% END %] >- No >- </label> >- [% ELSE %] >- [% IF borrower_data.lost %]<span>Yes</span>[% ELSE %]<span>No</span>[% END %] >- [% END # /IF CAN_user_circulate_manage_restrictions %] >- [% IF mandatorylost %] >- <span class="required">Required</span> >- [% END %] >- </li> >- [% END # /UNLESS nogonenoaddress %] >- </ol> >- </fieldset> >- <!-- /#memberentry_account_flags --> >- [% END %] >- <fieldset class="rows" id="memberentry_restrictions"> >- <legend class="expanded" id="restrictions_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Patron restrictions >- </legend> >- [% IF ( patron.restrictions.count ) %] >- <table> >- <thead> >- <tr> >- <th>Type</th> >- <th>Comment</th> >- <th>Expiration</th> >- <th>[% tp('patron restriction created on', 'Created') | html %]</th> >- [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] >- <th>Remove?</th> >- [% END %] >- </tr> >- </thead> >- <tbody> >- [% FOREACH restriction IN patron.restrictions %] >- <tr> >- <td>[% PROCESS restriction_type_description restriction_type=restriction.type %]</td> >- <td> >- [% IF restriction.comment.search('OVERDUES_PROCESS') %] >- Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw %] >- [% ELSE %] >- [% restriction.comment | $raw %] >- [% END %] >- </td> >- <td> >- [% IF restriction.expiration %] >- [% restriction.expiration | $KohaDates %] >- [% ELSE %] >- <em>Indefinite</em> >- [% END %] >- </td> >- <td>[% restriction.created | $KohaDates %]</td> >- [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] >- <td> >- <input type="checkbox" id="debarment_[% restriction.borrower_debarment_id | html %]" name="remove_debarment" value="[% restriction.borrower_debarment_id | html %]" /> >- </td> >- [% END %] >- </tr> >- [% END # /FOREACH d %] >- </tbody> >- </table> >- [% ELSE %] >- <p>Patron is currently unrestricted.</p> >- [% END # /IF ( patron.restrictions.count ) %] >- >- [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %] >- <p >- ><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p >- > >- <fieldset id="manual_restriction_form"> >- <input type="hidden" id="add_debarment" name="add_debarment" value="0" /> >- <legend id="manual_restriction_lgd">Add manual restriction</legend> >- <ol> >- [% IF Koha.Preference('PatronRestrictionTypes') %] >- <li> >- <label for="debarred_type">Type:</label> >- <select name="debarred_type"> >- [% FOREACH restriction_type IN restriction_types %] >- [% IF !restriction_type.is_system %] >- [% IF restriction_type.is_default %] >- <option value="[% restriction_type.code | html %]" selected>[% PROCESS restriction_type_description %]</option> >- [% ELSE %] >- <option value="[% restriction_type.code | html %]">[% PROCESS restriction_type_description %]</option> >- [% END %] >- [% END %] >- [% END %] >- </select> >- </li> >- [% END %] >- <li> >- <label for="debarred_comment">Comment: </label> >- <input type="text" id="debarred_comment" name="debarred_comment" /> >- </li> >- <li> >- <label for="debarred_expiration">Expiration: </label> >- <input name="debarred_expiration" id="debarred_expiration" size="10" value="" class="flatpickr" type="text" /> >- <a href="#" id="clear_debarred_expiration">Clear date</a> >- </li> >- </ol> >- <p> >- <a class="cancel" id="cancel_manual_restriction" href="#">Cancel</a> >- </p> >- </fieldset> >- <!-- /#manual_restriction_form --> >- [% END # /IF CAN_user_borrowers_edit_borrowers %] >- </fieldset> >- <!-- /#memberentry_restrictions --> >- [% END # /IF ( step_3 ) %] >- >- [% IF ( step_7 ) %] >- [% IF Koha.Preference('HouseboundModule') %] >- <fieldset class="rows" id="memberentry_housebound_roles"> >- <legend class="expanded" id="housebound_roles"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Housebound roles >- </legend> >- <ol class="radio"> >- <li> >- <label class="radio" for="housebound_chooser"> Chooser: </label> >- [% IF ( housebound_role.housebound_chooser == 1 ) %] >- <label for="yes_housebound_chooser">Yes </label> >- <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" checked="checked" /> >- <label for="no_housebound_chooser">No </label> >- <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" /> >- [% ELSE %] >- <label for="yes_housebound_chooser">Yes </label> >- <input type="radio" id="yes_housebound_chooser" name="housebound_chooser" value="1" /> >- <label for="no_housebound_chooser">No </label> >- <input type="radio" id="no_housebound_chooser" name="housebound_chooser" value="0" checked="checked" /> >- [% END %] >- </li> >- <li> >- <label class="radio" for="housebound_deliverer">Deliverer:</label> >- [% IF ( housebound_role.housebound_deliverer == 1 ) %] >- <label for="yes_housebound_deliverer">Yes </label> >- <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" checked="checked" /> >- <label for="no_housebound_deliverer">No </label> >- <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" /> >- [% ELSE %] >- <label for="yes_housebound_deliverer">Yes </label> >- <input type="radio" id="yes_housebound_deliverer" name="housebound_deliverer" value="1" /> >- <label for="no_housebound_deliverer">No </label> >- <input type="radio" id="no_housebound_deliverer" name="housebound_deliverer" value="0" checked="checked" /> >- [% END %] >- </li> >- </ol> >- <!-- /ol.radio --> >- </fieldset> >- <!-- /#memberentry_housebound_roles --> >- [% END # hide fieldset %] >- [% END # IF step_7 %] >- >- [% IF ( step_4 ) %] >- [% IF Koha.Preference('ExtendedPatronAttributes') %] >- [% UNLESS ( no_patron_attribute_types ) %] >- <fieldset class="rows" id="memberentry_patron_attributes"> >- <legend class="expanded" id="patron_attributes_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Additional attributes and identifiers >- </legend> >- <input type="hidden" name="setting_extended_patron_attributes" value="1" /> >- [% FOREACH pa_loo IN patron_attributes %] >- <ol class="attributes_table"> >- <div id="aai_[% pa_loo.class | html %]"> >- [% IF pa_loo.class %] >- <h3 id="[% pa_loo.class | html %]_lgd">[% pa_loo.lib | html %]</h3> >- [% END %] >- [% FOREACH patron_attribute IN pa_loo.items %] >- <li data-category_code="[% patron_attribute.category_code | html %]" data-pa_code="[% patron_attribute.code | replace('[^a-zA-Z0-9_-]', '') %]"> >- [% IF patron_attribute.mandatory %] >- <label for="[% patron_attribute.form_id | html %]" class="required" required="required">[% patron_attribute.description | html %]: </label> >- [% ELSE %] >- <label for="[% patron_attribute.form_id | html %]">[% patron_attribute.description | html %]: </label> >- [% END %] >- [% IF ( patron_attribute.use_dropdown ) %] >- <select id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" [% IF patron_attribute.mandatory %]required="required"[% END %]> >- <option value=""></option> >- [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %] >- [% IF auth_val_loo.authorised_value == patron_attribute.value %] >- <option value="[% auth_val_loo.authorised_value | html %]" selected="selected"> [% auth_val_loo.lib | html %] </option> >- [% ELSE %] >- <option value="[% auth_val_loo.authorised_value | html %]"> [% auth_val_loo.lib | html %] </option> >- [% END %] >- [% END %] >- </select> >- [% ELSE %] >- [% IF patron_attribute.mandatory %] >- [% IF patron_attribute.is_date %] >- <input >- type="text" >- id="[% patron_attribute.form_id | html %]" >- name="[% patron_attribute.form_id | html %]" >- maxlength="10" >- size="10" >- value="[% patron_attribute.value | html %]" >- required="required" >- class="flatpickr" >- /> >- [% ELSE %] >- <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]" required="required"> >-[% patron_attribute.value | html %]</textarea >- > >- [% END %] >- [% ELSE %] >- [% IF patron_attribute.is_date %] >- <input >- type="text" >- id="[% patron_attribute.form_id | html %]" >- name="[% patron_attribute.form_id | html %]" >- maxlength="10" >- size="10" >- value="[% patron_attribute.value | html %]" >- class="flatpickr" >- /> >- [% ELSE %] >- <textarea rows="2" cols="30" id="[% patron_attribute.form_id | html %]" name="[% patron_attribute.form_id | html %]">[% patron_attribute.value | html %]</textarea> >- [% END %] >- [% END %] >- [% END # /IF ( patron_attribute.use_dropdown ) %] >- <input type="hidden" id="[% patron_attribute.form_id | html %]_code" name="[% patron_attribute.form_id | html %]_code" value="[% patron_attribute.code | html %]" /> >- [% IF ( !patron_attribute.is_date ) %] >- <a href="#" class="clear_attribute"><i class="fa fa-fw fa-trash-can"></i> Clear</a> >- [% END %] >- [% IF ( patron_attribute.repeatable ) %] >- <a href="#" class="clone_attribute"><i class="fa fa-fw fa-plus"></i> New</a> >- [% END %] >- [% IF patron_attribute.mandatory %]<span class="required">Required</span>[% END %] >- </li> >- [% END # /FOREACH patron_attribute %] >- </div> >- </ol> >- [% END # /FOREACH pa_loo %] >- </fieldset> >- <!-- /#memberentry_patron_attributes --> >- [% END # UNLESS ( no_patron_attribute_types ) %] >- [% END # IF Koha.Preference('ExtendedPatronAttributes') %] >- [% END # IF ( step_4 ) %] >- >- [% IF ( step_5 ) %] >- [% IF ( EnhancedMessagingPreferences ) %] >- <fieldset class="rows" id="memberentry_messaging_prefs"> >- <legend class="expanded" id="patron_messaging_prefs_lgd"> >- <i class="fa fa-caret-down" aria-hidden="true"></i> >- Patron messaging preferences >- </legend> >- <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> >- <input type="hidden" name="setting_messaging_prefs" value="1" /> >- [% INCLUDE 'messaging-preference-form.inc' %] >- [% IF ( SMSSendDriver ) %] >- [% IF !nosmsalertnumber %] >- <p> >- <label for="SMSnumber">SMS number:</label> >- <input type="text" id="SMSnumber" name="SMSnumber" value="[% SMSnumber | html %]" /> >- <span class="hint sms_number_help">Please enter numbers only. Prefix the number with + or 00 if including the country code.</span> >- </p> >- [% END %] >- [% IF SMSSendDriver == 'Email' && !nosms_provider_id %] >- <p> >- <label for="sms_provider_id">SMS provider:</label> >- <select id="sms_provider_id" name="sms_provider_id"> >- <option value="">Unknown</option> >- [% FOREACH s IN sms_providers %] >- [% IF s.id == borrower_data.sms_provider_id %] >- <option value="[% s.id | html %]" selected="selected">[% s.name | html %]</option> >- [% ELSE %] >- <option value="[% s.id | html %]">[% s.name | html %]</option> >- [% END %] >- [% END %] >- </select> >- </p> >- [% END # /UNLESS nosms_provider_id %] >- [% END # IF ( SMSSendDriver ) %] >- </fieldset> >- [% END # IF ( EnhancedMessagingPreferences ) %] >- [% END # /IF step_5 %] >- </form> >- <!-- /#entryform --> >- >- [% IF quickadd && op == 'add_form' && !check_member %] >- <form method="get" id="quick_add_form" class="toggler"> >- <fieldset class="rows quick_add" >- ><legend>Quick add</legend> >- <ol id="quick_add_list"> </ol> >- </fieldset> >- </form> >- [% END %] >- [% END # /UNLESS ( no_add ) %] >- </main> >- </div> >- <!-- /.col-md-10.order-md-2 --> >- >- [% UNLESS ( op == 'add_form' ) %] >- <div class="col-md-2 order-sm-2 order-md-1"> >- <aside> [% INCLUDE 'circ-menu.inc' %] </aside> >- </div> >- <!-- /.col-md-2.order-md-1 --> >- [% END %] >- </div> >- <!-- /.row --> >-</div> >-<!-- /.main.container-fluid --> >- >-[% MACRO jsinclude BLOCK %] >- [% INCLUDE 'calendar.inc' %] >- [% INCLUDE 'str/members-menu.inc' %] >- [% Asset.js("js/members-menu.js") | $raw %] >- <script> >- function update_cardnumber_warning(size){ >- var max_len = [% maxlength_cardnumber | html %]; >- if ( size >= max_len ) { >- $("#cn_max").show(); >- } else { >- $("#cn_max").hide(); >- } >- } >- >- function toggle_guarantor_field(rel_number){ >- $(".relation-"+rel_number).prop('disabled', (i, v) => !v); >- } >- >- function showHideFields(){ >- $("#messaging_prefs_loading, #guarantor_template").hide(); >- [% UNLESS step == 1 %] >- [% IF fieldstohide.match('identity') %] >- togglePanel( $("#identity_lgd") ); >- [% END %] >- [% IF show_guarantor || guarantor %] >- [% IF fieldstohide.match('guarantor') %] >- togglePanel( $("#patron_guarantor_lgd") ); >- [% END %] >- [% IF fieldstohide.match('nonpatron_guarantor') %] >- togglePanel( $("#non_patron_guarantor_lgd") ); >- [% END %] >- [% END %] >- [% IF fieldstohide.match('primary_address') %] >- togglePanel( $("#main_address_lgd") ); >- [% END %] >- [% IF fieldstohide.match('primary_contact') %] >- togglePanel( $("#contact_lgd") ); >- [% END %] >- [% END %] >- [% UNLESS step == 6 %] >- [% IF fieldstohide.match('alt_address') %] >- togglePanel( $("#alt_address_lgd") ); >- [% END %] >- [% END %] >- [% UNLESS step == 2 %] >- [% IF fieldstohide.match('alt_contact') %] >- togglePanel( $("#alt_contact_lgd") ); >- [% END %] >- [% END %] >- [% UNLESS step == 3 %] >- [% IF fieldstohide.match('lib_mgmt') %] >- togglePanel( $("#library_management_lgd") ); >- [% END %] >- [% UNLESS nodateenrolled && noopacnote && noborrowernotes %] >- [% IF fieldstohide.match('lib_setup') %] >- togglePanel( $("#library_setup_lgd") ); >- [% END %] >- [% END %] >- [% UNLESS nouserid && nopassword %] >- [% IF fieldstohide.match('login') %] >- togglePanel( $("#opac_staff_login_lgd") ); >- [% END %] >- [% END %] >- [% UNLESS ( op == 'add_form' || op == 'duplicate' ) %] >- [% IF fieldstohide.match('flags') %] >- togglePanel( $("#account_flags_lgd") ); >- [% END %] >- [% END %] >- [% IF fieldstohide.match('debarments') %] >- togglePanel( $("#restrictions_lgd") ); >- [% END %] >- [% END %] >- [% UNLESS step == 7 %] >- [% IF Koha.Preference('HouseboundModule') %] >- [% IF fieldstohide.match('housebound') %] >- togglePanel( $("#housebound_roles") ); >- [% END %] >- [% END %] >- [% END %] >- [% UNLESS step == 4 %] >- [% IF Koha.Preference('ExtendedPatronAttributes') %] >- [% IF fieldstohide.match('additional') %] >- togglePanel( $("#patron_attributes_lgd") ); >- [% END %] >- [% END %] >- [% END %] >- [% UNLESS step == 5 %] >- [% IF Koha.Preference('EnhancedMessagingPreferences') %] >- [% IF fieldstohide.match('messaging') %] >- togglePanel( $("#patron_messaging_prefs_lgd") ); >- $("#messaging_prefs_loading").toggle(); >- [% END %] >- [% END %] >- [% END %] >- } >- >- function togglePanel( node ){ >- var panel = node.nextAll(); >- if(panel.is(":visible")){ >- node.addClass("collapsed").removeClass("expanded").attr("title", _("Click to expand this section") ); >- panel.hide(); >- } else { >- node.addClass("expanded").removeClass("collapsed").attr("title", _("Click to collapse this section") ); >- panel.show(); >- panel.find("input, select, textarea").eq(0).focus(); >- } >- } >- >- $(document).ready(function() { >- showHideFields(); >- $("#toggle_hidden_fields").change(function(){ >- showHideFields(); >- }); >- >- $(".collapsed,.expanded").on("click",function(){ >- togglePanel( $(this) ); >- $("#messaging_prefs_loading").hide(); >- $("#guarantor_template").hide(); >- }); >- >- $("#saverecord").css({ 'margin-left': 0 }); >- >- [% IF borrower_data.categorycode %] >- update_category_code( "[% borrower_data.categorycode | html %]" ); >- [% ELSE %] >- if ( $("#categorycode_entry").length > 0 ){ >- var category_code = $("#categorycode_entry").find("option:selected").val(); >- update_category_code( category_code ); >- } >- [% END %] >- >- [% IF new_guarantors %] >- [% FOREACH g IN new_guarantors %] >- select_user( '[% g.patron.borrowernumber | html %]', [% To.json( g.patron.unblessed ) | $raw %], '[% g.relationship | html %]' ); >- [% END %] >- [% END %] >- >- $("#cn_max").hide(); >- var content; >- $("#cardnumber").on("keydown", function(e){ >- content = $(this).val(); >- }); >- $("#cardnumber").on("keyup", function(e){ >- // .val() will return the value of the input after the key has been released >- var l = $(this).val().length; >- if ( l == content.length + 1 ) { l--; } >- update_cardnumber_warning(l); >- }); >- $("#cardnumber").bind("paste", function(e){ >- var pastedData = e.originalEvent.clipboardData.getData('text'); >- update_cardnumber_warning(pastedData.length - 1); >- } ); >- var toggle_quick_add = $(".toggle_quick_add"); >- $(toggle_quick_add).click(function(e){ >- toggle_quick_add.toggle(); >- e.preventDefault(); >- var toggle_to = ''; >- var toggle_from = ''; >- if( $("#entryform:visible").length ) { >- toggle_to = "#quick_add_form label"; >- toggle_from = "#entryform label"; >- $("#memberentry_guarantor").appendTo("#quick_add_form"); >- } else { >- toggle_to="#entryform label"; >- toggle_from = "#quick_add_form label"; >- $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor"); >- } >- $(toggle_from).each(function() { >- var input_label = $(this).attr('for'); >- if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' || input_label == 'sex-other' ) { >- $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') ); >- return; >- } >- $(toggle_to+"[for='"+input_label+"']").next().val( $(this).next().val() ); >- }); >- >- $(".toggler").toggle(); >- }); >- >- $("#save_quick_add").click(function(){ >- $("#quick_add_form").validate(); >- if( $("#quick_add_form").valid()){ >- $('.toggle_quick_add').click(); >- $("#memberentry_guarantor").appendTo("#memberentry_guarantor_anchor"); >- $('#saverecord').click(); >- } >- else {return false;} >- }); >- >- $("#saverecord").click(function(){ >- if( check_form_borrowers() ){ >- $("#entryform").submit(); >- } >- }); >- >- $('#not-duplicate').on('click', function() { >- $("input[name='nodouble']").val('1'); >- $('#entryform').submit(); >- }); >- >- $(".popup_patronview").on("click", function(e){ >- e.preventDefault(); >- var url = $(this).attr("href"); >- openWindow( url, "patronview" ); >- }); >- >- $("#dateofbirth").on("change", function(){ >- write_age(); >- }); >- >- $("#debarred_comment, #debarred_expiration").on("change", function(){ >- $("#add_debarment").val(1); >- }); >- >- $("#clear_debarred_expiration").on("click", function(e){ >- e.preventDefault(); >- $('#debarred_expiration').val(""); >- }); >- >- $("#memberentry_patron_attributes").on("click", ".clear_attribute", function(e){ >- e.preventDefault(); >- clear_entry( this ); >- }); >- >- $("#memberentry_patron_attributes").on("click", ".clone_attribute", function(e){ >- e.preventDefault(); >- clone_entry( this ); >- }); >- >- $("#categorycode_entry").on("change", function(){ >- update_category_code(this); >- }); >- >- [% IF logged_in_user.borrowernumber == borrowernumber %] >- $("#userid").on("change", function(){ >- $(this).parent().find("div.hint").remove(); >- if ( "[% borrower_data.userid | html %]" != $(this).val() ) { >- $(this).parent().append('<div class="hint">%s</div>'.format(_("You will be logged out if you modify your username"))); >- } >- }); >- [% END %] >- >- }); >- >- [% IF quickadd && op == 'add_form' && !check_member %] >- $(document).ready(function () { >- >- $("#entryform,#saverecord").hide(); >- [% q_add_f = Koha.Preference('PatronQuickAddFields').split('\|') %] >- var qaddfields = [[% FOREACH field IN q_add_f.unique %]"[% field | html %]",[% END %]]; >- $("#entryform label").each(function () { >- var input_label = $(this).attr('for'); >- if ( input_label == 'sex-female' ) { >- input_label='sex'; >- } >- else if ( input_label == 'btitle' ) { >- input_label='title'; >- } >- if( qaddfields.indexOf( input_label ) != -1 || $(this).attr('class') == 'required' ){ >- let orig_li = $(this).parent(); >- if( orig_li.attr('class') == 'radio' ){ >- let new_field = orig_li.clone(); >- new_field.children('label').each(function(){ >- let child_input = $(this).children('input'); >- child_input.attr("id",child_input.attr("id") + "_quick_add"); >- }); >- new_field.appendTo("#quick_add_list"); >- } else { >- let orig_input_id = orig_li.children("input,textarea,select").last().attr("id"); >- if ( orig_input_id ) { >- let new_field = orig_li.clone(); >- new_field.children("#"+orig_input_id).attr("id",orig_input_id + "_quick_add"); >- new_field.appendTo("#quick_add_list"); >- } >- [% UNLESS mandatorypassword %] >- if( input_label == 'password' ){ >- let orig_p2 = $("#entryform label[for='password2']").parent(); >- let new_p2 = orig_p2.clone(); >- new_p2.find('input[id="password2"]').attr("id","password2_quick_add"); >- new_p2.appendTo("#quick_add_list"); >- } >- [% END %] >- } >- } >- }); >- if ( $("#memberentry_guarantor").length ) { >- $("#memberentry_guarantor").appendTo("#quick_add_form"); >- } >- $("#quick_add_form").show(); >- $("#quick_add_form").find(".flatpickr:hidden").each( (i, input) => { >- $(input).siblings(".flatpickr_wrapper").remove(); // Remove leftover from the previous flatpickr that has been cloned >- apply_flatpickr(input); >- } ); >- }); >- [% END %] >- $("#guarantor_template").hide(); >- var prefill_fields; >- var to_api_mapping; >- [% IF prefill_fields %] >- prefill_fields = [% To.json(prefill_fields) | $raw %]; >- [% END %] >- [% IF to_api_mapping %] >- to_api_mapping = [% To.json(to_api_mapping) | $raw %]; >- [% END %] >- >- var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %]; >- var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %]; >- </script> >- [% Asset.js("js/members.js") | $raw %] >- [% Asset.js("js/messaging-preference-form.js") | $raw %] >- [% 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 %] >- >- [% INCLUDE 'select2.inc' %] >- [% SET columns = ['cardnumber','name','category','branch','dateofbirth','address-library','action'] %] >- [% PROCESS patron_search_modal columns => columns, modal_title => t("Add guarantor") %] >- [% PROCESS patron_search_js columns => columns, actions => ["select"], preview_on_name_click => 1 %] >-[% END %] >- >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >index bf6c5904fac..e69de29bb2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt >@@ -1,331 +0,0 @@ >-[% USE raw %] >-[% USE Branches %] >-[% USE Koha %] >-[% USE Asset %] >-[% PROCESS 'i18n.inc' %] >-[% SET footerjs = 1 %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title >- >[% FILTER collapse %] >- [% IF( do_it ) %] >- [% t("Results") | html %] >- › >- [% END %] >- [% t("Patrons statistics") | html %] >- › [% t("Reports") | html %] › [% t("Koha") | html %] >- [% END %]</title >-> >- >-[% INCLUDE 'doc-head-close.inc' %] >-<style> >- .sql { >- display: none; >- } >- .debug { >- display: none; >- } >-</style> >-</head> >- >-<body id="rep_borrowers_stats" class="rep"> >-[% WRAPPER 'header.inc' %] >- [% INCLUDE 'cat-search.inc' %] >-[% END %] >- >-[% WRAPPER 'sub-header.inc' %] >- [% WRAPPER breadcrumbs %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> >- [% END %] >- [% IF ( do_it ) %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/reports/borrowers_stats.pl">Patrons statistics</a> >- [% END %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Results</span> >- [% END %] >- [% ELSE %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Patrons statistics</span> >- [% END %] >- [% END %] >- [% END #/ WRAPPER breadcrumbs %] >-[% END #/ WRAPPER sub-header.inc %] >- >-[% WRAPPER 'main-container.inc' aside='reports-menu' %] >- <h1>Patrons statistics</h1> >- [% IF ( do_it ) %] >- [% FOREACH mainloo IN mainloop %] >- [% IF ( mainloo.loopfilter.size>0 ) %] >- <p>Filtered on:</p> >- [% FOREACH loopfilte IN mainloo.loopfilter %] >- <p> [% loopfilte.crit | html %] = [% loopfilte.filter | html %] </p> >- [% END %] >- [% END %] >- <table> >- <tr> >- <th>[% mainloo.line | html %] / [% mainloo.column | html %]</th> >- [% FOREACH loopco IN mainloo.loopcol %] >- <th>[% IF ( loopco.coltitle_display ) %][% loopco.coltitle_display | html %][% ELSE %][% loopco.coltitle | html %][% END %] </th> >- [% END %] >- <th>TOTAL</th> >- </tr> >- [% FOREACH loopro IN mainloo.looprow %] >- <tr> >- <td>[% IF ( loopro.rowtitle_display ) %][% loopro.rowtitle_display | html %][% ELSE %][% loopro.rowtitle | html %][% END %] </td> >- [% FOREACH loopcel IN loopro.loopcell %] >- <td>[% IF ( loopcel.value ) %][% loopcel.value | html %][% ELSE %] [% END %] </td> >- [% END %] >- <td>[% loopro.totalrow | html %]</td> >- </tr> >- [% END %] >- <tr> >- <th>TOTAL</th> >- [% FOREACH loopfoote IN mainloo.loopfooter %] >- <th>[% loopfoote.totalcol | html %]</th> >- [% END %] >- <th>[% mainloo.total | html %]</th> >- </tr> >- </table> >- [% END %] >- [% ELSE %] >- <form method="get" action="/cgi-bin/koha/reports/borrowers_stats.pl"> >- <fieldset class="rows" >- ><legend>Patrons statistics</legend> >- <table> >- <thead> >- <tr> >- <th>Title</th> >- <th>Row</th> >- <th>Column</th> >- <th>Filter</th> >- </tr> >- </thead> >- <tbody> >- <tr> >- <td>Patron category</td> >- <td><input type="radio" name="Line" value="categorycode" /></td> >- <td><input type="radio" checked="checked" name="Column" value="categorycode" /></td> >- <td> >- <select name="Filter" id="catcode"> >- <option value=""></option> >- [% FOREACH patron_category IN patron_categories %] >- <option value="[% patron_category.categorycode | html %]">[% patron_category.description | html %]</option> >- [% END %] >- </select> >- </td> >- </tr> >- <tr> >- <td>Patron status</td> >- <td colspan="2"></td> >- <td >- ><select name="status" >- ><option value=""> </option >- ><option value="debarred">restricted</option >- ><option value="gonenoadress">gone no address</option >- ><option value="lost">lost</option></select >- ></td >- > >- </tr> >- <tr> >- <td>Patron activity</td> >- <td colspan="2" >- ><select name="period" id="period"> >- <option value="1">1</option> >- <option value="2">2</option> >- <option value="3">3</option> >- </select> >- <label for="period">years of activity</label> >- </td> >- <td >- ><select name="activity" >- ><option value=""> </option >- ><option value="active">active</option >- ><option value="nonactive">no active</option></select >- ></td >- > >- </tr> >- >- <tr> >- <td rowspan="2">ZIP/Postal code</td> >- <td><input type="radio" name="Line" value="zipcode" /></td> >- <td><input type="radio" name="Column" value="zipcode" /></td> >- <td >- ><select name="Filter" id="zipcode"> >- <option value=""> </option> >- [% FOREACH ZIP_LOO IN ZIP_LOOP %] >- <option value="[% ZIP_LOO.zipcode | html %]">[% ZIP_LOO.zipcode | html %]</option> >- [% END %] >- </select> >- </td> >- </tr> >- <tr> >- <td colspan="2" >- ><select name="digits" id="digits"> >- <option value=""> </option> >- <option value="1">1</option> >- <option value="2">2</option> >- <option value="3">3</option> >- <option value="4">4</option> >- <option value="5">5</option> >- <option value="6">6</option> >- <option value="7">7</option> >- <option value="8">8</option> >- <option value="9">9</option> >- <option value="10">10</option> >- </select> >- <label for="digits">digits</label> >- </td> >- <td> </td> >- </tr> >- >- <tr> >- <td>Library</td> >- <td><input type="radio" checked="checked" name="Line" value="branchcode" /></td> >- <td><input type="radio" name="Column" value="branchcode" /></td> >- <td> >- <select name="Filter" id="branch"> >- <option value=""></option> >- [% FOREACH l IN Branches.all( unfiltered => 1 ) %] >- <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option> >- [% END %] >- </select> >- </td> >- </tr> >- <tr> >- <td>Date of birth</td> >- <td colspan="2"></td> >- <td> >- <label for="from">From</label> >- <input type="text" size="10" id="from" name="Filter" class="flatpickr" data-date_to="to" /> >- <label for="to">To</label> >- <input size="10" id="to" name="Filter" value="" type="text" class="flatpickr" /> >- <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >- </td> >- </tr> >- <tr> >- <td>Gender</td> >- <td><input type="radio" name="Line" value="sex" /></td> >- <td><input type="radio" name="Column" value="sex" /></td> >- <td> >- <select id="sex" name="Filter"> >- <option value="" /> >- <option value="M">Men</option> >- <option value="F">Women</option> >- </select> >- </td> >- </tr> >- [% IF ( SORT1_LOOP ) %] >- <tr> >- <td>Sort1</td> >- <td><input type="radio" name="Line" value="sort1" /></td> >- <td><input type="radio" name="Column" value="sort1" /></td> >- <td> >- <select id="sort1" name="Filter"> >- <option value="" /> >- [% FOREACH SORT1_LOO IN SORT1_LOOP %] >- <option value="[% SORT1_LOO.authorized_value | html %]">[% SORT1_LOO.lib | html %]</option> >- [% END %] >- </select> >- </td> >- </tr> >- [% ELSE %] >- <input type="hidden" name="Filter" /> >- [% END %] >- [% IF ( SORT2_LOOP ) %] >- <tr> >- <td>Sort2</td> >- <td><input type="radio" name="Line" value="sort2" /></td> >- <td><input type="radio" name="Column" value="sort2" /></td> >- <td> >- <select id="sort2" name="Filter"> >- <option value="" /> >- [% FOREACH SORT2_LOO IN SORT2_LOOP %] >- <option value="[% SORT2_LOO.value | html %]">[% SORT2_LOO.value | html %]</option> >- [% END %] >- </select> >- </td> >- </tr> >- [% ELSE %] >- <input type="hidden" name="Filter" /> >- [% END %] >- [% IF Koha.Preference('ExtendedPatronAttributes') %] >- <tr> >- <th colspan="4">Patron attributes</th> >- </tr> >- [% FOREACH pa_loo IN patron_attributes %] >- [% IF (pa_loo.class) %] >- <tr> >- <th>[% pa_loo.class | html %] ([% pa_loo.lib | html %])</th> >- <th colspan="3"></th> >- </tr> >- [% END %] >- [% FOREACH patron_attribute IN pa_loo.items %] >- <tr data-category_code="[% patron_attribute.category_code | html %]"> >- <td> [% patron_attribute.code | html %] ([% patron_attribute.description | html %]) </td> >- <td> >- <input type="radio" name="Line" value="patron_attr.[% patron_attribute.code | html %]" /> >- </td> >- <td> >- <input type="radio" name="Column" value="patron_attr.[% patron_attribute.code | html %]" /> >- </td> >- <td> >- [% IF ( patron_attribute.use_dropdown ) %] >- <select name="Filter_patron_attr.[% patron_attribute.code | html %]"> >- <option value="" /> >- [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %] >- <option value="[% auth_val_loo.authorised_value | html %]"> [% auth_val_loo.lib | html %] </option> >- [% END %] >- </select> >- [% ELSE %] >- <input type="text" maxlength="64" name="Filter_patron_attr.[% patron_attribute.code | html %]" /> >- [% END %] >- </td> >- </tr> >- [% END %] >- [% END %] >- [% END %] >- </tbody> >- </table> >- </fieldset> >- >- <fieldset class="rows"> >- <legend>Output</legend> >- <ol> >- <li> <label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li> >- <li> >- <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" /> <label class="inline" for="basename">Named: </label >- ><input type="text" name="basename" id="basename" value="Export" /> >- <label class="inline" for="MIME">Into an application:</label> >- <select name="MIME" id="MIME"> >- [% FOREACH value IN CGIextChoice %] >- <option value="[% value | html %]">[% value | html %]</option> >- [% END %] >- </select> >- <select name="sep" id="sep"> >- [% FOREACH value IN CGIsepChoice.values.sort() %] >- [% IF ( value == CGIsepChoice.default ) %] >- <option value="[% value | html %]" selected="selected">[% value | html %]</option> >- [% ELSE %] >- <option value="[% value | html %]">[% value | html %]</option> >- [% END %] >- [% END %] >- </select> >- </li> >- </ol> >- </fieldset> >- >- <fieldset class="action"> >- <input type="submit" class="btn btn-primary" value="Submit" /> >- <input type="hidden" name="report_name" value="[% report_name | html %]" /> >- <input type="hidden" name="do_it" value="1" /> >- </fieldset> >- </form> >- [% END %] >-[% END %] >- >-[% MACRO jsinclude BLOCK %] >- [% INCLUDE 'calendar.inc' %] >-[% END %] >- >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index 4fc7daf7d70..e69de29bb2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -1,652 +0,0 @@ >-[% USE raw %] >-[% USE Asset %] >-[% USE Koha %] >-[% USE KohaDates %] >-[% USE Branches %] >-[% USE Categories %] >-[% USE TablesSettings %] >-[% PROCESS 'i18n.inc' %] >-[% SET footerjs = 1 %] >-[% INCLUDE 'doc-head-open.inc' %] >-<title >- >[% FILTER collapse %] >- [% IF ( op == 'show' or op == 'show_results' ) %] >- [% IF ( op == 'show' ) %] >- [% t("Modifications") | html %] >- › >- [% ELSE %] >- [% t("Results") | html %] >- › >- [% END %] >- [% END %] >- [% t("Batch patron modification") | html %] >- › [% t("Tools") | html %] › [% t("Koha") | html %] >- [% END %]</title >-> >-[% INCLUDE 'doc-head-close.inc' %] >-</head> >- >-<body id="tools_modborrowers" class="tools"> >-[% WRAPPER 'header.inc' %] >- [% INCLUDE 'cat-search.inc' %] >-[% END %] >- >-[% WRAPPER 'sub-header.inc' %] >- [% WRAPPER breadcrumbs %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> >- [% END %] >- [% IF ( op == 'show' or op == 'show_results' ) %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/tools/modborrowers.pl">Batch patron modification</a> >- [% END %] >- [% IF ( op == 'show' ) %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- [% t("Modifications") | html %] >- [% END %] >- [% ELSE %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- [% t("Results")| html %] >- [% END %] >- [% END %] >- [% ELSE %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Batch patron modification</span> >- [% END %] >- [% END %] >- [% END #/ WRAPPER breadcrumbs %] >-[% END #/ WRAPPER sub-header.inc %] >- >-[% WRAPPER 'main-container.inc' aside='tools-menu' %] >- >- [% IF ( op == 'show_form' ) %] >- <h1>Batch patron modification</h1> >- <form id="patron_batchmod_form" method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/modborrowers.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-show" /> >- >- [% WRAPPER tabs id= "batch_patron_options" %] >- [% WRAPPER tabs_nav %] >- [% WRAPPER tab_item tabname= "usecardnumber" bt_active= 1 %]<span>By card number</span>[% END %] >- [% WRAPPER tab_item tabname= "useborrowernumber" %]<span>By borrowernumber</span>[% END %] >- [% IF patron_lists %] >- [% WRAPPER tab_item tabname= "uselist" %]<span>By patron list</span>[% END %] >- [% END %] >- [% END # /WRAPPER tabs_nav %] >- >- [% WRAPPER tab_panels %] >- [% WRAPPER tab_panel tabname="usecardnumber" bt_active= 1 %] >- <fieldset class="rows"> >- <legend>Use a file of card numbers</legend> >- <ol> >- <li> >- <label for="cardnumberuploadfile">File: </label> <input type="file" id="cardnumberuploadfile" name="cardnumberuploadfile" /> >- <div class="hint">File must contain one card number per line.</div> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>Or list card numbers one by one</legend> >- <ol> >- <li> >- <label for="cardnumberlist">Card number list (one card number per line): </label> >- <textarea rows="10" cols="30" id="cardnumberlist" name="cardnumberlist">[% cardnumberlist | html %]</textarea> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" class="btn btn-primary" value="Continue" /> >- <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> >- </fieldset> >- [% END # /tab_panel# %] >- >- [% WRAPPER tab_panel tabname="useborrowernumber" %] >- <fieldset class="rows"> >- <legend>Use a file of borrowernumbers</legend> >- <ol> >- <li> >- <label for="borrowernumberuploadfile">File: </label> <input type="file" id="borrowernumberuploadfile" name="borrowernumberuploadfile" /> >- <div class="hint">File must contain one borrowernumber per line.</div> >- </li> >- </ol> >- </fieldset> >- <fieldset class="rows"> >- <legend>List borrowernumbers one by one</legend> >- <ol> >- <li> >- <label for="borrowernumberlist">Borrowernumber list (one number per line): </label> >- <textarea rows="10" cols="30" id="borrowernumberlist" name="borrowernumberlist">[% borrowernumberlist | html %]</textarea> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" class="btn btn-primary" value="Continue" /> >- <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> >- </fieldset> >- [% END # /tab_panel# %] >- >- [% IF patron_lists %] >- [% WRAPPER tab_panel tabname="uselist" %] >- <fieldset class="rows"> >- <legend>Use a patron list</legend> >- <ol> >- <li> >- <label for="patron_list_id">Patron list: </label> >- <select id="patron_list_id" name="patron_list_id"> >- <option value=""> -- Choose a patron list -- </option> >- [% FOREACH pl IN patron_lists %] >- <option value="[% pl.patron_list_id | html %]">[% pl.name | html %]</option> >- [% END %] >- </select> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" class="btn btn-primary" value="Continue" /> >- <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a> >- </fieldset> >- [% END # /tab_panel# %] >- [% END %] >- [% END # /WRAPPER tab_panels %] >- [% END # /WRAPPER tabs %] >- </form> >- [% END %] >- >- [% IF ( op == 'show') && (!borrowers) && (!notfoundcardnumbers) # Alert if no patrons given %] >- [% op = 'noshow' # Change op to prevent display in code below %] >- <h1>Batch patrons modification</h1> >- <div class="alert alert-warning"> >- <p>No patron card numbers or borrowernumbers given.</p> >- <form action="/cgi-bin/koha/tools/modborrowers.pl" method="get"> >- <button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> OK</button> >- </form> >- </div> >- [% END #Alert if no patrons %] >- >- [% IF ( op == 'show' or op == 'show_results' ) %] >- <h1>Batch patron modification</h1> >- [% UNLESS ( op == 'show' ) %] >- <h2>Results</h2> >- [% END %] >- [% IF ( notfoundcardnumbers ) %] >- [% IF ( useborrowernumbers ) -%] >- <div class="alert alert-warning"><p>Warning, the following borrowernumbers were not found:</p></div> >- [% ELSE -%] >- <div class="alert alert-warning"><p>Warning, the following card numbers were not found:</p></div> >- [% END %] >- >- <div class="page-section"> >- <table style="margin:auto;"> >- <thead> >- [% IF ( useborrowernumbers ) -%] >- <tr><th>Borrowernumbers not found</th></tr> >- [% ELSE -%] >- <tr><th>Card numbers not found</th></tr> >- [% END %] >- </thead> >- <tbody> >- [% FOREACH notfoundcardnumber IN notfoundcardnumbers %] >- <tr><td>[% notfoundcardnumber.cardnumber | html %]</td></tr> >- [% END %] >- </tbody> >- </table> >- </div> >- <!-- /.page-section --> >- [% END %] >- >- [% IF ( op == 'show_results' ) %] >- [% IF ( errors ) %] >- <div class="alert alert-warning"> >- <h4>Errors occurred:</h4> >- <ul class="warnings"> >- [% FOREACH error IN errors %] >- [% IF ( error.error == 'can_not_update' ) %] >- <li>Can not update patron. [% IF ( error.cardnumber ) %]Card number: [% error.cardnumber | html %][% END %] (Borrowernumber: [% error.borrowernumber | html %]) </li> >- [% ELSE %] >- <li>[% error.error | html %]</li> >- [% END %] >- [% END %] >- </ul> >- </div> >- [% END %] >- [% END %] >- >- [% BLOCK show_patron_list %] >- [% IF borrowers %] >- <div id="cataloguing_additem_itemlist" class="page-section"> >- <table id="borrowerst"> >- <thead> >- <tr> >- [% IF ( op == 'show' ) %] >- <th class="NoSort"> </th> >- [% ELSE %] >- <th class="NoVisible"> </th> >- [% END %] >- <th>Card number</th> >- <th>Surname</th> >- <th>First name</th> >- <th>Library</th> >- <th>Patron category</th> >- <th>Street number</th> >- <th>Address</th> >- <th>Address 2</th> >- <th>City</th> >- <th>State</th> >- <th>ZIP/Postal code</th> >- <th>Country</th> >- <th>Primary email</th> >- <th>Primary phone</th> >- <th>Other phone</th> >- <th>Fax</th> >- <th>Registration date</th> >- <th>Expiry date</th> >- [% IF CanUpdatePasswordExpiration %] >- <th>Password expiration date</th> >- [% END %] >- [% IF CanUpdateProtectPatron %] >- <th>Protected</th> >- [% END %] >- <th>Circulation note</th> >- <th>OPAC note</th> >- <th>Message</th> >- <th>Restriction expiration</th> >- <th>Restriction comment</th> >- [% FOREACH attrh IN attributes_header %] >- <th>[% attrh.attribute | html %]</th> >- [% END %] >- </tr> >- </thead> >- <tbody> >- [% FOREACH borrower IN borrowers %] >- <tr> >- <td [% IF op != 'show' %]class="NoVisible"[% END %]> >- <input type="checkbox" name="borrowernumber" value="[% borrower.borrowernumber | html %]" checked="checked" /> >- </td> >- <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]">[% borrower.cardnumber | html %]</a></td> >- <td>[% borrower.surname | html %]</td> >- <td>[% borrower.firstname | html %]</td> >- <td>[% Branches.GetName( borrower.branchcode ) | html %]</td> >- <td>[% Categories.GetName(borrower.categorycode) | html %]</td> >- <td>[% borrower.streetnumber | html %]</td> >- <td>[% borrower.address | html %]</td> >- <td>[% borrower.address2 | html %]</td> >- <td>[% borrower.city | html %]</td> >- <td>[% borrower.state | html %]</td> >- <td>[% borrower.zipcode | html %]</td> >- <td>[% borrower.country | html %]</td> >- <td>[% borrower.email | html %]</td> >- <td>[% borrower.phone | html %]</td> >- <td>[% borrower.mobile | html %]</td> >- <td>[% borrower.fax | html %]</td> >- <td data-order="[% borrower.dateenrolled | html %]">[% borrower.dateenrolled | $KohaDates %]</td> >- <td data-order="[% borrower.dateexpiry | html %]">[% borrower.dateexpiry | $KohaDates %]</td> >- [% IF CanUpdatePasswordExpiration %] >- [% IF borrower.password_expiration_date %] >- <td data-order="[% borrower.password_expiration_date | html %]"> [% borrower.password_expiration_date | $KohaDates %] </td> >- [% ELSE %] >- <td data-order="9999-99-99">Never</td> >- [% END %] >- [% END %] >- [% IF CanUpdateProtectPatron %] >- <td> >- [% IF borrower.protected %] >- Yes >- [% ELSE %] >- No >- [% END %] >- </td> >- [% END %] >- <td>[% borrower.borrowernotes | $raw | html_line_break %]</td> >- <td>[% borrower.opacnote | html %]</td> >- <td> >- [% FOREACH patron_message IN borrower.patron_messages %] >- [% patron_message.message | html %] <br /> >- <strong> >- [% IF (patron_message.message_type == 'B') %] >- ( OPAC ) >- [% ELSE %] >- ( Staff ) >- [% END %] </strong >- ><br /><br /> >- [% END %] >- </td> >- <td data-order="[% borrower.debarred | html %]">[% borrower.debarred | $KohaDates %]</td> >- <td>[% borrower.debarredcomment | html %]</td> >- [% FOREACH pa IN borrower.patron_attributes %] >- [% IF ( pa.code ) %] >- [%# Replace pa.attribute with pa.description if we prefer to display the description %] >- <td>[% pa.code | html %]=[% pa.attribute | html %]</td> >- [% ELSE %] >- <td></td> >- [% END %] >- [% END %] >- </tr> >- [% END %] >- </tbody> >- </table> >- </div> >- [% END %] >- [% END %] >- [% IF ( op == 'show' ) %] >- <form name="f" action="modborrowers.pl" method="post" id="batchmod-borrowers-form"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-do" /> >- [% IF ( borrowers ) %] >- <div class="btn-toolbar selections-toolbar" >- ><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 >- > >- [% PROCESS show_patron_list %] >- <div id="cataloguing_additem_newitem"> >- <h2>Edit patrons</h2> >- <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> >- <fieldset class="rows" id="fields_list"> >- <ol> >- [% FOREACH field IN fields %] >- <li> >- <label for="[% field.name | html %]" [% IF field.mandatory %]class="required"[% END %]> >- [% SWITCH ( field.name ) %] >- [% CASE 'surname' %] >- <span>Surname:</span> >- [% CASE 'firstname' %] >- <span>First name:</span> >- [% CASE 'branchcode' %] >- <span>Library:</span> >- [% CASE 'categorycode' %] >- <span>Patron category:</span> >- [% CASE 'streetnumber' %] >- <span>Street number:</span> >- [% CASE 'address' %] >- <span>Address:</span> >- [% CASE 'address2' %] >- <span>Address 2:</span> >- [% CASE 'city' %] >- <span>City:</span> >- [% CASE 'state' %] >- <span>State:</span> >- [% CASE 'zipcode' %] >- <span>ZIP/Postal code:</span> >- [% CASE 'country' %] >- <span>Country:</span> >- [% CASE 'email' %] >- <span>Primary email:</span> >- [% CASE 'phone' %] >- <span>Primary phone:</span> >- [% CASE 'mobile' %] >- <span>Other phone:</span> >- [% CASE 'fax' %] >- <span>Fax:</span> >- [% CASE 'sort1' %] >- <span>Sort 1:</span> >- [% CASE 'sort2' %] >- <span>Sort 2:</span> >- [% CASE 'dateenrolled' %] >- <span>Registration date:</span> >- [% CASE 'dateexpiry' %] >- <span>Expiry date:</span> >- [% CASE 'borrowernotes' %] >- <span>Circulation note:</span> >- [% CASE 'opacnote' %] >- <span>OPAC note:</span> >- [% CASE "message" %] >- <span>Message:</span> >- [% CASE 'debarred' %] >- <span>Restriction expiration:</span> >- [% CASE 'debarredcomment' %] >- <span>Restriction comment:</span> >- [% CASE 'password_expiration_date' %] >- <span>Password expiration date:</span> >- [% CASE 'protected' %] >- <span>Protected:</span> >- [% END %] >- </label> >- [% IF ( field.type == 'text' ) %] >- <input type="text" id="[% field.name | html %]" name="[% field.name | html %]" value="" /> >- [% END %] >- [% IF ( field.type == 'message_type' ) %] >- <input type="text" name="[% field.name | html %]" value="" /> >- <select name="add_message_type" id="message_type"> >- <option value="L">Staff - Internal note</option> >- <option value="B">OPAC</option> >- </select> >- [% END %] >- [% IF ( field.type == 'select' ) %] >- [% IF field.option.size %] >- <select id="[% field.name | html %]" name="[% field.name | html %]"> >- [% FOREACH opt IN field.option %] >- <option value="[% opt.value | html %]">[% opt.lib | html %]</option> >- [% END %] >- </select> >- [% ELSE %] >- There is no value defined for [% field.name | html %] >- [% END %] >- [% END %] >- [% IF ( field.type == 'bool' ) %] >- <select name="[% field.name | html %]"> >- <option value=""></option> >- <option value="1">Yes</option> >- <option value="0">No</option> >- </select> >- [% END %] >- [% IF ( field.type == 'date' ) %] >- <input type="text" name="[% field.name | html %]" id="[% field.name | html %]" value="" size="10" maxlength="10" class="flatpickr" /> >- <a href="#" class="clear-date" id="clear-date-[% field.name | html %]"><i class="fa fa-fw fa-trash-can"></i> Clear</a> >- [% END %] >- [% IF field.mandatory %] >- <input type="checkbox" title="This field is mandatory" name="disable_input" value="[% field.name | html %]" disabled="disabled" readonly="readonly" /> >- <span class="required">Required fields cannot be cleared</span> >- [% ELSE %] >- <input type="checkbox" title="Check to delete this field" name="disable_input" value="[% field.name | html %]" /> >- [% IF ( field.type == 'message_type' ) %] >- <span class="hint">NOTE: Checking this box will remove ALL messages</span> >- [% END %] >- [% END %] >- </li> >- [% END %] >- [% IF ( patron_attributes_codes ) %] >- <li class="attributes"> >- <label for="patron_attributes" style="width:auto;"> >- <span>Patron attribute:</span> >- </label> >- <select id="patron_attributes" name="patron_attributes"> >- <option value=""></option> >- [% FOREACH pac IN patron_attributes_codes %] >- <option value="[% pac.attribute_code | html %]" data-type="[% pac.type | html %]" data-category="[% pac.category_lib | html %]">[% pac.attribute_lib | html %]</option> >- [% END %] >- </select> >- >- <input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" /> >- <span class="patron_attributes_value"><input type="hidden" name="patron_attributes_value" /></span> >- <a href="#" class="add_attributes" title="Add an attribute"><i class="fa fa-fw fa-plus"></i> New</a> >- <span class="information_category hint" style="width:25%;float:right;"></span> >- </li> >- <div class="hint">NOTE: Attributes set here will replace all attributes of the same type in the patron record.</div> >- [% END %] >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" name="mainformsubmit" class="btn btn-primary" value="Save" /> >- <a href="/cgi-bin/koha/tools/modborrowers.pl" class="cancel">Cancel</a> >- [% PROCESS 'members-patron-selections.inc' id="batchmod-borrowers-form" %] >- </fieldset> >- </div> >- [% END %] >- </form> >- [% END %] >- [% END %] >- [% IF ( op == 'show_results' ) %] >- <p> >- <a href="/cgi-bin/koha/tools/modborrowers.pl" title="New batch patrons modification">New batch patron modification</a> >- </p> >- [% END %] >-[% END %] >- >-[% MACRO jsinclude BLOCK %] >- [% INCLUDE 'calendar.inc' %] >- [% INCLUDE 'datatables.inc' %] >- [% INCLUDE 'columns_settings.inc' %] >- [% Asset.js("js/tools-menu.js") | $raw %] >- [% Asset.js("js/members-patron-selections.js") | $raw %] >- <script> >- var patron_attributes_lib = new Array(); >- var patron_attributes_values = new Array(); >- var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_patron_modification', 'borrowerst', 'json' ) | $raw %]; >- >- [% FOREACH attrh IN attributes_header %] >- table_settings["columns"].push({ >- columname: "[% attrh.attribute | html %]", >- cannot_be_modified: 0, >- cannot_be_toggled: 0, >- is_hidden: 0 >- }); >- [% END %] >- $(document).ready(function() { >- [% IF borrowers %] >- let patron_table = KohaTable("borrowerst", { >- "order": [[ 1, "asc" ]], >- "autoWidth": true, >- }, table_settings); >- >- $("#selectallbutton").click(function() { >- $("#borrowerst").find("input:checkbox").each(function() { >- $(this).prop("checked", true); >- }); >- return false; >- }); >- $("#clearallbutton").click(function() { >- $("#borrowerst").find("input:checkbox").each(function() { >- $(this).prop("checked", false); >- }); >- return false; >- }); >- [% END %] >- >- var values = new Array(); >- var lib = new Array(); >- [% FOREACH pav IN patron_attributes_values %] >- values = new Array(); >- lib = new Array(); >- [% FOREACH option IN pav.options %] >- values.push("[% option.lib | html %]"); >- lib.push("[% option.authorised_value | html %]"); >- [% END %] >- patron_attributes_lib["[% pav.attribute_code | html %]"] = values; >- patron_attributes_values["[% pav.attribute_code | html %]"] = lib; >- [% END %] >- >- $('select[name="patron_attributes"]').change(function() { >- updateAttrValues(this); >- } ); >- >- $('select[name="patron_attributes"]').change(); >- >- $(".clear-date").on("click",function(e){ >- e.preventDefault(); >- var fieldID = this.id.replace("clear-date-",""); >- $("#" + fieldID).val(""); >- }); >- $("#cataloguing_additem_newitem").on("click",".add_attributes",function(e){ >- e.preventDefault(); >- add_attributes(); >- }); >- $("#cataloguing_additem_newitem").on("click",".del_attributes",function(e){ >- e.preventDefault(); >- del_attributes(this); >- }); >- $("#patron_batchmod_form").on("submit", function(){ >- /* Reset form fields on inactive tabs */ >- var tab = $(this).find('ul.nav-tabs li a.active').attr('href'); >- if ( tab == '#usecardnumber_panel' ) { >- $("#borrowernumberuploadfile, #patron_list_id, #borrowernumberlist").val(""); >- } else if ( tab == '#useborrowernumber_panel' ) { >- $("#cardnumberuploadfile, #cardnumberlist, #patron_list_id").val(""); >- } else { // uselist_panel >- $("#borrowernumberuploadfile, #cardnumberuploadfile, #borrowernumberlist, #cardnumberlist").val(""); >- } >- }); >- >- $('form[name="f"]').on("submit", function(){ >- // Add the checkboxes to the DOM before we submit the form >- var form = this; >- var checkboxes = patron_table.$('input:checkbox:checked').serializeArray(); >- $.each(checkboxes, function(){ >- let borrowernumber = this.value; >- if(!$(form).find('input[name="borrowernumber"][value="'+borrowernumber+'"]').length){ >- $(form).append( >- $('<input>') >- .attr('type', 'hidden') >- .attr('name', 'borrowernumber') >- .val(borrowernumber) >- ); >- } >- }); >- }); >- }); >- >- function updateAttrValues (select_attr) { >- var attr_code = $(select_attr).val(); >- var selected_option = $(select_attr).find("option:selected"); >- var type = $(selected_option).attr('data-type'); >- var category = $(selected_option).attr('data-category'); >- var li_node = $(select_attr).parent(); >- var span = $(li_node).find('span.patron_attributes_value'); >- var information_category_node = $(li_node).find('span.information_category'); >- information_category_node.html(""); >- >- if ( category && category.length > 0 ) { >- information_category_node.html(_("This attribute will be only applied to the patron's category %s").format(category)); >- } >- var disable_input_node = $(li_node).find("input:checkbox[name='disable_input']"); >- if ( type == 'select' ) { >- var options = '<option value = ""></option>'; >- for ( var i = 0 ; i < patron_attributes_values[attr_code].length ; i++ ) { >- options += '<option value="'+patron_attributes_values[attr_code][i]+'">'+patron_attributes_lib[attr_code][i]+'</option>'; >- } >- span.html('<select name="patron_attributes_value">' + options + '</select>'); >- $(disable_input_node).show(); >- } else if ( $(selected_option).val() != "" ) { >- span.html('<input type="text" name="patron_attributes_value"/>'); >- $(disable_input_node).show(); >- } else { >- span.html('<input type="hidden" name="patron_attributes_value" />'); >- $(disable_input_node).hide(); >- } >- } >- >- function add_attributes() { >- var count = $("li.attributes").length; >- var li_node = $("li.attributes:last"); >- var li_clone = $(li_node).clone(); >- if ( $(li_clone).find("a.del_attributes").length == 0 ) { >- var add_attributes = $(li_clone).find("a.add_attributes") >- $(add_attributes).after('<a href="#" title="' + _("Delete") + '" class="del_attributes"><i class="fa fa-fw fa-trash-can"></i> ' + _("Delete") + '</a>'); >- } >- li_node.find("label").attr("for", li_node.find("label").attr("for") + "_" + count ); >- li_node.find("input, select").attr("id", li_node.find("select").attr("id") + "_" + count ); >- >- $(li_clone).find('select[name="patron_attributes"]').change(function() { >- updateAttrValues(this); >- } ); >- >- $(li_clone).find('select[name="patron_attributes"]').change(); >- >- $("#fields_list>ol").append(li_clone); >- update_attr_values(); >- } >- >- function del_attributes(a_node) { >- $(a_node).parent('li').remove(); >- update_attr_values(); >- } >- >- function update_attr_values() { >- $("li.attributes").each(function(i) { >- $(this).find("input:checkbox").val("attr"+i+"_value"); >- }); >- } >- function clearDate(nodeid) { >- $("#"+nodeid).val(""); >- } >- </script> >-[% END %] >- >-[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index a20561cfe0b..e770b2c1d21 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -77,7 +77,7 @@ function update_category_code(category_code) { > var mytables = $(".attributes_table"); > $(mytables).find("li").hide(); > $(mytables) >- .find(" li[data-category_code='" + category_code + "']") >+ .find(" li[data-category_code~='" + category_code + "']") > .show(); > $(mytables).find(" li[data-category_code='']").show(); > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index c86f9f39e14..e69de29bb2d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -1,1372 +0,0 @@ >-[% USE raw %] >-[% USE Asset %] >-[% USE AuthorisedValues %] >-[% USE Categories %] >-[% USE Koha %] >-[% USE Branches %] >-[% USE KohaDates %] >-[% USE Math %] >-[% USE AdditionalContents %] >-[% PROCESS 'i18n.inc' %] >-[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >-[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >-[% SET userupdateview = 1 %] >-[% BLOCK streetnumber %] >- [% UNLESS hidden.defined('streetnumber') %] >- <li> >- <label for="borrower_streetnumber" class="[% required.streetnumber | html %]">Street number:</label> >- >- <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber | html %]" class="[% required.streetnumber | html %]" size="5" maxlength="10" /> >- <div class="required_label [% required.streetnumber | html %]">Required</div> >- </li> >- [% END %] >-[% END %] >-[% BLOCK B_streetnumber %] >- [% UNLESS hidden.defined('B_streetnumber') %] >- <li> >- <label for="borrower_B_streetnumber" class="[% required.B_streetnumber | html %]">Street number:</label> >- >- <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" /> >- <div class="required_label [% required.B_streetnumber | html %]">Required</div> >- </li> >- [% END %] >-[% END %] >- >-[% INCLUDE 'doc-head-open.inc' %] >-<title>[% IF op == 'edit' %]Update your personal details[% ELSE %]Register a new account[% END %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title> >-[% INCLUDE 'doc-head-close.inc' %] >-[% BLOCK cssinclude %] >-[% END %] >-</head> >- >-[% IF op == 'edit' %] >- [% INCLUDE 'bodytag.inc' bodyid='opac-patron-update' %] >-[% ELSE %] >- <body id="opac-patron-registration" class="opac"> >-[% END %] >-[% INCLUDE 'masthead.inc' %] >- >-<div class="main"> >- [% WRAPPER breadcrumbs %] >- [% IF op == 'edit' %] >- [% WRAPPER breadcrumb_item %] >- <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> >- [% END %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Your personal details</span> >- [% END %] >- [% ELSE %] >- [% WRAPPER breadcrumb_item bc_active= 1 %] >- <span>Register a new account</span> >- [% END %] >- [% END %] >- [% END #/ WRAPPER breadcrumbs %] >- >- <div class="container-fluid"> >- <div class="row"> >- <div class="col col-lg-2 order-2 order-lg-1"> >- <div id="navigation"> [% INCLUDE 'navigation.inc' IsPatronPage=1 %] </div> >- </div> >- <div class="col-md-12 col-lg-10 order-1"> >- <h1>Your personal details</h1> >- >- [% SET container_id = "add-content" %] >- [% IF op == 'edit' %] >- [% container_id = "update-account" %] >- [% END %] >- <div id="[% container_id | html %]" class="maincontent"> >- [% IF op == 'edit' %] >- [% UNLESS OPACPatronDetails %] >- <div class="alert alert-info">To make changes to your record please contact the library.</div> >- [% END %] >- [% IF nochanges %] >- <div class="alert alert-error">No changes were made.</div> >- [% END %] >- [% END %] >- >- [% IF empty_mandatory_fields %] >- <div class="alert alert-warning">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div> >- [% END %] >- >- [% IF invalid_form_fields %] >- <div class="alert alert-error" >- ><strong>The following fields contain invalid information:</strong> >- <ul> >- [% FOREACH field IN invalid_form_fields %] >- [% IF field == "email" %]<li>Contact information: <a href="#borrower_email">primary email address</a></li>[% END %] >- [% IF field == "emailpro" %]<li>Contact information: <a href="#borrower_emailpro">secondary email address</a></li>[% END %] >- [% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %] >- [% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %] >- [% IF field == "password_too_short" %] >- <li>Password must be at least [% patron.category.effective_min_password_length | html %] characters long.</li> >- [% END %] >- [% IF field == "password_too_weak" %] >- <li>Password must contain at least one digit, one lowercase and one uppercase.</li> >- [% END %] >- [% IF field == "password_has_whitespaces" %] >- <li>Password must not contain leading or trailing whitespaces.</li> >- [% END %] >- [% IF field == "duplicate_email" %] >- <li>This email address already exists in our database.</li> >- [% END %] >- [% IF field == "email_match" %] >- <li>Emails do not match! <a href="#borrower_repeat_email">confirm email address</a></li> >- [% END %] >- [% IF field == "ERROR_age_limitations" %] >- <li>Patron's age is incorrect for their category.</li> >- [% END %] >- [% END %] >- </ul> >- <span>Please correct and resubmit.</span> >- </div> >- [% END %] >- >- [% IF cardnumber_wrong_length || cardnumber_already_exists %] >- <div class="alert alert-error"> >- [% IF cardnumber_wrong_length %] >- <a href="#borrower_cardnumber"><strong>The entered card number is the wrong length.</strong></a> >- [% ELSIF cardnumber_already_exists %] >- <a href="#borrower_cardnumber"><strong>The entered card number is already in use.</strong></a> >- [% END %] >- <span>Please correct and resubmit.</span> >- </div> >- [% END %] >- >- [% IF error_type OR error_info %] >- <div class="alert alert-error" >- ><li> >- <p>There were problems processing your registration. Please contact your library for help.</p> >- [% IF error_type == 'Koha::Exceptions::Patron::InvalidUserid' %] >- <p>Error: Userid is not valid</p> >- [% ELSE %] >- <p>Error [% error_type | html %]: [% error_info | html %]</p> >- [% END %] >- </li></div >- > >- [% END %] >- >- [% IF failed_captcha %] >- <div class="alert alert-warning">You typed in the wrong characters in the box before submitting. Please try again.</div> >- [% END %] >- >- [% IF has_guarantor_flag && !Koha.Preference('OPACPrivacy') && ( Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') || Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') ) %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_privacy"> >- <legend id="privacy_legend">Privacy</legend> >- <ol> >- [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >- <li> >- <label>Allow your guarantor to view your current checkouts?</label> >- <select id="privacy_guarantor_checkouts"> >- <option value="0">No</option> >- [% IF borrower.privacy_guarantor_checkouts %] >- <option value="1" selected="selected">Yes</option> >- [% ELSE %] >- <option value="1">Yes</option> >- [% END %] >- </select> >- <span class="hint"> >- <a id="update_privacy_guarantor_checkouts" href="#" class="btn btn-primary">Update</a> >- <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span> >- </span> >- </li> >- [% END %] >- >- [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %] >- <li> >- <label>Allow your guarantor to view your current fines?</label> >- <select id="privacy_guarantor_fines"> >- <option value="0">No</option> >- [% IF borrower.privacy_guarantor_fines %] >- <option value="1" selected="selected">Yes</option> >- [% ELSE %] >- <option value="1">Yes</option> >- [% END %] >- </select> >- <span class="hint"> >- <a id="update_privacy_guarantor_fines" href="#" class="btn btn-primary">Update</a> >- <span id="update_privacy_guarantor_fines_message" class="alert" style="display:none"></span> >- </span> >- </li> >- [% END %] >- >- <li> >- <span class="hint"> >- Guaranteed by >- [% FOREACH gr IN patron.guarantor_relationships %] >- [% SET g = gr.guarantor %] >- [% g.preferred_name | html %] >- [% g.middle_name | html %] >- [% g.surname | html %] >- [%- IF ! loop.last %],[% END %] >- [% END %] >- </span> >- </li> >- </ol> >- </fieldset> >- </div> >- </div> >- [% END %] >- >- [% IF ( extended_unique_id_failed_code ) %] >- <div class="alert" id="extended_unique_id_failed" >- ><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 >- > >- [% END %] >- >- <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off"> >- [% INCLUDE 'csrf-token.inc' %] >- >- [% 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' ] %] >- [% IF mandatory.defined( field ) %] >- [% SET required.$field = 'required' %] >- [% END %] >- [% END %] >- >- [%# Following on one line for translatability %] >- [% UNLESS ( hidden.defined('cardnumber') || ( !borrower && Koha.Preference('autoMemberNum') ) ) && hidden.defined('dateexpiry') && hidden.defined('branchcode') && hidden.defined('categorycode') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_library"> >- <legend id="library_legend">Library</legend> >- <ol> >- [% UNLESS hidden.defined('cardnumber') || ( !borrower && Koha.Preference('autoMemberNum') ) %] >- <li> >- <label for="borrower_cardnumber" class="[% required.cardnumber | html %]">Library card number:</label> >- >- [% IF borrower && !(cardnumber_wrong_length || cardnumber_already_exists) && op == 'edit' %] >- [% borrower.cardnumber | html %] >- [% ELSE %] >- [% IF minlength_cardnumber == maxlength_cardnumber %] >- <input >- type="text" >- id="borrower_cardnumber" >- name="borrower_cardnumber" >- size="20" >- value="[% borrower.cardnumber | html %]" >- minlength="[% minlength_cardnumber | html %]" >- maxlength="[% maxlength_cardnumber | html %]" >- class="[% required.cardnumber | html %]" >- /> >- <div class="required_label [% required.cardnumber | html %]">Required</div> >- <div class="hint">Card number must be exactly [% minlength_cardnumber | html %] characters.</div> >- [% ELSIF minlength_cardnumber && maxlength_cardnumber %] >- <input >- type="text" >- id="borrower_cardnumber" >- name="borrower_cardnumber" >- size="20" >- value="[% borrower.cardnumber | html %]" >- minlength="[% minlength_cardnumber | html %]" >- maxlength="[% maxlength_cardnumber | html %]" >- class="[% required.cardnumber | html %]" >- /> >- <div class="required_label [% required.cardnumber | html %]">Required</div> >- <div class="hint">Card number must be between [% minlength_cardnumber | html %] and [% maxlength_cardnumber | html %] characters.</div> >- [% ELSIF maxlength_cardnumber %] >- <input >- type="text" >- id="borrower_cardnumber" >- name="borrower_cardnumber" >- size="20" >- value="[% borrower.cardnumber | html %]" >- maxlength="[% maxlength_cardnumber | html %]" >- class="[% required.cardnumber | html %]" >- /> >- <div class="required_label [% required.cardnumber | html %]">Required</div> >- <div class="hint">Card number can be up to [% maxlength_cardnumber | html %] characters.</div> >- [% ELSE %] >- <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber | html %]" class="[% required.cardnumber | html %]" /> >- <div class="required_label [% required.cardnumber | html %]">Required</div> >- <div class="hint">There is no minimum or maximum character length.</div> >- [% END %] >- [% END %] >- </li> >- [% END %] >- >- [% IF op != 'new' %] >- [% UNLESS hidden.defined('userid') %] >- <li> >- <label>Username:</label> >- [% borrower.userid | html %] >- </li> >- [% END %] >- [% END %] >- >- [% UNLESS hidden.defined('dateexpiry') %] >- <li> >- <label>Expiration date:</label> >- [% borrower.dateexpiry | $KohaDates %] >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('branchcode') %] >- <li> >- [% IF libraries.count %] >- <label for="borrower_branchcode" class="[% required.branchcode | html %]">Home library:</label> >- >- <select id="borrower_branchcode" name="borrower_branchcode" class="[% required.branchcode | html %]"> >- [% IF required.branchcode %] >- <option value=""></option> >- [% END %] >- [% FOREACH l IN libraries %] >- [% IF l.branchcode == borrower.branchcode %] >- <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> >- [% ELSE %] >- <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> >- [% END %] >- [% END %] >- </select> >- <div class="required_label [% required.branchcode | html %]">Required</div> >- [% ELSE %] >- <span class="label">Home library:</span> >- [% FOREACH l IN libraries %] >- [% l.branchname | html %] >- <input type="hidden" name="borrower_branchcode" value="[% l.branchcode | html %]" /> >- [% END %] >- [% END %] >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('categorycode') %] >- <li> >- <label for="borrower_categorycode" class="[% required.categorycode | html %]"> Category:</label> >- >- [% IF borrower %] >- [% Categories.GetName( borrower.categorycode ) | html %] >- <input type="hidden" name="borrower_categorycode" value="[% borrower.categorycode | html %]" /> >- [% ELSE %] >- <select id="borrower_categorycode" name="borrower_categorycode" class="[% required.categorycode | html %]"> >- [% FOREACH c IN Categories.all() %] >- [% IF c.categorycode == Koha.Preference('PatronSelfRegistrationDefaultCategory') %] >- <option >- value="[% c.categorycode | html %]" >- data-pwd-length="[% c.effective_min_password_length | html %]" >- data-pwd-strong="[% c.effective_require_strong_password | html %]" >- selected="selected" >- >[% c.description | html %]</option >- > >- [% ELSE %] >- <option >- value="[% c.categorycode | html %]" >- data-pwd-length="[% c.effective_min_password_length | html %]" >- data-pwd-strong="[% c.effective_require_strong_password | html %]" >- >[% c.description | html %]</option >- > >- [% END %] >- [% END %] >- </select> >- <div class="required_label [% required.categorycode | html %]">Required</div> >- [% END %] >- </li> >- [% END %] >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END # / defined 'branchcode' %] >- >- [%# Following on one line for translatability %] >- [% 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') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_identity"> >- <legend id="identity_legend">Identity</legend> >- >- <ol> >- [% UNLESS hidden.defined('title') || !Koha.Preference('BorrowersTitles') %] >- <li> >- <label for="borrower_title" class="[% required.title | html %]">Salutation:</label> >- >- <select id="borrower_title" name="borrower_title" class="[% required.title | html %]"> >- <option value=""></option> >- [% FOREACH mt IN Koha.Preference('BorrowersTitles').split('\|') %] >- [% IF mt == borrower.title %] >- <option value="[% mt | html %]" selected="selected">[% mt | html %]</option> >- [% ELSE %] >- <option value="[% mt | html %]">[% mt | html %]</option> >- [% END %] >- [% END %] >- </select> >- <div class="required_label [% required.title | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('surname') %] >- <li> >- <label for="borrower_surname" class="[% required.surname | html %]">Surname:</label> >- >- <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname | html %]" class="[% required.surname | html %]" /> >- <div class="required_label [% required.surname | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('firstname') %] >- <li> >- <label for="borrower_firstname" class="[% required.firstname | html %]">First name:</label> >- >- <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname | html %]" class="[% required.firstname | html %]" /> >- <div class="required_label [% required.firstname | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('middle_name') %] >- <li> >- <label for="borrower_middle_name" class="[% required.middle_name | html %]">Middle name:</label> >- >- <input type="text" id="borrower_middle_name" name="borrower_middle_name" value="[% borrower.middle_name | html %]" class="[% required.middle_name | html %]" /> >- <div class="required_label [% required.middle_name | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('preferred_name') %] >- <li> >- <label for="borrower_preferred_name" class="[% required.preferred_name | html %]">Preferred name:</label> >- >- <input type="text" id="borrower_preferred_name" name="borrower_preferred_name" value="[% borrower.preferred_name | html %]" class="[% required.preferred_name | html %]" /> >- <div class="required_label [% required.preferred_name | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('dateofbirth') %] >- <li> >- <label for="borrower_dateofbirth" class="[% required.dateofbirth | html %]">Date of birth:</label> >- >- <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | html %]" size="10" class="[% required.dateofbirth | html %] flatpickr pastdate" /> >- >- <div class="required_label [% required.dateofbirth | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('initials') %] >- <li> >- <label for="borrower_initials" class="[% required.initials | html %]">Initials:</label> >- >- <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials | html %]" class="[% required.initials | html %]" /> >- <div class="required_label [% required.initials | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('pronouns') %] >- <li> >- <label for="borrower_pronouns" class="[% required.pronouns | html %]">Pronouns:</label> >- >- <input type="text" id="borrower_pronouns" name="borrower_pronouns" value="[% borrower.pronouns | html %]" class="[% required.prnouns | html %]" /> >- <div class="required_label [% required.pronouns | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('othernames') %] >- <li> >- <label for="borrower_othernames" class="[% required.othernames | html %]">Other names:</label> >- >- <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames | html %]" class="[% required.othernames | html %]" /> >- <div class="required_label [% required.othernames | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('sex') %] >- <li class="lradio"> >- <div class="label"></div> >- <label for="sex-female" class="radio inline"><span class="patronsex-female">Female:</span></label> >- [% IF borrower.sex == 'F' %] >- <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" /> >- [% ELSE %] >- <input type="radio" name="borrower_sex" id="sex-female" value="F" /> >- [% END %] >- >- <label for="sex-male" class="radio inline"><span class="patronsex-male">Male:</span></label> >- [% IF borrower.sex == 'M' %] >- <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" /> >- [% ELSE %] >- <input type="radio" name="borrower_sex" id="sex-male" value="M" /> >- [% END %] >- >- <label for="sex-other" class="radio inline"><span class="patronsex-other">[% tp('gender','Other:') | html %]</span></label> >- [% IF borrower.sex == 'O' %] >- <input type="radio" name="borrower_sex" id="sex-other" value="O" checked="checked" /> >- [% ELSE %] >- <input type="radio" name="borrower_sex" id="sex-other" value="O" /> >- [% END %] >- >- <label for="sex-none" class="radio inline"><span class="patronsex-none">None specified:</span></label> >- [% IF borrower.sex == '' %] >- <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" /> >- [% ELSE %] >- <input type="radio" name="borrower_sex" id="sex-none" value="" /> >- [% END %] >- </li> >- [% END %] >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- [% IF ( display_patron_image ) %] >- <div class="col-sm-2"> >- <p class="patronimage"> >- <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" /> >- </p> >- </div> >- [% END %] >- </div> >- <!-- /.row --> >- [% END # /UNLESS fields hidden %] >- >- [%# Following on one line for translatability %] >- [% UNLESS hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') && hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') && hidden.defined('country') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_mainaddress"> >- <legend id="mainaddress_legend">Main address</legend> >- >- <ol> >- [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE streetnumber %][% END %] >- >- [% SET roadtypes = AuthorisedValues.GetAuthValueDropbox('ROADTYPE') %] >- [% IF roadtypes.count %] >- [% UNLESS hidden.defined('streettype') %] >- <li> >- <label for="borrower_streettype" class="[% required.streettype | html %]">Street type:</label> >- >- <select name="borrower_streettype" name="borrower_streettype" class="[% required.streettype | html %]"> >- <option value=""></option> >- [% FOR roadtype IN roadtypes %] >- [% IF roadtype.authorised_value == patron.streettype %] >- <option value="[% roadtype.authorised_value | html %]" selected="selected">[% roadtype.lib_opac OR roadtype.lib | html %]</option> >- [% ELSE %] >- <option value="[% roadtype.authorised_value | html %]">[% roadtype.lib_opac OR roadtype.lib | html %]</option> >- [% END %] >- [% END %] >- </select> >- <div class="required_label [% required.streettype | html %]">Required</div> >- </li> >- [% END %] >- [% END %] >- >- [% UNLESS hidden.defined('address') %] >- <li> >- <label for="borrower_address" class="[% required.address | html %]">Address:</label> >- >- <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address | html %]" class="[% required.address | html %]" /> >- <div class="required_label [% required.address | html %]">Required</div> >- </li> >- [% END %] >- >- [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %] >- >- [% UNLESS hidden.defined('address2') %] >- <li> >- <label for="borrower_address2" class="[% required.address2 | html %]">Address 2:</label> >- >- <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 | html %]" class="[% required.address2 | html %]" /> >- <div class="required_label [% required.address2 | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('city') %] >- <li> >- <label for="borrower_city" class="[% required.city | html %]">City:</label> >- >- <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city | html %]" class="[% required.city | html %]" /> >- <div class="required_label [% required.city | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('state') %] >- <li> >- <label for="borrower_state" class="[% required.state | html %]">State:</label> >- >- <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state | html %]" class="[% required.state | html %]" /> >- <div class="required_label [% required.state | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('zipcode') %] >- <li> >- <label for="borrower_zipcode" class="[% required.zipcode | html %]">ZIP/Postal code:</label> >- >- <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode | html %]" class="[% required.zipcode | html %]" /> >- <div class="required_label [% required.zipcode | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('country') %] >- <li> >- <label for="borrower_country" class="[% required.country | html %]">Country:</label> >- >- <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country | html %]" class="[% required.country | html %]" /> >- <div class="required_label [% required.country | html %]">Required</div> >- </li> >- [% END %] >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [%# Following on one line for translatability %] >- [% UNLESS hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') && hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_contact"> >- <legend id="contact_legend">Contact information</legend> >- >- <ol> >- [% UNLESS hidden.defined('phone') %] >- <li> >- <label for="borrower_phone" class="[% required.phone | html %]">Primary phone:</label> >- >- <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone | html %]" class="[% required.phone | html %]" /> >- <div class="required_label [% required.phone | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('phonepro') %] >- <li> >- <label for="borrower_phonepro" class="[% required.phonepro | html %]">Secondary phone:</label> >- >- <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro | html %]" class="[% required.phonepro | html %]" /> >- <div class="required_label [% required.phonepro | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('mobile') %] >- <li> >- <label for="borrower_mobile" class="[% required.mobile | html %]">Other phone:</label> >- >- <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile | html %]" class="[% required.mobile | html %]" /> >- <div class="required_label [% required.mobile | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('email') %] >- <li> >- <label for="borrower_email" class="[% required.email | html %]">Primary email:</label> >- >- <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email | html %]" class="[% required.email | html %]" /> >- <div class="required_label [% required.email | html %]">Required</div> >- </li> >- >- [% IF op != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %] >- <li> >- <label for="borrower_repeat_email" class="[% required.email | html %]">Confirm primary email:</label> >- >- <input type="text" id="borrower_repeat_email" name="borrower_repeat_email" autocomplete="off" class="[% required.email | html %]" /> >- <div class="required_label [% required.email | html %]">Required</div> >- </li> >- [% END %] >- [% END %] >- >- [% UNLESS hidden.defined('emailpro') %] >- <li> >- <label for="borrower_emailpro" class="[% required.emailpro | html %]">Secondary email:</label> >- >- <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro | html %]" class="[% required.emailpro | html %]" /> >- <div class="required_label [% required.emailpro | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('fax') %] >- <li> >- <label for="borrower_fax" class="[% required.fax | html %]">Fax:</label> >- >- <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax | html %]" class="[% required.fax | html %]" /> >- <div class="required_label [% required.fax | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('primary_contact_method') %] >- <li> >- [% IF ( mandatory.defined('primary_contact_method') ) %] >- <label for="borrower_primary_contact_method" class="required">Main contact method:</label> >- [% ELSE %] >- <label for="borrower_primary_contact_method">Main contact method:</label> >- [% END %] >- >- <select id="borrower_primary_contact_method" name="borrower_primary_contact_method"> >- <option value=""></option> >- [% UNLESS hidden.defined('phone') %] >- [% IF ( borrower.primary_contact_method == 'phone' ) %] >- <option value="phone" selected="selected">Primary phone</option> >- [% ELSE %] >- <option value="phone">Primary phone</option> >- [% END %] >- [% END %] >- [% UNLESS hidden.defined('phonepro') %] >- [% IF ( borrower.primary_contact_method == 'phonepro' ) %] >- <option value="phonepro" selected="selected">Secondary phone</option> >- [% ELSE %] >- <option value="phonepro">Secondary phone</option> >- [% END %] >- [% END %] >- [% UNLESS hidden.defined('mobile') %] >- [% IF ( borrower.primary_contact_method == 'mobile' ) %] >- <option value="mobile" selected="selected">Other phone</option> >- [% ELSE %] >- <option value="mobile">Other phone</option> >- [% END %] >- [% END %] >- [% UNLESS hidden.defined('email') %] >- [% IF ( borrower.primary_contact_method == 'email' ) %] >- <option value="email" selected="selected">Primary email</option> >- [% ELSE %] >- <option value="email">Primary email</option> >- [% END %] >- [% END %] >- [% UNLESS hidden.defined('emailpro') %] >- [% IF ( borrower.primary_contact_method == 'emailpro' ) %] >- <option value="emailpro" selected="selected">Secondary email</option> >- [% ELSE %] >- <option value="emailpro">Secondary email</option> >- [% END %] >- [% END %] >- [% UNLESS hidden.defined('fax') %] >- [% IF ( borrower.primary_contact_method == 'fax' ) %] >- <option value="fax" selected="selected">Fax</option> >- [% ELSE %] >- <option value="fax">Fax</option> >- [% END %] >- [% END %] >- </select> >- [% IF ( mandatory.defined('primary_contact_method') ) %]<span class="required">Required</span>[% END %] >- </li> >- [% UNLESS hidden.defined('lang') %] >- <li> >- [% IF ( mandatory.defined('lang') ) %] >- <label for="borrower_lang" class="required">Preferred language for notices: </label> >- [% ELSE %] >- <label for="borrower_lang">Preferred language for notices: </label> >- [% END %] >- <select id="borrower_lang" name="borrower_lang"> >- <option value="default">Default</option> >- [% FOR language IN languages %] >- [% FOR sublanguage IN language.sublanguages_loop %] >- [% IF language.plural %] >- [% IF sublanguage.rfc4646_subtag == borrower.lang %] >- <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected" >- >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option >- > >- [% ELSE %] >- <option value="[% sublanguage.rfc4646_subtag | html %]" >- >[% sublanguage.native_description | html %] [% sublanguage.region_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option >- > >- [% END %] >- [% ELSE %] >- [% IF sublanguage.rfc4646_subtag == borrower.lang %] >- <option value="[% sublanguage.rfc4646_subtag | html %]" selected="selected" >- >[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option >- > >- [% ELSE %] >- <option value="[% sublanguage.rfc4646_subtag | html %]">[% sublanguage.native_description | html %] ([% sublanguage.rfc4646_subtag | html %])</option> >- [% END %] >- [% END # /IF language.plural %] >- [% END # /FOR sublanguage %] >- [% END #/FOR language %] >- </select> >- <!-- /#lang --> >- [% IF ( mandatory.defined('lang') ) %]<div class="required_label required">Required</div>[% END %] >- </li> >- [% END %] >- [% END %] >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [%# Following on one line for translatability %] >- [% 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') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_alternateaddress"> >- <legend id="alternateaddress_legend">Alternate address</legend> >- >- <ol> >- [% IF Koha.Preference('AddressFormat') != 'de' %][% INCLUDE B_streetnumber %][% END %] >- >- [% SET roadtypes = AuthorisedValues.GetAuthValueDropbox('ROADTYPE') %] >- [% IF roadtypes.count %] >- [% UNLESS hidden.defined('B_streettype') %] >- <li> >- <label for="borrower_B_streettype" class="[% required.B_streettype | html %]">Street type:</label> >- >- <select name="borrower_B_streettype" name="borrower_B_streettype" class="[% required.B_streettype | html %]"> >- <option value=""></option> >- [% FOR roadtype IN roadtypes %] >- [% IF roadtype.authorised_value == patron.streettype %] >- <option value="[% roadtype.authorised_value | html %]" selected="selected">[% roadtype.lib | html %]</option> >- [% ELSE %] >- <option value="[% roadtype.authorised_value | html %]">[% roadtype.lib | html %]</option> >- [% END %] >- [% END %] >- </select> >- <div class="required_label [% required.B_streettype | html %]">Required</div> >- </li> >- [% END %] >- [% END %] >- [% UNLESS hidden.defined('B_address') %] >- <li> >- <label for="borrower_B_address" class="[% required.B_address | html %]">Address:</label> >- >- <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address | html %]" class="[% required.B_address | html %]" /> >- <div class="required_label [% required.B_address | html %]">Required</div> >- </li> >- [% END %] >- >- [% IF Koha.Preference('AddressFormat') == 'de' %][% INCLUDE streetnumber %][% END %] >- >- [% UNLESS hidden.defined('B_address2') %] >- <li> >- <label for="borrower_B_address2" class="[% required.B_address | html %]">Address 2:</label> >- >- <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 | html %]" class="[% required.B_address2 | html %]" /> >- <div class="required_label [% required.B_address2 | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('B_city') %] >- <li> >- <label for="borrower_B_city" class="[% required.B_city | html %]">City:</label> >- >- <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city | html %]" class="[% required.B_city | html %]" /> >- <div class="required_label [% required.B_city | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('B_state') %] >- <li> >- <label for="borrower_B_state" class="[% required.B_state | html %]">State:</label> >- >- <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state | html %]" class="[% required.B_state | html %]" /> >- <div class="required_label [% required.B_state | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('B_zipcode') %] >- <li> >- <label for="borrower_B_zipcode" class="[% required.B_zipcode | html %]">ZIP/Postal code:</label> >- >- <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode | html %]" class="[% required.B_zipcode | html %]" /> >- <div class="required_label [% required.B_zipcode | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('B_country') %] >- <li> >- <label for="borrower_B_country" class="[% required.B_country | html %]">Country:</label> >- >- <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country | html %]" class="[% required.B_country | html %]" /> >- <div class="required_label [% required.B_country | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('B_phone') %] >- <li> >- <label for="borrower_B_phone" class="[% required.B_phone | html %]">Phone:</label> >- >- <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone | html %]" class="[% required.B_phone | html %]" /> >- <div class="required_label [% required.B_phone | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('B_email') %] >- <li> >- <label for="borrower_B_email" class="[% required.B_email | html %]">Email:</label> >- >- <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email | html %]" class="[% required.B_email | html %]" /> >- <div class="required_label [% required.B_email | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('contactnote') %] >- <li> >- <label for="borrower_contactnote" class="[% required.contactnote | html %]">Contact note:</label> >- >- <textarea id="borrower_contactnote" name="borrower_contactnote" cols="30" rows="2" class="[% required.contactnote | html %]">[% borrower.contactnote | html %]</textarea> >- <div class="required_label [% required.contactnote | html %]">Required</div> >- </li> >- [% END %] >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [%# Following on one line for translatability %] >- [% 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') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_alternatecontact"> >- <legend id="alternatecontact_legend">Alternate contact</legend> >- >- <ol> >- [% UNLESS hidden.defined('altcontactsurname') %] >- <li> >- <label for="borrower_altcontactsurname" class="[% required.altcontactsurname | html %]">Surname:</label> >- >- <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname | html %]" class="[% required.altcontactsurname | html %]" /> >- <div class="required_label [% required.altcontactsurname | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactfirstname') %] >- <li> >- <label for="borrower_altcontactfirstname" class="[% required.altcontactfirstname | html %]">First name:</label> >- >- <input >- type="text" >- id="borrower_altcontactfirstname" >- name="borrower_altcontactfirstname" >- value="[% borrower.altcontactfirstname | html %]" >- class="[% required.altcontactfirstname | html %]" >- /> >- <div class="required_label [% required.altcontactfirstname | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactaddress1') %] >- <li> >- <label for="borrower_altcontactaddress1" class="[% required.altcontactaddress1 | html %]">Address:</label> >- >- <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 | html %]" class="[% required.altcontactaddress1 | html %]" /> >- <div class="required_label [% required.altcontactaddress1 | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactaddress2') %] >- <li> >- <label for="borrower_altcontactaddress2" class="[% required.altcontactaddress2 | html %]">Address 2:</label> >- >- <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 | html %]" class="[% required.altcontactaddress2 | html %]" /> >- <div class="required_label [% required.altcontactaddress2 | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactaddress3') %] >- <li> >- <label for="borrower_altcontactaddress3" class="[% required.altcontactaddress3 | html %]">City:</label> >- >- <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 | html %]" class="[% required.altcontactaddress3 | html %]" /> >- <div class="required_label [% required.altcontactaddress3 | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactstate') %] >- <li> >- <label for="borrower_altcontactstate" class="[% required.altcontactstate | html %]">State:</label> >- >- <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate | html %]" class="[% required.altcontactstate | html %]" /> >- <div class="required_label [% required.altcontactstate | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactzipcode') %] >- <li> >- <label for="borrower_altcontactzipcode" class="[% required.altcontactzipcode | html %]">ZIP/Postal code:</label> >- >- <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode | html %]" class="[% required.altcontactzipcode | html %]" /> >- <div class="required_label [% required.altcontactzipcode | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactcountry') %] >- <li> >- <label for="borrower_altcontactcountry" class="[% required.altcontactcountry | html %]">Country:</label> >- >- <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry | html %]" class="[% required.altcontactcountry | html %]" /> >- <div class="required_label [% required.altcontactcountry | html %]">Required</div> >- </li> >- [% END %] >- >- [% UNLESS hidden.defined('altcontactphone') %] >- <li> >- <label for="borrower_altcontactphone" class="[% required.altcontactphone | html %]">Phone:</label> >- >- <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone | html %]" class="[% required.altcontactphone | html %]" /> >- <div class="required_label [% required.altcontactphone | html %]">Required</div> >- </li> >- [% END %] >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [% UNLESS op == 'edit' || hidden.defined('password') %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_password"> >- <legend id="contact_legend">Password</legend> >- <div class="alert alert-info"> >- [% IF patron %] >- [% IF ( patron.category.effective_require_strong_password ) %] >- <p>Your password must contain at least [% patron.category.effective_min_password_length | html %] characters, including UPPERCASE, lowercase and numbers.</p> >- [% ELSE %] >- <p>Your password must be at least [% patron.category.effective_min_password_length | html %] characters long.</p> >- [% END %] >- [% ELSE %] >- <p id="password_alert"></p> >- [% END %] >- [% UNLESS mandatory.defined('password') %] >- <p>If you do not enter a password a system generated password will be created.</p> >- [% END %] >- </div> >- >- <ol> >- <li >- ><label for="password" class="[% required.password | html %]">Password:</label> >- <input type="password" name="borrower_password" id="password" class="[% required.password | html %]" autocomplete="new-password" /> >- <div class="required_label [% required.password | html %]">Required</div> >- </li> >- <li >- ><label for="password2" class="[% required.password | html %]">Confirm password:</label> >- <input type="password" name="borrower_password2" id="password2" autocomplete="new-password" /> >- <div class="required_label [% required.password | html %]">Required</div> >- </li> >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [% IF ( Koha.Preference('ExtendedPatronAttributes') && patron_attribute_classes.size ) %] >- <div class="row"> >- <div class="col"> >- [% SET fieldset_id = "" %] >- [% SET legend = "Additional information" %] >- [% FOREACH pa_class IN patron_attribute_classes %] >- [% IF pa_class.class %] >- [% fieldset_id = "aai_" _ pa_loo.class %] >- [% legend = pa_class.lib %] >- [% END %] >- <fieldset id="[% fieldset_id | html %]" class="rows patron-attributes"> >- <legend>[% legend | html %]</legend> >- <ol class="attributes_table"> >- [% FOREACH pa IN pa_class.items %] >- [% FOREACH pa_value IN pa.values %] >- [% IF loop.first %]<a id="patron-attr-start-[% pa.type.code | html %]"></a>[% END %] >- [% form_id = 'patron-attr-' _ Math.int( Math.rand(1000000) ) %] >- <li data-category_code="[% pa.type.category_code | html %]"> >- [% IF pa.type.mandatory && pa.type.opac_editable %] >- <label for="[% form_id | html %]" class="required">[% pa.type.description | html %]: </label> >- [% ELSE %] >- <label for="[% form_id | html %]">[% pa.type.description | html %]: </label> >- [% END %] >- [% IF pa.type.opac_editable %] >- <input type="hidden" name="patron_attribute_code" value="[% pa.type.code | html %]" /> >- [% IF ( pa.type.authorised_value_category ) %] >- <select id="[% form_id | html %]" name="patron_attribute_value"> >- <option value=""></option> >- [% FOREACH auth_val IN AuthorisedValues.Get( pa.type.authorised_value_category, 1 ) %] >- [% IF ( auth_val.authorised_value == pa_value ) %] >- <option value="[% auth_val.authorised_value | html %]" selected="selected"> [% auth_val.lib | html %] </option> >- [% ELSE %] >- <option value="[% auth_val.authorised_value | html %]"> [% auth_val.lib | html %] </option> >- [% END %] >- [% END %] >- </select> >- [% ELSE %] >- [% IF ( pa.type.is_date && pa.type.mandatory ) %] >- <input type="text" id="[% form_id | html %]" name="patron_attribute_value" value="[% pa_value | html %]" size="10" required="required" class="flatpickr" /> >- [% ELSIF ( pa.type.is_date && !pa.type.mandatory ) %] >- <input type="text" id="[% form_id | html %]" name="patron_attribute_value" value="[% pa_value | html %]" size="10" class="flatpickr" /> >- [% ELSE %] >- <textarea rows="2" cols="30" id="[% form_id | html %]" name="patron_attribute_value">[% pa_value | html %]</textarea> >- [% END %] >- [% END %] >- <div class="attr-control"> >- [% IF ( !pa.type.is_date ) %] >- <a href="#" class="btn btn-sm btn-link clear-attribute"><i class="fa fa-remove" aria-hidden="true"></i> Clear</a> >- [% END %] >- [% IF ( pa.type.repeatable ) %] >- <a href="#" class="btn btn-sm btn-link clone-attribute"><i class="fa fa-plus" aria-hidden="true"></i> New</a> >- [% END %] >- [% IF pa.type.mandatory %] >- <span class="required_label required">Required</span> >- [% END %] >- </div> >- [% ELSE %] >- [% IF ( pa.type.authorised_value_category ) %] >- [% AuthorisedValues.GetByCode( pa.type.authorised_value_category, pa_value, 1 ) | html_line_break %] >- [% ELSIF ( pa.type.is_date ) %] >- [% pa_value | $KohaDates %] >- [% ELSE %] >- [% pa_value | html_line_break %] >- [% END %] >- [% END %] >- </li> >- [% END %] >- [% END %] >- </ol> >- </fieldset> >- [% END %] >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [% IF Koha.Preference('PrivacyPolicyConsent') && op != 'edit' %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_gdpr_consent"> >- <legend>Data privacy policy consent</legend> >- <ol> >- <li> >- <div class="label"></div> >- <label class="checkbox-label" for="borrower_gdpr_proc_consent"> >- <input type="checkbox" name="borrower_gdpr_proc_consent" id="borrower_gdpr_proc_consent" class="required" value="agreed" /> >- <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> >- </label> >- <label class="error" for="borrower_gdpr_proc_consent" style="display: none;"></label> >- <div class="required_label required">Required</div> >- </li> >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- [% UNLESS op == 'edit' %] >- <div class="row"> >- <div class="col"> >- <fieldset class="rows" id="memberentry_captcha"> >- <legend>Verification</legend> >- <ol> >- <li> >- <label for="captcha" class="required">Verification:</label> >- >- <input type="text" name="captcha" id="captcha" style="text-transform: uppercase;" /> >- <div class="required_label required">Required</div> >- <input type="hidden" name="captcha_digest" value="[% captcha_digest | html %]" /> >- >- <span class="hint">Please type the following characters into the preceding box: <strong>[% captcha | html %]</strong></span> >- </li> >- </ol> >- </fieldset> >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- [% END %] >- >- <div class="row"> >- <div class="col"> >- [% IF op == 'edit' %] >- [% IF OPACPatronDetails %] >- <fieldset class="action"> >- <input type="hidden" name="op" value="cud-update" /> >- <input type="submit" class="btn btn-primary" value="Submit update request" /> >- </fieldset> >- [% END %] >- [% ELSE %] >- <fieldset class="action"> >- <input type="hidden" name="op" value="cud-create" /> >- <input type="submit" class="btn btn-primary" value="Submit" /> >- </fieldset> >- [% END %] >- </div> >- <!-- /.col --> >- </div> >- <!-- /.row --> >- </form> </div >- ><!--/div#update-account --> >- </div> >- </div> >- </div> >-</div> >- >-[% INCLUDE 'opac-bottom.inc' %] >-[% BLOCK jsinclude %] >- [% INCLUDE 'validator-strings.inc' %] >- [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] >- [% INCLUDE 'calendar.inc' %] >- <script> >- $(document).ready(function() { >- [% IF op == 'edit' && !OPACPatronDetails %] >- $("#memberentry-form :input").attr('readonly', true); >- $("#borrower_branchcode").attr('disabled',true); >- $("#borrower_title").attr('disabled',true); >- $('#memberentry-form :radio').attr('disabled',true); >- $('span.required').remove(); >- $('label.required').removeClass('required'); >- [% END %] >- >- $("#memberentry-form").validate({ >- rules: { >- borrower_email: { >- email: true >- }, >- borrower_repeat_email: { >- equalTo: '#borrower_email' >- }, >- borrower_emailpro: { >- email: true >- }, >- borrower_B_email: { >- email: true >- }, >- borrower_password: { >- password_strong: true, >- password_no_spaces: true >- }, >- borrower_password2: { >- password_match: true >- }, >- captcha: { >- required: true, >- } >- }, >- submitHandler: function(form) { >- if (form.beenSubmitted) { >- return false; >- } >- else { >- form.beenSubmitted = true; >- form.submit(); >- } >- } >- }); >- >- if ( $("input.required").length ) { >- $("input.required").rules("add", { >- required: true >- }); >- } >- if ( $("select.required").length ) { >- $("select.required").rules("add", { >- required: true >- }); >- } >- if ( $("textarea.required").length ) { >- $("textarea.required").rules("add", { >- required: true >- }); >- } >- >- [% IF patron.guarantor_relationships && !Koha.Preference('OPACPrivacy') %] >- >- [% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %] >- $('#update_privacy_guarantor_checkouts').click( function() { >- var can_see_checkouts = $('#privacy_guarantor_checkouts').val() == 1; >- $.ajax({ >- url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_checkouts", >- type: "PUT", >- data: JSON.stringify({ >- allowed: can_see_checkouts >- }), >- contentType: "application/json", >- success: function () { >- $('#update_privacy_guarantor_checkouts_message') >- .fadeIn("slow") >- .text(_("Your setting has been updated!")) >- .delay(5000) >- .fadeOut("slow"); >- }, >- error: function () { >- $('#update_privacy_guarantor_checkouts_message') >- .fadeIn("slow") >- .text(_("Unable to update your setting!")) >- .delay(5000) >- .fadeOut("slow"); >- } >- }); >- }); >- [% END %] >- >- [% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %] >- $('#update_privacy_guarantor_fines').click( function() { >- var can_see_charges = $('#privacy_guarantor_fines').val() == 1; >- $.ajax({ >- url: "/api/v1/public/patrons/[% logged_in_user.borrowernumber | uri %]/guarantors/can_see_charges", >- type: 'PUT', >- data: JSON.stringify({ >- allowed: can_see_charges >- }), >- contentType: 'application/json', >- success: function() { >- $('#update_privacy_guarantor_fines_message') >- .fadeIn("slow") >- .text( _("Your setting has been updated!") ) >- .delay( 5000 ) >- .fadeOut("slow"); >- }, >- error: function() { >- $('#update_privacy_guarantor_fines_message') >- .fadeIn("slow") >- .text( _("Unable to update your setting!") ) >- .delay( 5000 ) >- .fadeOut("slow"); >- } >- }); >- }); >- [% END %] >- [% END %] >- >- $(".patron-attributes").on( 'click', '.clear-attribute', function(e) { >- e.preventDefault(); >- $(this).closest("li") >- .find('textarea').val("").end() >- .find('select').val("").end(); >- } ); >- >- $(".patron-attributes").on( 'click', '.clone-attribute', function() { >- let li = $(this).closest("li"); >- var clone = li.clone().insertAfter( li ); >- >- var newId = 50 + parseInt(Math.random() * 100000); >- $('input[type!="hidden"],select,textarea', clone).attr('id', 'patron-attr-' + newId).attr('value', ''); >- $("label", clone).attr('for', 'patron-attr-' + newId).attr('value', ''); >- >- return false; >- } ); >- }); >- >- [% IF op != 'edit' and Koha.Preference('PatronSelfRegistrationConfirmEmail') %] >- $("#borrower_email").bind("cut copy paste", function(e){ >- e.preventDefault(); >- $("#borrower_email").bind("contextmenu", function(e){ >- e.preventDefault(); >- }); >- }); >- $("#borrower_repeat_email").bind("cut copy paste", function(e){ >- e.preventDefault(); >- $("#borrower_repeat_email").bind("contextmenu", function(e){ >- e.preventDefault(); >- }); >- }); >- [% END %] >- >- [% UNLESS patron %] >- var PWD_STRONG_MSG = _("Password must contain at least %s characters, including UPPERCASE, lowercase and numbers"); >- var PWD_WEAK_MSG = _("Password must contain at least %s characters"); >- var default_password_length = [% defaultCategory.effective_min_password_length | html %]; >- var default_strong_password = [% defaultCategory.effective_require_strong_password ? defaultCategory.effective_require_strong_password : 0 | html %]; >- $(document).ready(function() { >- var setPwdMessage = function() { >- var require_strong = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdStrong') : default_strong_password; >- var min_length = $('select#borrower_categorycode option:selected').length ? $('select#borrower_categorycode option:selected').data('pwdLength') : default_password_length; >- $('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_length)); >- }; >- setPwdMessage(); >- $('select#borrower_categorycode').change(setPwdMessage); >- }); >- [% END %] >- </script> >- [% 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 %] >-[% END %] >diff --git a/members/memberentry.pl b/members/memberentry.pl >index c2df4523366..e428d3a2a9b 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -297,8 +297,7 @@ foreach my $guarantor (@guarantors) { > if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) > && ( $guarantor->is_child || $guarantor->is_guarantee || ( $patron && $patron->is_guarantor ) ) ) > { >- push @errors, 'ERROR_child_is_guarantor' if ( $guarantor->is_child ); >- push @errors, 'ERROR_guarantor_is_guarantee' if ( !$guarantor->is_child ); >+ push @errors, 'ERROR_guarantor_is_guarantee'; > } > } > >@@ -986,7 +985,7 @@ sub patron_attributes_form { > description => $attr_type->description(), > repeatable => $attr_type->repeatable(), > category => $attr_type->authorised_value_category(), >- category_code => $attr_type->category_code(), >+ categorycodes => [ map { $_->categorycode } $attr_type->categories->as_list ], > mandatory => $attr_type->mandatory(), > is_date => $attr_type->is_date(), > }; >diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl >index fafd85ab26e..c6c84fdfb1d 100755 >--- a/reports/borrowers_stats.pl >+++ b/reports/borrowers_stats.pl >@@ -506,12 +506,11 @@ sub patron_attributes_form { > > # TODO The following can be simplified easily > my $entry = { >- class => $attr_type->class(), >- code => $attr_type->code(), >- description => $attr_type->description(), >- repeatable => $attr_type->repeatable(), >- category => $attr_type->authorised_value_category(), >- category_code => $attr_type->category_code(), >+ class => $attr_type->class(), >+ code => $attr_type->code(), >+ description => $attr_type->description(), >+ repeatable => $attr_type->repeatable(), >+ category => $attr_type->authorised_value_category(), > }; > > my $newentry = {%$entry}; >diff --git a/t/db_dependent/Auth_with_ldap.t b/t/db_dependent/Auth_with_ldap.t >index 3b88d0e7a17..cd0309bc7bc 100755 >--- a/t/db_dependent/Auth_with_ldap.t >+++ b/t/db_dependent/Auth_with_ldap.t >@@ -94,13 +94,11 @@ my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; > my $attr_type = $builder->build( > { > source => 'BorrowerAttributeType', >- value => { category_code => $categorycode } > } > ); > my $attr_type2 = $builder->build( > { > source => 'BorrowerAttributeType', >- value => { category_code => $categorycode } > } > ); > >@@ -708,4 +706,3 @@ sub is_admin_bind { > } > > $schema->storage->txn_rollback(); >- >diff --git a/t/db_dependent/Koha/Patron/Attribute.t b/t/db_dependent/Koha/Patron/Attribute.t >index e233a39050a..a04afc7c97f 100755 >--- a/t/db_dependent/Koha/Patron/Attribute.t >+++ b/t/db_dependent/Koha/Patron/Attribute.t >@@ -328,11 +328,10 @@ subtest 'store() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 0, >- unique_id => 1, >- is_date => 0, >- category_code => undef >+ mandatory => 0, >+ repeatable => 0, >+ unique_id => 1, >+ is_date => 0, > } > } > ); >diff --git a/t/db_dependent/Koha/Patron/Attribute/Type.t b/t/db_dependent/Koha/Patron/Attribute/Type.t >new file mode 100755 >index 00000000000..d062cd32d81 >--- /dev/null >+++ b/t/db_dependent/Koha/Patron/Attribute/Type.t >@@ -0,0 +1,37 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use Test::More; >+use Koha::Database; >+use t::lib::TestBuilder; >+ >+plan tests => 2; >+ >+my $schema = Koha::Database->new->schema; >+my $builder = t::lib::TestBuilder->new; >+ >+use_ok('Koha::Patron::Attribute::Type'); >+ >+subtest 'categories' => sub { >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $category1 = $builder->build_object( { class => 'Koha::Patron::Categories' } ); >+ my $category2 = $builder->build_object( { class => 'Koha::Patron::Categories' } ); >+ Koha::Patron::Attribute::Types->delete(); >+ my $attribute_type = Koha::Patron::Attribute::Type->new( >+ { >+ code => 'TEST', >+ description => 'Test attribute type', >+ } >+ ); >+ $attribute_type->store(); >+ $attribute_type->categories( [ $category1, $category2 ] ); >+ $attribute_type->store(); >+ my @categories = $attribute_type->categories->as_list; >+ is( scalar @categories, 2 ); >+ >+ $schema->storage->txn_rollback; >+}; >diff --git a/t/db_dependent/Koha/Patron/Attribute/Types.t b/t/db_dependent/Koha/Patron/Attribute/Types.t >index 222251a6dee..59c7cd0f710 100755 >--- a/t/db_dependent/Koha/Patron/Attribute/Types.t >+++ b/t/db_dependent/Koha/Patron/Attribute/Types.t >@@ -55,14 +55,11 @@ subtest 'new() tests' => sub { > 1, 'Only one object created' > ); > >- my $cateogory_code = $builder->build( { source => 'Category' } )->{categorycode}; >- >- my $attribute_type_with_category = Koha::Patron::Attribute::Type->new( >+ my $attribute_type_2 = Koha::Patron::Attribute::Type->new( > { >- code => 'code_2', >- description => 'description', >- category_code => $cateogory_code, >- repeatable => 0 >+ code => 'code_2', >+ description => 'description', >+ repeatable => 0 > } > )->store(); > >@@ -464,4 +461,3 @@ subtest 'search_with_library_limits() tests' => sub { > > $schema->storage->txn_rollback; > }; >- >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 22b8cc5cc15..aab985fe111 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -626,10 +626,9 @@ subtest 'add() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 1, >- unique_id => 0, >- category_code => 'ST' >+ mandatory => 0, >+ repeatable => 1, >+ unique_id => 0, > } > } > ); >@@ -637,10 +636,9 @@ subtest 'add() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 1, >- unique_id => 0, >- category_code => 'ST' >+ mandatory => 0, >+ repeatable => 1, >+ unique_id => 0, > } > } > ); >diff --git a/t/db_dependent/api/v1/patrons_extended_attributes.t b/t/db_dependent/api/v1/patrons_extended_attributes.t >index da7eeed122f..ef2ef0e3964 100755 >--- a/t/db_dependent/api/v1/patrons_extended_attributes.t >+++ b/t/db_dependent/api/v1/patrons_extended_attributes.t >@@ -115,10 +115,9 @@ subtest 'add() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 1, >- repeatable => 0, >- unique_id => 0, >- category_code => undef >+ mandatory => 1, >+ repeatable => 0, >+ unique_id => 0, > } > } > ); >@@ -126,10 +125,9 @@ subtest 'add() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 1, >- unique_id => 0, >- category_code => undef >+ mandatory => 0, >+ repeatable => 1, >+ unique_id => 0, > } > } > ); >@@ -137,10 +135,9 @@ subtest 'add() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 0, >- unique_id => 1, >- category_code => undef >+ mandatory => 0, >+ repeatable => 0, >+ unique_id => 1, > } > } > ); >@@ -238,10 +235,9 @@ subtest 'overwrite() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 1, >- repeatable => 0, >- unique_id => 0, >- category_code => undef >+ mandatory => 1, >+ repeatable => 0, >+ unique_id => 0, > } > } > ); >@@ -249,10 +245,9 @@ subtest 'overwrite() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 1, >- unique_id => 0, >- category_code => undef >+ mandatory => 0, >+ repeatable => 1, >+ unique_id => 0, > } > } > ); >@@ -260,10 +255,9 @@ subtest 'overwrite() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 0, >- unique_id => 1, >- category_code => undef >+ mandatory => 0, >+ repeatable => 0, >+ unique_id => 1, > } > } > ); >@@ -380,10 +374,9 @@ subtest 'delete() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 1, >- unique_id => 0, >- category_code => undef >+ mandatory => 0, >+ repeatable => 1, >+ unique_id => 0, > } > } > ); >@@ -426,10 +419,9 @@ subtest 'update() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 1, >- unique_id => 0, >- category_code => undef >+ mandatory => 0, >+ repeatable => 1, >+ unique_id => 0, > } > } > ); >@@ -437,10 +429,9 @@ subtest 'update() tests' => sub { > { > class => 'Koha::Patron::Attribute::Types', > value => { >- mandatory => 0, >- repeatable => 0, >- unique_id => 1, >- category_code => undef >+ mandatory => 0, >+ repeatable => 0, >+ unique_id => 1, > } > } > ); >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 9e1830ddb2f..3994a0f7d70 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -38,7 +38,7 @@ use Koha::Libraries; > use Koha::Patron::Categories; > use Koha::Patron::Debarments qw( AddDebarment DelDebarment ); > use Koha::Patrons; >-use List::MoreUtils qw(uniq); >+use List::MoreUtils qw(uniq none); > use Koha::Patron::Messages; > > my $input = CGI->new; >@@ -164,10 +164,8 @@ if ( $op eq 'cud-show' || $op eq 'show' ) { > options => $options, > }; > >- my $category_code = $attr_type->category_code; >- my ($category_lib) = >- map { ( defined $category_code and $attr_type->category_code eq $_->categorycode ) ? $_->description : () } >- @patron_categories; >+ my @categories = $attr_type->categories->as_list; >+ my ($category_lib) = join( ', ', map { $_->description } @categories ); > push @patron_attributes_codes, > { > attribute_code => $attr_type->code, >@@ -433,8 +431,11 @@ if ( $op eq 'cud-do' ) { > > next unless $attr_type; > >- # If this borrower is not in the category of this attribute, we don't want to modify this attribute >- next if $attr_type->category_code and $attr_type->category_code ne $patron->categorycode; >+ # If this borrower is not in one of the categories of this attribute, we don't want to modify this attribute >+ my @attr_type_categories = $attr_type->categories->as_list; >+ if (@attr_type_categories) { >+ next if none { $patron->categorycode eq $_->categorycode } @attr_type_categories; >+ } > > if ( $attributes->{$code}->{disabled} ) { > >-- >2.48.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26573
:
139823
|
143113
|
143114
|
143115
|
143116
|
144470
|
144471
|
159210
|
159211
|
171048
|
175628
|
175629
|
177565
|
177566
|
178171
|
178172
|
178252
|
178253
|
178254
|
178255
|
178270
|
178271
|
178272
|
178273
|
183322
|
183323
|
183324
|
183325