[Bug 7435] New: An inactive fund is selected a default in neworderempty.pl
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Bug #: 7435 Summary: An inactive fund is selected a default in neworderempty.pl Classification: Unclassified Change sponsored?: --- Product: Koha Version: unspecified Platform: All OS/Version: All Status: ASSIGNED Severity: minor Priority: P5 - low Component: Acquisitions AssignedTo: adrien.saurat@biblibre.com ReportedBy: adrien.saurat@biblibre.com QAContact: ian.walls@bywatersolutions.com When making a new order in the neworderempty page ( Home › Acquisitions › *budget* › Basket X › New order ), in some cases the "Fund" select box display a fund which should be hidden. Here is an excerpt from the HTML code of a problematic case: <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> <option value="1" class="b_inactive" style="display : none;">fond test A1</option> <option value="2" class="b_inactive" style="display : none;">fond test A2</option> <option value="3" class="b_inactive" style="display : none;">test fond B1</option> <option value="4" class="b_inactive" style="display : none;">test fond A0 à rendre inactif</option> <option value="5">poste 3a</option> <option value="6">poste 3b</option> <option value="7">poste budgetaire #2-A</option> </select> In this case, "fond test A1" should be hidden, but it's actually displayed as the default choice. The CSS hiding is not functionning properly. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 --- Comment #1 from Adrien SAURAT <adrien.saurat@biblibre.com> 2012-01-11 15:13:59 UTC --- Test plan : 1) Create different budgets, at least 2, both being Activated. 2) In each budget, create at least one Fund. 3) When you select a vendor and order a new book, you see all your funds in the "Fund" select box. 4) Now edit the 1st budget (containing the funds which appear on top in the select box) and deactivate it. 5) Go back to the book ordering, the Fund select box still displays the 1st fund of the 1st budget, even though it's supposed to be not active and thus hidden. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 --- Comment #2 from Adrien SAURAT <adrien.saurat@biblibre.com> 2012-01-11 15:31:29 UTC --- Created attachment 7107 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7107 proposed patch Add a "Select a fund" default line. A control already exists, ensuring that the user will select something. Made the "Fund" label appear in red. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Adrien SAURAT <adrien.saurat@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |PATCH-Sent Patch Status|--- |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7107|0 |1 is obsolete| | --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> 2012-01-13 06:50:42 UTC --- Created attachment 7125 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7125 Bug 7435: corrects Fund selectbox in addneworder Prevent disabled funds to appear in the Fund select box. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Patch Status|Needs Signoff |Signed Off -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Fred P <fred.pierre@smfpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fred.pierre@smfpl.org --- Comment #4 from Fred P <fred.pierre@smfpl.org> 2012-01-16 17:04:40 UTC --- Displaying the inactive funds in red interferes with the display:none setting. The problem can be solved by option-grouping the selection list. A secondary problem also exists that the Show All checkbox can display the full list, but not un-display it. The javascript is buggy and prevents re-hiding the inactive items. Here is an effective patch: ----------------------------------------------------------- File: neworderempty.pl Near Line 263: ----------------------------------------------------------- my $budget_loop = []; my $inactive_budget_loop = []; my $budgets = GetBudgetHierarchy(q{},$borrower->{branchcode},$borrower->{borrowernumber}); foreach my $r (@{$budgets}) { if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { next; } if($r->{budget_period_active}){ push @{$budget_loop}, { b_id => $r->{budget_id}, b_txt => $r->{budget_name}, b_active => $r->{budget_period_active}, b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, }; }else{ push @{$inactive_budget_loop}, { b_id => $r->{budget_id}, b_txt => $r->{budget_name}, b_active => $r->{budget_period_active}, b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, }; } } if ($close) { $budget_id = $data->{'budget_id'}; $budget_name = $budget->{'budget_name'}; } ----------------------------------------------------------- Near Line 392: ----------------------------------------------------------- budget_loop => $budget_loop, inactive_budget_loop => $inactive_budget_loop, isbn => $data->{'isbn'}, ----------------------------------------------------------- THAT FIXES THE JAVASCRIPT for the Checkbox "Show All" Next we create the Option Groups in the Select Drop-Down: ----------------------------------------------------------- File: neworderempty.tt Near Line 95: ----------------------------------------------------------- $('#showallbudgets').click(function() { if ( $('#inactive_funds .b_inactive').is(":visible") ) { $('#inactive_funds').attr("disabled","disabled"); $('#inactive_funds .b_inactive').hide(); } else { $('#inactive_funds').attr("disabled",""); $('#inactive_funds .b_inactive').show(); } }); ----------------------------------------------------------- Near Line 333: ----------------------------------------------------------- <label for="budget_id">Fund: </label> <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id"> <optgroup label="active funds"> [% IF !(budget_id) %]<option value='0' >Select Fund</option> [% END %] [% FOREACH budget_loo IN budget_loop %] [% IF ( budget_loo.b_sel ) %] <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option> [% ELSE %] [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option> [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none; color:red;" >[% budget_loo.b_txt %]</option> [% END %] [% END %] [% END %] </optgroup> <optgroup label="inactive funds" id="inactive_funds" disabled="disabled"> [% FOREACH inactive_budget_loo IN inactive_budget_loop %] [% IF ( inactive_budget_loo.b_sel ) %] <option value="[% inactive_budget_loo.b_id %]" selected="selected">[% inactive_budget_loo.b_txt %]</option> [% ELSE %] [% IF ( inactive_budget_loo.b_active ) %]<option value="[% inactive_budget_loo.b_id %]">[% inactive_budget_loo.b_txt %]</option> [% ELSE %]<option value="[% inactive_budget_loo.b_id %]" class="b_inactive" style="display : none;" >[% inactive_budget_loo.b_txt %]</option> [% END %] [% END %] [% END %] </optgroup> </select> ---------------------------------------------------------------- On my system, Chrome displays only two lines of the drop-down, both before and after the fix, so I use Firefox for testing this. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 --- Comment #5 from Fred P <fred.pierre@smfpl.org> 2012-01-16 17:09:44 UTC --- Because you might still want to edit an invoice from 2011, even though the fund is inactive. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 --- Comment #6 from Adrien SAURAT <adrien.saurat@biblibre.com> 2012-01-17 08:27:14 UTC --- The inactive funds are not supposed to appear in red! Did they do so when you tested this? I just made red the "Fund:" label before the selectbox. When I test my patch the "Show All" checkbox works correctly (when showing all and hiding inactive funds again). That's for Firefox 9. Testing with Chromium (linux version of Chrome), showing all works but then, unchecking the box to hide again won't do anything, but it was the same before the patch I sent. I agree that it would be a good occasion to repair a browser-specific code, but does your patch work with Chromium? What's with this "Chrome displays only two lines of the drop-down" problem? Sounds strange... Is the koha javascript guilty or is it a bug of this browser? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 --- Comment #7 from Fred P <fred.pierre@smfpl.org> 2012-01-17 14:40:21 UTC --- Excuse me for jumping in without fully testing your patch in Firefox. Chrome does have some glitchy behavior, but it's what I test on first. Your patch does work well for Firefox. Thank you for your work. I mentioned the red text only because of the original post. Our staff asked for the inactive funds to be red to distinguish them from the active funds and red text interferes with the css code, "display:none" used to hide the inactive funds options. Your use of the label "required" class works well. We modified the javascript such that it does rehide the inactive items in Chrome, so feel free to use that if the patch gets future modifications. I think the other consideration is that we are using Koha 3.5, and not up-to-date 3.6, so some changes have already been made prior to our suggestion. I don't have access to the up-to-date javascript in neworderempty.tt, so perhaps the issues with rehiding are already solved. Apologies for not testing your script before commenting - we were very excited that we got it working for our Tech Services. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |paul.poulain@biblibre.com Version|unspecified |rel_3_6 --- Comment #8 from Paul Poulain <paul.poulain@biblibre.com> 2012-01-17 17:22:41 UTC --- QA comment: good test plan, small patch, passed QA -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7435 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #9 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This fix was included in the 3.6.x branch prior to 3.6.4. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org