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

(-)a/C4/HoldsQueue.pm (-2 / +6 lines)
Lines 94-101 sub UpdateTransportCostMatrix { Link Here
94
        my $cost = $_->{cost};
94
        my $cost = $_->{cost};
95
        my $from = $_->{frombranch};
95
        my $from = $_->{frombranch};
96
        my $to = $_->{tobranch};
96
        my $to = $_->{tobranch};
97
        if ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) {
97
        if ($_->{disable_transfer}) {
98
            warn  "Invalid $from -> $to cost $cost - nust be a number in 0 to 1 range, disablig";
98
            $cost ||= 0;
99
        }
100
        elsif ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) {
101
            warn  "Invalid $from -> $to cost $cost - must be a number >= 0, disablig";
102
            $cost = 0;
99
            $_->{disable_transfer} = 1;
103
            $_->{disable_transfer} = 1;
100
        }
104
        }
101
        $sth->execute( $from, $to, $cost, $_->{disable_transfer} ? 1 : 0 );
105
        $sth->execute( $from, $to, $cost, $_->{disable_transfer} ? 1 : 0 );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt (-3 / +2 lines)
Lines 28-34 function enable_cost_input(cost_id) { Link Here
28
    $(cell).removeClass('disabled-transfer');
28
    $(cell).removeClass('disabled-transfer');
29
29
30
    $('#celldiv_'+cost_id).html(
30
    $('#celldiv_'+cost_id).html(
31
        '<input name="cost_'+cost_id+'" onblur="check_transport_cost(this);" size="4" value="'+$.trim(cost)+'" />'+
31
        '<input type="text" name="cost_'+cost_id+'" onblur="check_transport_cost(this);" size="4" value="'+$.trim(cost)+'" />'+
32
        '<br/>Disable <input name="disable_'+cost_id+'" value="1" onchange="disable_transport_cost_chg(this, \''+cost_id+'\');" type="checkbox" '+(disabled ? 'checked' : '')+' />'
32
        '<br/>Disable <input name="disable_'+cost_id+'" value="1" onchange="disable_transport_cost_chg(this, \''+cost_id+'\');" type="checkbox" '+(disabled ? 'checked' : '')+' />'
33
    );
33
    );
34
    disable_transport_cost(cost_id, disabled);
34
    disable_transport_cost(cost_id, disabled);
Lines 106-112 $(document).ready(function() { Link Here
106
                            [% ELSE %]
106
                            [% ELSE %]
107
                            <div id="celldiv_[% bt.id %]">
107
                            <div id="celldiv_[% bt.id %]">
108
                            [% END %]
108
                            [% END %]
109
                            <div onclick="enable_cost_input('[% bt.id %]');">[% !bt.disabled && bt.value > '' ? bt.value : '&nbsp;' %]</div>
109
                            <div onclick="enable_cost_input('[% bt.id %]');">[% bt.disabled ? '&nbsp;' : bt.value %]</div>
110
                            <input type="hidden" name="cost_[% bt.id %]" value="[% bt.value %]" />
110
                            <input type="hidden" name="cost_[% bt.id %]" value="[% bt.value %]" />
111
                            [% IF bt.disabled %]
111
                            [% IF bt.disabled %]
112
                            <input type="hidden" name="disable_[% bt.id %]" value="1" />
112
                            <input type="hidden" name="disable_[% bt.id %]" value="1" />
113
- 

Return to bug 5911