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

(-)a/installer/data/mysql/atomicupdate/bug_37641-add_mynewpref_syspref.pl (+18 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  => "37641",
6
    description => "Ability to make claim returned note mandatory",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
12
        $dbh->do(
13
            q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ClaimReturnedMandatoryNote', '0', NULL, 'If enabled, claims note will be mandatory - there must be something in the note field', 'YesNo') }
14
        );
15
16
        say $out "Added new system preference 'ClaimReturnedMandatoryNote'";
17
    },
18
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 160-165 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
160
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
160
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
161
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
161
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
162
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
162
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
163
('ClaimReturnedMandatoryNote','0',NULL,'If enabled, claims note will be mandatory - there must be something in the note field', 'YesNo'),
163
('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'),
164
('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'),
164
('ClaimsLog','1',NULL,'If ON, log all notices sent','YesNo'),
165
('ClaimsLog','1',NULL,'If ON, log all notices sent','YesNo'),
165
('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ),
166
('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modal-claims.inc (+12 lines)
Lines 42-47 Link Here
42
42
43
[% BLOCK 'modal-claims-js' %]
43
[% BLOCK 'modal-claims-js' %]
44
<script>
44
<script>
45
    // MANDATORY NOTE
46
    var ClaimReturnedMandatoryNote = "[% Koha.Preference('ClaimReturnedMandatoryNote') | html %]";
47
    // if syspref is enabled, make the note mandatory
48
    if (ClaimReturnedMandatoryNote == 1) {
49
        // Disable the "Make claim" button until text has been added to the "Notes" field on the claims returned modal
50
        $('#claims-returned-modal-btn-submit').attr('disabled','disabled').attr('title', _('You can\'t submit this form with an empty note'));
51
        $('#claims-returned-notes').attr('placeholder', _('Please add note explaining the reason for the claim'));
52
        $('#claims-returned-notes').keyup(function() {
53
            $('#claims-returned-modal-btn-submit').removeAttr('title');
54
            $('#claims-returned-modal-btn-submit').removeAttr('disabled');
55
        });
56
    }
45
57
46
    // Verify if the syspref is defined
58
    // Verify if the syspref is defined
47
    var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
59
    var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +6 lines)
Lines 1436-1441 Circulation: Link Here
1436
              class: integer
1436
              class: integer
1437
            - days.
1437
            - days.
1438
            - <span class="hint">This system preference is used by the cleanup_database.pl cronjob.</span>
1438
            - <span class="hint">This system preference is used by the cleanup_database.pl cronjob.</span>
1439
        -
1440
            - pref: ClaimReturnedMandatoryNote
1441
              choices:
1442
                  1: Enable
1443
                  0: Disable
1444
            - " a check to ensure the note is not empty before making a claim."
1439
1445
1440
    Recalls:
1446
    Recalls:
1441
        -
1447
        -
1442
- 

Return to bug 37641