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 (-3 / +115 lines)
Lines 28-34 Link Here
28
            [% END %])
28
            [% END %])
29
        [% END %]
29
        [% END %]
30
    </title>
30
    </title>
31
    [% INCLUDE 'doc-head-close.inc' %]
31
<style>
32
legend:hover {
33
    cursor: pointer;
34
}
35
</style>
36
[% INCLUDE 'doc-head-close.inc' %]
32
</head>
37
</head>
33
38
34
<body id="pat_memberentrygen" class="pat">
39
<body id="pat_memberentrygen" class="pat">
Lines 187-192 Link Here
187
                            </div>
192
                            </div>
188
                        [% END %]
193
                        [% END %]
189
194
195
                        [% SET fieldstohide = Koha.Preference('HideFieldsPatronAddForm') %]
196
                        [% IF Koha.Preference('HideFieldsPatronAddForm') %][% UNLESS step %]
197
                            <p id="selections">
198
                                <input type="checkbox" id="toggle_hidden_fields" title="These fields are hidden by default by the HideFieldsPatronAddForm system preference"><strong>Show hidden fields:</strong>
199
                                [% FOREACH field IN fieldstohide.split(',') %]
200
                                    [% SWITCH field %]
201
                                        [% CASE 'identity' %] Organization/Patron identity |
202
                                        [% CASE 'guarantor' %] Guarantor information |
203
                                        [% CASE 'primary_address' %] Main address |
204
                                        [% CASE 'primary_contact' %] Contact information |
205
                                        [% CASE 'alt_address' %] Alternate address |
206
                                        [% CASE 'alt_contact' %] Alternate contact |
207
                                        [% CASE 'lib_mgmt' %] Library management |
208
                                        [% CASE 'lib_setup' %] Library setup |
209
                                        [% CASE 'login' %] OPAC/Staff login |
210
                                        [% CASE 'flags' %] Patron account flags |
211
                                        [% CASE 'debarments' %] Patron restrictions |
212
                                        [% CASE 'housebound' %] Housebound roles |
213
                                        [% CASE 'additional' %] Additional attributes and identifiers |
214
                                        [% CASE 'messaging' %] Patron messaging preferences |
215
                                    [% END %]
216
                                [% END %]
217
                            </p>
218
                        [% END %][% END %]
219
190
                        <div id="toolbar" class="btn-toolbar">
220
                        <div id="toolbar" class="btn-toolbar">
191
                            [% UNLESS ( check_member ) %]
221
                            [% UNLESS ( check_member ) %]
192
                                [% IF quickadd && opadd %]
222
                                [% IF quickadd && opadd %]
Lines 523-529 Link Here
523
                                    </span> <!-- #/memberentry_guarantor_anchor -->
553
                                    </span> <!-- #/memberentry_guarantor_anchor -->
524
                                [% END # /IF show_guarantor || guarantor  %]
554
                                [% END # /IF show_guarantor || guarantor  %]
525
555
526
527
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
556
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
528
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
557
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
529
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
558
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
Lines 1403-1409 Link Here
1403
            }
1432
            }
1404
        }
1433
        }
1405
        var Sticky;
1434
        var Sticky;
1435
        function showHideFields(){
1436
            [% UNLESS step == 1 %]
1437
                [% IF fieldstohide.match('identity') %]
1438
                    $("#memberentry_identity").find('legend').nextAll().toggle();
1439
                [% END %]
1440
                [% IF show_guarantor || guarantor %]
1441
                    [% IF fieldstohide.match('guarantor') %]
1442
                        $("#memberentry_guarantor").find('legend').nextAll().toggle();
1443
                    [% END %]
1444
                [% END %]
1445
                [% IF fieldstohide.match('primary_address') %]
1446
                    $("#memberentry_mainaddress").find('legend').nextAll().toggle();
1447
                [% END %]
1448
                [% IF fieldstohide.match('primary_contact') %]
1449
                    $("#memberentry_contact").find('legend').nextAll().toggle();
1450
                [% END %]
1451
            [% END %]
1452
            [% UNLESS step == 6 %]
1453
                [% IF fieldstohide.match('alt_address') %]
1454
                    $("#memberentry_address").find('legend').nextAll().toggle();
1455
                [% END %]
1456
            [% END %]
1457
            [% UNLESS step == 2 %]
1458
                [% IF fieldstohide.match('alt_contact') %]
1459
                    $("#memberentry_altaddress").find('legend').nextAll().toggle();
1460
                [% END %]
1461
            [% END %]
1462
            [% UNLESS step == 3 %]
1463
                [% IF fieldstohide.match('lib_mgmt') %]
1464
                        $("#memberentry_library_management").find('legend').nextAll().toggle();
1465
                [% END %]
1466
                [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1467
                    [% IF fieldstohide.match('lib_setup') %]
1468
                        $("#memberentry_subscription").find('legend').nextAll().toggle();
1469
                    [% END %]
1470
                [% END %]
1471
                [% UNLESS nouserid && nopassword %]
1472
                    [% IF fieldstohide.match('login') %]
1473
                        $("#memberentry_userid").find('legend').nextAll().toggle();
1474
                    [% END %]
1475
                [% END %]
1476
                [% UNLESS ( opadd || opduplicate ) %]
1477
                    [% IF fieldstohide.match('flags') %]
1478
                        $("#memberentry_account_flags").find('legend').nextAll().toggle();
1479
                    [% END %]
1480
                [% END %]
1481
                [% IF fieldstohide.match('debarments') %]
1482
                    $("#memberentry_restrictions").find('legend').nextAll().toggle();
1483
                [% END %]
1484
            [% END %]
1485
            [% UNLESS step == 7 %]
1486
                [% IF Koha.Preference('HouseboundModule') %]
1487
                    [% IF fieldstohide.match('housebound') %]
1488
                        $("#memberentry_housebound_roles").find('legend').nextAll().toggle();
1489
                    [% END %]
1490
                [% END %]
1491
            [% END %]
1492
            [% UNLESS step == 4 %]
1493
                [% IF Koha.Preference('ExtendedPatronAttributes') %]
1494
                    [% IF fieldstohide.match('additional') %]
1495
                        $("#memberentry_patron_attributes").find('legend').nextAll().toggle();
1496
                    [% END %]
1497
                [% END %]
1498
            [% END %]
1499
            [% UNLESS step == 5 %]
1500
                [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1501
                    [% IF fieldstohide.match('messaging') %]
1502
                        $("#memberentry_messaging_prefs").find('legend').nextAll().toggle();
1503
                        $("#messaging_prefs_loading").toggle();
1504
                    [% END %]
1505
                [% END %]
1506
            [% END %]
1507
        }
1508
1406
        $(document).ready(function() {
1509
        $(document).ready(function() {
1510
            showHideFields();
1511
            $("#toggle_hidden_fields").change(function(){
1512
                showHideFields();
1513
            });
1514
1515
            $("legend").click(function(){
1516
                $(this).nextAll().toggle();
1517
                $("#messaging_prefs_loading").hide();
1518
            });
1519
1407
            $("#saverecord").css({ 'margin-left': 0 });
1520
            $("#saverecord").css({ 'margin-left': 0 });
1408
1521
1409
            Sticky = $("#toolbar");
1522
            Sticky = $("#toolbar");
1410
- 

Return to bug 3137