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

(-)a/installer/data/mysql/atomicupdate/bug_7223.pl (+49 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "7223",
6
    description => "Add BOR_RELATIONSHIP",
7
    up          => sub {
8
        my ($args) = @_;
9
10
        my ($dbh, $out) = @$args{qw(dbh out)};
11
12
        # Step 1: Create the authorized value category
13
        $dbh->do(q{
14
            INSERT IGNORE INTO authorised_value_categories (category_name, is_system)
15
            VALUES ('BOR_RELATIONSHIP', 1)
16
        });
17
18
        say $out "Added BOR_RELATIONSHIP authorized value category";
19
20
        # Step 2: Fetch existing borrowerRelationship values
21
        my $sth = $dbh->prepare(q{
22
            SELECT value FROM systempreferences WHERE variable = 'borrowerRelationship'
23
        });
24
        $sth->execute();
25
        my ($pipe_delimited_values) = $sth->fetchrow_array;
26
27
        # Check if we got any values
28
        if (defined $pipe_delimited_values) {
29
            # Step 3: Split the pipe-delimited values
30
            my @values = split(/\|/, $pipe_delimited_values);
31
32
            # Step 4: Insert each value into the authorised_values table
33
            for my $value (@values) {
34
                $dbh->do(q{
35
                    INSERT IGNORE INTO authorised_values (category, authorised_value)
36
                    VALUES ('BOR_RELATIONSHIP', ?)
37
                }, undef, $value);
38
            }
39
40
            say $out "Transferred borrowerRelationship values to authorized values";
41
        }
42
43
        $dbh->do(q{
44
            DELETE FROM systempreferences WHERE variable='borrowerRelationship'
45
        });
46
47
        say $out "Deleted system preference 'borrowerRelationship'";
48
    },
49
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 121-127 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
121
('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'),
121
('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'),
122
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
122
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
123
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
123
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
124
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
125
('BorrowerRenewalPeriodBase','now','dateexpiry|now|combination','Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date ','Choice'),
124
('BorrowerRenewalPeriodBase','now','dateexpiry|now|combination','Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date ','Choice'),
126
('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'),
125
('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'),
127
('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'),
126
('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (+2 lines)
Lines 453-458 Link Here
453
            <p>Used for acquisitions statistical purposes</p>
453
            <p>Used for acquisitions statistical purposes</p>
454
        [% CASE 'BOR_NOTES' %]
454
        [% CASE 'BOR_NOTES' %]
455
            <p>Values for custom patron messages that appear on the circulation screen and the OPAC. The value in the description field should be the message text and is limited to 200 characters</p>
455
            <p>Values for custom patron messages that appear on the circulation screen and the OPAC. The value in the description field should be the message text and is limited to 200 characters</p>
456
        [% CASE 'BOR_RELATIONSHIP' %]
457
            <p>Values for valid relationships between a guarantor and a guarantee</p>
456
        [% CASE 'branches' %]
458
        [% CASE 'branches' %]
457
            <p></p>
459
            <p></p>
458
        [% CASE 'Bsort1' %]
460
        [% CASE 'Bsort1' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-6 lines)
Lines 338-348 Patrons: Link Here
338
           source: borrowers
338
           source: borrowers
339
         - "will be used to detect possible duplicates when adding a new patron."
339
         - "will be used to detect possible duplicates when adding a new patron."
340
    Patron relationships:
340
    Patron relationships:
341
     -
342
         - "Guarantors can be the following of those they guarantee:"
343
         - pref: borrowerRelationship
344
           class: multi
345
         - (input multiple choices separated by |).
346
     -
341
     -
347
         - "When adding a guarantee to a guarantor, whether it's from the guarantor's form or the guarantee's form, fill the following fields in the guarantee's member entry form from the guarantors record:"
342
         - "When adding a guarantee to a guarantor, whether it's from the guarantor's form or the guarantee's form, fill the following fields in the guarantee's member entry form from the guarantors record:"
348
         - pref: PrefillGuaranteeField
343
         - pref: PrefillGuaranteeField
349
- 

Return to bug 7223