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

(-)a/installer/data/mysql/atomicupdate/bug_3137-add_HideFieldsPatronAddForm_syspref.perl (+7 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('HideFieldsPatronAddForm','',NULL,'Hide these fields by default when adding a new patron. These fields can still be expanded.','Multiple') });
4
5
    SetVersion( $DBversion );
6
    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
7
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 208-213 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
208
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
208
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
209
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
209
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
210
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
210
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
211
('HideFieldsPatronAddForm','',NULL,'Hide these fields by default when adding a new patron. These fields can still be expanded.','Multiple'),
211
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
212
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
212
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
213
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
213
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
214
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+18 lines)
Lines 1-6 Link Here
1
Patrons:
1
Patrons:
2
    General:
2
    General:
3
     -
3
     -
4
         - When adding new patrons or editing existing patrons, hide the following fields from the full form (can still be expanded later)
5
         - pref: HideFieldsPatronAddForm
6
           multiple:
7
               identity: "a. Organization/Patron identity"
8
               guarantor: "b. Guarantor information"
9
               primary_address: "c. Main address"
10
               primary_contact: "d. Contact information"
11
               alt_address: "e. Alternate address"
12
               alt_contact: "f. Alternate contact"
13
               lib_mgmt: "g. Library management"
14
               lib_setup: "h. Library setup"
15
               login: "i. OPAC/Staff login"
16
               flags: "j. Patron account flags (existing patrons)"
17
               debarments: "k. Patron restrictions (existing patrons)"
18
               housebound: "l. Housebound roles"
19
               additional: "m. Additional attributes and identifiers"
20
               messaging: "n. Patron messaging preferences"
21
     -
4
         - pref: AutoEmailOpacUser
22
         - pref: AutoEmailOpacUser
5
           choices:
23
           choices:
6
               yes: Send
24
               yes: Send
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +103 lines)
Lines 187-192 Link Here
187
                            </div>
187
                            </div>
188
                        [% END %]
188
                        [% END %]
189
189
190
                        [% SET fieldstohide = Koha.Preference('HideFieldsPatronAddForm') %]
191
                        [% IF Koha.Preference('HideFieldsPatronAddForm') %][% UNLESS step %]
192
                            <p id="selections">
193
                                <input type="checkbox" id="toggle_hidden_fields" title="These fields are hidden by default by the HideFieldsPatronAddForm system preference"><strong>Show hidden fields:</strong>
194
                                [% FOREACH field IN fieldstohide.split(',') %]
195
                                    [% SWITCH field %]
196
                                        [% CASE 'identity' %] Organization/Patron identity |
197
                                        [% CASE 'guarantor' %] Guarantor information |
198
                                        [% CASE 'primary_address' %] Main address |
199
                                        [% CASE 'primary_contact' %] Contact information |
200
                                        [% CASE 'alt_address' %] Alternate address |
201
                                        [% CASE 'alt_contact' %] Alternate contact |
202
                                        [% CASE 'lib_mgmt' %] Library management |
203
                                        [% CASE 'lib_setup' %] Library setup |
204
                                        [% CASE 'login' %] OPAC/Staff login |
205
                                        [% CASE 'flags' %] Patron account flags |
206
                                        [% CASE 'debarments' %] Patron restrictions |
207
                                        [% CASE 'housebound' %] Housebound roles |
208
                                        [% CASE 'additional' %] Additional attributes and identifiers |
209
                                        [% CASE 'messaging' %] Patron messaging preferences |
210
                                    [% END %]
211
                                [% END %]
212
                            </p>
213
                        [% END %][% END %]
214
190
                        <div id="toolbar" class="btn-toolbar">
215
                        <div id="toolbar" class="btn-toolbar">
191
                            [% UNLESS ( check_member ) %]
216
                            [% UNLESS ( check_member ) %]
192
                                [% IF quickadd && opadd %]
217
                                [% IF quickadd && opadd %]
Lines 523-529 Link Here
523
                                    </span> <!-- #/memberentry_guarantor_anchor -->
548
                                    </span> <!-- #/memberentry_guarantor_anchor -->
524
                                [% END # /IF show_guarantor || guarantor  %]
549
                                [% END # /IF show_guarantor || guarantor  %]
525
550
526
527
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
551
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
528
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
552
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
529
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
553
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
Lines 1403-1409 Link Here
1403
            }
1427
            }
1404
        }
1428
        }
1405
        var Sticky;
1429
        var Sticky;
1430
        function showHideFields(){
1431
            [% UNLESS step == 1 %]
1432
                [% IF fieldstohide.match('identity') %]
1433
                    $("#memberentry_identity").toggle();
1434
                [% END %]
1435
                [% IF show_guarantor || guarantor %]
1436
                    [% IF fieldstohide.match('guarantor') %]
1437
                        $("#memberentry_guarantor").toggle();
1438
                    [% END %]
1439
                [% END %]
1440
                [% IF fieldstohide.match('primary_address') %]
1441
                    $("#memberentry_mainaddress").toggle();
1442
                [% END %]
1443
                [% IF fieldstohide.match('primary_contact') %]
1444
                    $("#memberentry_contact").toggle();
1445
                [% END %]
1446
            [% END %]
1447
            [% UNLESS step == 6 %]
1448
                [% IF fieldstohide.match('alt_address') %]
1449
                    $("#memberentry_address").toggle();
1450
                [% END %]
1451
            [% END %]
1452
            [% UNLESS step == 2 %]
1453
                [% IF fieldstohide.match('alt_contact') %]
1454
                    $("#memberentry_altcontact").toggle();
1455
                [% END %]
1456
            [% END %]
1457
            [% UNLESS step == 3 %]
1458
                [% IF fieldstohide.match('lib_mgmt') %]
1459
                        $("#memberentry_library_management").toggle();
1460
                [% END %]
1461
                [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1462
                    [% IF fieldstohide.match('lib_setup') %]
1463
                        $("#memberentry_subscription").toggle();
1464
                    [% END %]
1465
                [% END %]
1466
                [% UNLESS nouserid && nopassword %]
1467
                    [% IF fieldstohide.match('login') %]
1468
                        $("#memberentry_userid").toggle();
1469
                    [% END %]
1470
                [% END %]
1471
                [% UNLESS ( opadd || opduplicate ) %]
1472
                    [% IF fieldstohide.match('flags') %]
1473
                        $("#memberentry_account_flags").toggle();
1474
                    [% END %]
1475
                [% END %]
1476
                [% IF fieldstohide.match('debarments') %]
1477
                    $("#memberentry_restrictions").toggle();
1478
                [% END %]
1479
            [% END %]
1480
            [% UNLESS step == 7 %]
1481
                [% IF Koha.Preference('HouseboundModule') %]
1482
                    [% IF fieldstohide.match('housebound') %]
1483
                        $("#memberentry_housebound_roles").toggle();
1484
                    [% END %]
1485
                [% END %]
1486
            [% END %]
1487
            [% UNLESS step == 4 %]
1488
                [% IF Koha.Preference('ExtendedPatronAttributes') %]
1489
                    [% IF fieldstohide.match('additional') %]
1490
                        $("#memberentry_patron_attributes").toggle();
1491
                    [% END %]
1492
                [% END %]
1493
            [% END %]
1494
            [% UNLESS step == 5 %]
1495
                [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1496
                    [% IF fieldstohide.match('messaging') %]
1497
                        $("#memberentry_messaging_prefs").toggle();
1498
                    [% END %]
1499
                [% END %]
1500
            [% END %]
1501
        }
1502
1406
        $(document).ready(function() {
1503
        $(document).ready(function() {
1504
            showHideFields();
1505
            $("#toggle_hidden_fields").change(function(){
1506
                showHideFields();
1507
            });
1508
1407
            $("#saverecord").css({ 'margin-left': 0 });
1509
            $("#saverecord").css({ 'margin-left': 0 });
1408
1510
1409
            Sticky = $("#toolbar");
1511
            Sticky = $("#toolbar");
1410
- 

Return to bug 3137