From 028ce84f6e225280b4ce8ba4e0bbc14ec522bc6f Mon Sep 17 00:00:00 2001 From: Srdjan Date: Tue, 24 Jul 2012 11:54:19 +1200 Subject: [PATCH] bug_5911: Javascript and error messages corrections --- C4/HoldsQueue.pm | 8 ++++++-- .../prog/en/modules/admin/transport-cost-matrix.tt | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 05095d8..d7696dd 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -94,8 +94,12 @@ sub UpdateTransportCostMatrix { my $cost = $_->{cost}; my $from = $_->{frombranch}; my $to = $_->{tobranch}; - if ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) { - warn "Invalid $from -> $to cost $cost - nust be a number in 0 to 1 range, disablig"; + if ($_->{disable_transfer}) { + $cost ||= 0; + } + elsif ( !defined ($cost) || ($cost !~ m/(0|[1-9][0-9]*)(\.[0-9]*)?/o) ) { + warn "Invalid $from -> $to cost $cost - must be a number >= 0, disablig"; + $cost = 0; $_->{disable_transfer} = 1; } $sth->execute( $from, $to, $cost, $_->{disable_transfer} ? 1 : 0 ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt index db9cf24..8d12419 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/transport-cost-matrix.tt @@ -28,7 +28,7 @@ function enable_cost_input(cost_id) { $(cell).removeClass('disabled-transfer'); $('#celldiv_'+cost_id).html( - ''+ + ''+ '
Disable ' ); disable_transport_cost(cost_id, disabled); @@ -106,7 +106,7 @@ $(document).ready(function() { [% ELSE %]
[% END %] -
[% !bt.disabled && bt.value > '' ? bt.value : ' ' %]
+
[% bt.disabled ? ' ' : bt.value %]
[% IF bt.disabled %] -- 1.7.9.5