Bugzilla – Attachment 11095 Details for
Bug 5911
Transport Cost Matrix of transporting an item between branches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug_5911: Javascript and error messages corrections
bug5911-Javascript-and-error-messages-corrections.patch (text/plain), 2.86 KB, created by
Srdjan Jankovic
on 2012-07-23 23:57:14 UTC
(
hide
)
Description:
bug_5911: Javascript and error messages corrections
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2012-07-23 23:57:14 UTC
Size:
2.86 KB
patch
obsolete
>From 028ce84f6e225280b4ce8ba4e0bbc14ec522bc6f Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >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( >- '<input name="cost_'+cost_id+'" onblur="check_transport_cost(this);" size="4" value="'+$.trim(cost)+'" />'+ >+ '<input type="text" name="cost_'+cost_id+'" onblur="check_transport_cost(this);" size="4" value="'+$.trim(cost)+'" />'+ > '<br/>Disable <input name="disable_'+cost_id+'" value="1" onchange="disable_transport_cost_chg(this, \''+cost_id+'\');" type="checkbox" '+(disabled ? 'checked' : '')+' />' > ); > disable_transport_cost(cost_id, disabled); >@@ -106,7 +106,7 @@ $(document).ready(function() { > [% ELSE %] > <div id="celldiv_[% bt.id %]"> > [% END %] >- <div onclick="enable_cost_input('[% bt.id %]');">[% !bt.disabled && bt.value > '' ? bt.value : ' ' %]</div> >+ <div onclick="enable_cost_input('[% bt.id %]');">[% bt.disabled ? ' ' : bt.value %]</div> > <input type="hidden" name="cost_[% bt.id %]" value="[% bt.value %]" /> > [% IF bt.disabled %] > <input type="hidden" name="disable_[% bt.id %]" value="1" /> >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5911
:
3559
|
4689
|
7799
|
9576
|
9600
|
9626
|
9752
|
9850
|
10241
|
10431
|
10733
|
10882
|
10919
|
11075
|
11095
|
11096
|
11140
|
11144
|
11777
|
11820
|
11971