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

(-)a/installer/data/mysql/atomicupdate/bug-35028.pl (+15 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => '35028',
5
    description => 'Add system preference PatronSelfRegistrationAlert',
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do( "
11
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
12
            ('PatronSelfRegistrationAlert','0',NULL,'If enabled, an alter will be shown on staff interface home page when there are self-registered patrons.','YesNo')
13
        " );
14
    },
15
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 612-617 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
612
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
612
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
613
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
613
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
614
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
614
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
615
('PatronSelfRegistrationAlert','0',NULL,'If enabled, an alter will be shown on staff interface home page when there are self-registered patrons.','YesNo'),
615
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
616
('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'),
616
('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'),
617
('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'),
617
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
618
('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 887-892 OPAC: Link Here
887
            - '<br>If you chooose <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailAddressForPatronRegistrations">EmailAddressForPatronRegistrations</a> you have to enter a valid email address: '
887
            - '<br>If you chooose <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailAddressForPatronRegistrations">EmailAddressForPatronRegistrations</a> you have to enter a valid email address: '
888
            - pref: EmailAddressForPatronRegistrations
888
            - pref: EmailAddressForPatronRegistrations
889
              class: email
889
              class: email
890
        -
891
            - pref: PatronSelfRegistrationAlert
892
              choices:
893
                0: "Don't show"
894
                1: "Show"
895
            - an alert on staff interface home page when there are patrons in the category defined by <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronSelfRegistrationDefaultCategory">PatronSelfRegistrationDefaultCategory</a>.
890
    Suggestions:
896
    Suggestions:
891
        -
897
        -
892
            - pref: OpacSuggestionManagedBy
898
            - pref: OpacSuggestionManagedBy
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +14 lines)
Lines 180-186 Link Here
180
                <div class="row">
180
                <div class="row">
181
                    <div class="col-sm-12">
181
                    <div class="col-sm-12">
182
                        [%# Following statement must be in one line for translatability %]
182
                        [%# Following statement must be in one line for translatability %]
183
                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count || ( holds_with_cancellation_requests && CAN_user_circulate_circulate_remaining_permissions ) %]
183
                        [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count || ( holds_with_cancellation_requests && CAN_user_circulate_circulate_remaining_permissions ) || selfRegisteredPatrons %]
184
                            <div id="area-pending" class="page-section">
184
                            <div id="area-pending" class="page-section">
185
                                [% IF pending_article_requests %]
185
                                [% IF pending_article_requests %]
186
                                <div class="pending-info" id="article_requests_pending">
186
                                <div class="pending-info" id="article_requests_pending">
Lines 275-280 Link Here
275
                                        <span class="pending-number-link">[% holds_with_cancellation_requests | html %]</span>
275
                                        <span class="pending-number-link">[% holds_with_cancellation_requests | html %]</span>
276
                                    </div>
276
                                    </div>
277
                                [% END %]
277
                                [% END %]
278
279
                                [% IF self_registered_count %]
280
                                    <div class="pending-info" id="self_registered_patrons_info">
281
                                        Self-registrations from:
282
                                        <a class="self-registration-link pending-number-link self-registration-link-all" href="/cgi-bin/koha/members/member.pl?categorycode_filter=[% Koha.Preference('PatronSelfRegistrationDefaultCategory') | html %]">All libraries: [% self_registered_count | html %]</a>
283
284
                                        [% IF self_registered_mybranch_count %]
285
                                            <span>/</span>
286
                                            <a class="self-registration-link pending-number-link self-registration-link-branch" href="/cgi-bin/koha/members/member.pl?categorycode_filter=[% Koha.Preference('PatronSelfRegistrationDefaultCategory') | html %]&branchcode_filter=[% Branches.GetLoggedInBranchcode | html %]">[% Branches.GetLoggedInBranchname | html %]: [% self_registered_mybranch_count | html %]</a>
287
                                        [% END %]
288
                                    </div>
289
                                [% END %]
290
278
                            </div>
291
                            </div>
279
292
280
                        [% END %]
293
                        [% END %]
(-)a/mainpage.pl (+12 lines)
Lines 138-143 if ( C4::Context->preference('CurbsidePickup') ) { Link Here
138
    );
138
    );
139
}
139
}
140
140
141
if ( C4::Context->preference('PatronSelfRegistrationAlert') ) {
142
    my $categorycode = C4::Context->preference('PatronSelfRegistrationDefaultCategory');
143
    my $branchcode   = C4::Context::mybranch();
144
145
    my $rs = Koha::Patrons->search( { categorycode => $categorycode } );
146
147
    $template->param(
148
        self_registered_count          => $rs->count,
149
        self_registered_mybranch_count => $rs->search( { branchcode => $branchcode } )->count,
150
    );
151
}
152
141
$template->param(
153
$template->param(
142
    pendingcomments                => $pendingcomments,
154
    pendingcomments                => $pendingcomments,
143
    pendingtags                    => $pendingtags,
155
    pendingtags                    => $pendingtags,
(-)a/members/member.pl (-5 / +11 lines)
Lines 64-79 if ( $quicksearch and $searchmember && !$circsearch ) { Link Here
64
    }
64
    }
65
}
65
}
66
66
67
my $searchfieldstype = $input->param('searchfieldstype') || 'standard';
67
my $searchfieldstype    = $input->param('searchfieldstype') || 'standard';
68
my $searchtype       = $input->param('searchtype');
68
my $searchtype          = $input->param('searchtype');
69
my $branchcode_filter   = $input->param('branchcode_filter')   // '';
70
my $categorycode_filter = $input->param('categorycode_filter') // '';
69
71
70
$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
72
$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
71
73
74
my $defer_loading = $input->request_method() eq "GET"  && !$circsearch ? 1 : 0;
75
if ($branchcode_filter ne '' || $categorycode_filter ne '') {
76
    $defer_loading = 0;
77
}
78
72
$template->param(
79
$template->param(
73
    patron_lists => [ GetPatronLists() ],
80
    patron_lists => [ GetPatronLists() ],
74
    searchmember        => $searchmember,
81
    searchmember        => $searchmember,
75
    branchcode_filter   => scalar $input->param('branchcode_filter'),
82
    branchcode_filter   => $branchcode_filter,
76
    categorycode_filter => scalar $input->param('categorycode_filter'),
83
    categorycode_filter => $categorycode_filter,
77
    searchtype          => $searchtype,
84
    searchtype          => $searchtype,
78
    searchfieldstype    => $searchfieldstype,
85
    searchfieldstype    => $searchfieldstype,
79
    PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,
86
    PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,
80
- 

Return to bug 35028