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 211-216 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
211
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
211
('GoogleOpenIDConnectDefaultBranch',  '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'),
212
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
212
('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'),
213
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
213
('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'),
214
('HideFieldsPatronAddForm','',NULL,'Hide these fields by default when adding a new patron. These fields can still be expanded.','Multiple'),
214
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
215
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
215
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
216
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
216
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
217
('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 20-26 Link Here
20
            [% IF categoryname %]([% categoryname | html %])[% END %]
20
            [% IF categoryname %]([% categoryname | html %])[% END %]
21
        [% END %]
21
        [% END %]
22
    </title>
22
    </title>
23
    [% INCLUDE 'doc-head-close.inc' %]
23
<style>
24
legend:hover {
25
    cursor: pointer;
26
}
27
</style>
28
[% INCLUDE 'doc-head-close.inc' %]
24
</head>
29
</head>
25
30
26
<body id="pat_memberentrygen" class="pat">
31
<body id="pat_memberentrygen" class="pat">
Lines 161-166 Link Here
161
                            </div>
166
                            </div>
162
                        [% END %]
167
                        [% END %]
163
168
169
                        [% SET fieldstohide = Koha.Preference('HideFieldsPatronAddForm') %]
170
                        [% IF Koha.Preference('HideFieldsPatronAddForm') %][% UNLESS step %]
171
                            <p id="selections">
172
                                <input type="checkbox" id="toggle_hidden_fields" title="These fields are hidden by default by the HideFieldsPatronAddForm system preference"><strong>Show hidden fields:</strong>
173
                                [% FOREACH field IN fieldstohide.split(',') %]
174
                                    [% SWITCH field %]
175
                                        [% CASE 'identity' %] Organization/Patron identity |
176
                                        [% CASE 'guarantor' %] Guarantor information |
177
                                        [% CASE 'primary_address' %] Main address |
178
                                        [% CASE 'primary_contact' %] Contact information |
179
                                        [% CASE 'alt_address' %] Alternate address |
180
                                        [% CASE 'alt_contact' %] Alternate contact |
181
                                        [% CASE 'lib_mgmt' %] Library management |
182
                                        [% CASE 'lib_setup' %] Library setup |
183
                                        [% CASE 'login' %] OPAC/Staff login |
184
                                        [% CASE 'flags' %] Patron account flags |
185
                                        [% CASE 'debarments' %] Patron restrictions |
186
                                        [% CASE 'housebound' %] Housebound roles |
187
                                        [% CASE 'additional' %] Additional attributes and identifiers |
188
                                        [% CASE 'messaging' %] Patron messaging preferences |
189
                                    [% END %]
190
                                [% END %]
191
                            </p>
192
                        [% END %][% END %]
193
164
                        <div id="toolbar" class="btn-toolbar">
194
                        <div id="toolbar" class="btn-toolbar">
165
                            [% UNLESS ( check_member ) %]
195
                            [% UNLESS ( check_member ) %]
166
                                [% IF quickadd && opadd %]
196
                                [% IF quickadd && opadd %]
Lines 497-503 Link Here
497
                                    </span> <!-- #/memberentry_guarantor_anchor -->
527
                                    </span> <!-- #/memberentry_guarantor_anchor -->
498
                                [% END # /IF show_guarantor || guarantor  %]
528
                                [% END # /IF show_guarantor || guarantor  %]
499
529
500
501
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
530
                                [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %]
502
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
531
                                    [% IF Koha.Preference( 'AddressFormat' ) %]
503
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
532
                                        [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
Lines 1377-1383 Link Here
1377
            }
1406
            }
1378
        }
1407
        }
1379
        var Sticky;
1408
        var Sticky;
1409
        function showHideFields(){
1410
            [% UNLESS step == 1 %]
1411
                [% IF fieldstohide.match('identity') %]
1412
                    $("#memberentry_identity").find('legend').nextAll().toggle();
1413
                [% END %]
1414
                [% IF show_guarantor || guarantor %]
1415
                    [% IF fieldstohide.match('guarantor') %]
1416
                        $("#memberentry_guarantor").find('legend').nextAll().toggle();
1417
                    [% END %]
1418
                [% END %]
1419
                [% IF fieldstohide.match('primary_address') %]
1420
                    $("#memberentry_mainaddress").find('legend').nextAll().toggle();
1421
                [% END %]
1422
                [% IF fieldstohide.match('primary_contact') %]
1423
                    $("#memberentry_contact").find('legend').nextAll().toggle();
1424
                [% END %]
1425
            [% END %]
1426
            [% UNLESS step == 6 %]
1427
                [% IF fieldstohide.match('alt_address') %]
1428
                    $("#memberentry_address").find('legend').nextAll().toggle();
1429
                [% END %]
1430
            [% END %]
1431
            [% UNLESS step == 2 %]
1432
                [% IF fieldstohide.match('alt_contact') %]
1433
                    $("#memberentry_altaddress").find('legend').nextAll().toggle();
1434
                [% END %]
1435
            [% END %]
1436
            [% UNLESS step == 3 %]
1437
                [% IF fieldstohide.match('lib_mgmt') %]
1438
                        $("#memberentry_library_management").find('legend').nextAll().toggle();
1439
                [% END %]
1440
                [% UNLESS nodateenrolled && noopacnote && noborrowernotes %]
1441
                    [% IF fieldstohide.match('lib_setup') %]
1442
                        $("#memberentry_subscription").find('legend').nextAll().toggle();
1443
                    [% END %]
1444
                [% END %]
1445
                [% UNLESS nouserid && nopassword %]
1446
                    [% IF fieldstohide.match('login') %]
1447
                        $("#memberentry_userid").find('legend').nextAll().toggle();
1448
                    [% END %]
1449
                [% END %]
1450
                [% UNLESS ( opadd || opduplicate ) %]
1451
                    [% IF fieldstohide.match('flags') %]
1452
                        $("#memberentry_account_flags").find('legend').nextAll().toggle();
1453
                    [% END %]
1454
                [% END %]
1455
                [% IF fieldstohide.match('debarments') %]
1456
                    $("#memberentry_restrictions").find('legend').nextAll().toggle();
1457
                [% END %]
1458
            [% END %]
1459
            [% UNLESS step == 7 %]
1460
                [% IF Koha.Preference('HouseboundModule') %]
1461
                    [% IF fieldstohide.match('housebound') %]
1462
                        $("#memberentry_housebound_roles").find('legend').nextAll().toggle();
1463
                    [% END %]
1464
                [% END %]
1465
            [% END %]
1466
            [% UNLESS step == 4 %]
1467
                [% IF Koha.Preference('ExtendedPatronAttributes') %]
1468
                    [% IF fieldstohide.match('additional') %]
1469
                        $("#memberentry_patron_attributes").find('legend').nextAll().toggle();
1470
                    [% END %]
1471
                [% END %]
1472
            [% END %]
1473
            [% UNLESS step == 5 %]
1474
                [% IF Koha.Preference('EnhancedMessagingPreferences') %]
1475
                    [% IF fieldstohide.match('messaging') %]
1476
                        $("#memberentry_messaging_prefs").find('legend').nextAll().toggle();
1477
                        $("#messaging_prefs_loading").toggle();
1478
                    [% END %]
1479
                [% END %]
1480
            [% END %]
1481
        }
1482
1380
        $(document).ready(function() {
1483
        $(document).ready(function() {
1484
            showHideFields();
1485
            $("#toggle_hidden_fields").change(function(){
1486
                showHideFields();
1487
            });
1488
1489
            $("legend").click(function(){
1490
                $(this).nextAll().toggle();
1491
                $("#messaging_prefs_loading").hide();
1492
            });
1493
1381
            $("#saverecord").css({ 'margin-left': 0 });
1494
            $("#saverecord").css({ 'margin-left': 0 });
1382
1495
1383
            Sticky = $("#toolbar");
1496
            Sticky = $("#toolbar");
1384
- 

Return to bug 3137