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 209-214 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
209
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
209
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
210
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
210
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
211
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
211
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
212
('HideFieldsPatronAddForm','',NULL,'Hide these fields by default when adding a new patron. These fields can still be expanded.','Multiple'),
212
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
213
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','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'),
214
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
214
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
215
('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 29-35 Link Here
29
            [% END %])
29
            [% END %])
30
        [% END %]
30
        [% END %]
31
    </title>
31
    </title>
32
    [% INCLUDE 'doc-head-close.inc' %]
32
<style>
33
legend:hover {
34
    cursor: pointer;
35
}
36
</style>
37
[% INCLUDE 'doc-head-close.inc' %]
33
</head>
38
</head>
34
39
35
<body id="pat_memberentrygen" class="pat">
40
<body id="pat_memberentrygen" class="pat">
Lines 188-193 Link Here
188
                            </div>
193
                            </div>
189
                        [% END %]
194
                        [% END %]
190
195
196
                        [% SET fieldstohide = Koha.Preference('HideFieldsPatronAddForm') %]
197
                        [% IF Koha.Preference('HideFieldsPatronAddForm') %][% UNLESS step %]
198
                            <p id="selections">
199
                                <input type="checkbox" id="toggle_hidden_fields" title="These fields are hidden by default by the HideFieldsPatronAddForm system preference"><strong>Show hidden fields:</strong>
200
                                [% FOREACH field IN fieldstohide.split(',') %]
201
                                    [% SWITCH field %]
202
                                        [% CASE 'identity' %] Organization/Patron identity |
203
                                        [% CASE 'guarantor' %] Guarantor information |
204
                                        [% CASE 'primary_address' %] Main address |
205
                                        [% CASE 'primary_contact' %] Contact information |
206
                                        [% CASE 'alt_address' %] Alternate address |
207
                                        [% CASE 'alt_contact' %] Alternate contact |
208
                                        [% CASE 'lib_mgmt' %] Library management |
209
                                        [% CASE 'lib_setup' %] Library setup |
210
                                        [% CASE 'login' %] OPAC/Staff login |
211
                                        [% CASE 'flags' %] Patron account flags |
212
                                        [% CASE 'debarments' %] Patron restrictions |
213
                                        [% CASE 'housebound' %] Housebound roles |
214
                                        [% CASE 'additional' %] Additional attributes and identifiers |
215
                                        [% CASE 'messaging' %] Patron messaging preferences |
216
                                    [% END %]
217
                                [% END %]
218
                            </p>
219
                        [% END %][% END %]
220
191
                        <div id="toolbar" class="btn-toolbar">
221
                        <div id="toolbar" class="btn-toolbar">
192
                            [% UNLESS ( check_member ) %]
222
                            [% UNLESS ( check_member ) %]
193
                                [% IF quickadd && opadd %]
223
                                [% IF quickadd && opadd %]
Lines 524-530 Link Here
524
                                    </span> <!-- #/memberentry_guarantor_anchor -->
554
                                    </span> <!-- #/memberentry_guarantor_anchor -->
525
                                [% END # /IF show_guarantor || guarantor  %]
555
                                [% END # /IF show_guarantor || guarantor  %]
526
556
527
528
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
557
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
529
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
558
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
530
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
559
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
Lines 1404-1410 Link Here
1404
            }
1433
            }
1405
        }
1434
        }
1406
        var Sticky;
1435
        var Sticky;
1436
        function showHideFields(){
1437
            [% UNLESS step == 1 %]
1438
                [% IF fieldstohide.match('identity') %]
1439
                    $("#memberentry_identity").find('legend').nextAll().toggle();
1440
                [% END %]
1441
                [% IF show_guarantor || guarantor %]
1442
                    [% IF fieldstohide.match('guarantor') %]
1443
                        $("#memberentry_guarantor").find('legend').nextAll().toggle();
1444
                    [% END %]
1445
                [% END %]
1446
                [% IF fieldstohide.match('primary_address') %]
1447
                    $("#memberentry_mainaddress").find('legend').nextAll().toggle();
1448
                [% END %]
1449
                [% IF fieldstohide.match('primary_contact') %]
1450
                    $("#memberentry_contact").find('legend').nextAll().toggle();
1451
                [% END %]
1452
            [% END %]
1453
            [% UNLESS step == 6 %]
1454
                [% IF fieldstohide.match('alt_address') %]
1455
                    $("#memberentry_address").find('legend').nextAll().toggle();
1456
                [% END %]
1457
            [% END %]
1458
            [% UNLESS step == 2 %]
1459
                [% IF fieldstohide.match('alt_contact') %]
1460
                    $("#memberentry_altaddress").find('legend').nextAll().toggle();
1461
                [% END %]
1462
            [% END %]
1463
            [% UNLESS step == 3 %]
1464
                [% IF fieldstohide.match('lib_mgmt') %]
1465
                        $("#memberentry_library_management").find('legend').nextAll().toggle();
1466
                [% END %]
1467
                [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1468
                    [% IF fieldstohide.match('lib_setup') %]
1469
                        $("#memberentry_subscription").find('legend').nextAll().toggle();
1470
                    [% END %]
1471
                [% END %]
1472
                [% UNLESS nouserid && nopassword %]
1473
                    [% IF fieldstohide.match('login') %]
1474
                        $("#memberentry_userid").find('legend').nextAll().toggle();
1475
                    [% END %]
1476
                [% END %]
1477
                [% UNLESS ( opadd || opduplicate ) %]
1478
                    [% IF fieldstohide.match('flags') %]
1479
                        $("#memberentry_account_flags").find('legend').nextAll().toggle();
1480
                    [% END %]
1481
                [% END %]
1482
                [% IF fieldstohide.match('debarments') %]
1483
                    $("#memberentry_restrictions").find('legend').nextAll().toggle();
1484
                [% END %]
1485
            [% END %]
1486
            [% UNLESS step == 7 %]
1487
                [% IF Koha.Preference('HouseboundModule') %]
1488
                    [% IF fieldstohide.match('housebound') %]
1489
                        $("#memberentry_housebound_roles").find('legend').nextAll().toggle();
1490
                    [% END %]
1491
                [% END %]
1492
            [% END %]
1493
            [% UNLESS step == 4 %]
1494
                [% IF Koha.Preference('ExtendedPatronAttributes') %]
1495
                    [% IF fieldstohide.match('additional') %]
1496
                        $("#memberentry_patron_attributes").find('legend').nextAll().toggle();
1497
                    [% END %]
1498
                [% END %]
1499
            [% END %]
1500
            [% UNLESS step == 5 %]
1501
                [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1502
                    [% IF fieldstohide.match('messaging') %]
1503
                        $("#memberentry_messaging_prefs").find('legend').nextAll().toggle();
1504
                        $("#messaging_prefs_loading").toggle();
1505
                    [% END %]
1506
                [% END %]
1507
            [% END %]
1508
        }
1509
1407
        $(document).ready(function() {
1510
        $(document).ready(function() {
1511
            showHideFields();
1512
            $("#toggle_hidden_fields").change(function(){
1513
                showHideFields();
1514
            });
1515
1516
            $("legend").click(function(){
1517
                $(this).nextAll().toggle();
1518
                $("#messaging_prefs_loading").hide();
1519
            });
1520
1408
            $("#saverecord").css({ 'margin-left': 0 });
1521
            $("#saverecord").css({ 'margin-left': 0 });
1409
1522
1410
            Sticky = $("#toolbar");
1523
            Sticky = $("#toolbar");
1411
- 

Return to bug 3137