Bugzilla – Attachment 77315 Details for
Bug 15184
Ability to duplicate existing order lines to a given basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15184: Prepare the ground - Move funds and sort fields autoupdate
Bug-15184-Prepare-the-ground---Move-funds-and-sort.patch (text/plain), 8.71 KB, created by
Jonathan Druart
on 2018-07-27 19:59:09 UTC
(
hide
)
Description:
Bug 15184: Prepare the ground - Move funds and sort fields autoupdate
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-07-27 19:59:09 UTC
Size:
8.71 KB
patch
obsolete
>From e78afda348d48e95c41720bbafc3186f2e326d29 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 27 Jul 2018 15:47:06 -0300 >Subject: [PATCH] Bug 15184: Prepare the ground - Move funds and sort fields > autoupdate > >We are going to reuse the same logic: when a fund is selected the >statistic values are automatically updated. >Let move it to make it reusable more easily and isolate the code. >--- > .../prog/en/modules/acqui/addorderiso2709.tt | 65 +-------------------- > koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js | 67 ++++++++++++++++++++++ > 2 files changed, 68 insertions(+), 64 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index 3f5d736548..fd553b0a25 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -428,6 +428,7 @@ > [% INCLUDE 'datatables.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %] > [% Asset.js("js/acq.js") %] >+ [% Asset.js("js/funds_sorts.js") %] > <script type="text/JavaScript"> > $(document).ready(function() { > $("#files").dataTable($.extend(true, {}, dataTablesDefaults, { >@@ -440,70 +441,6 @@ > "aaSorting": [] > } ) ); > >- // keep copy of the inactive budgets >- disabledBudgetsCopy = $("select[name='all_budget_id']").html(); >- $("select[name='all_budget_id'] .b_inactive").remove(); >- $("select[name='budget_id'] .b_inactive").remove(); >- >- $("#showallbudgets").click(function() { >- if ($(this).is(":checked")) { >- $("select[name='budget_id']").html(disabledBudgetsCopy) >- } >- else { >- $("select[name='budget_id'] .b_inactive").remove(); >- } >- }); >- >- $("#all_showallbudgets").click(function() { >- if ($(this).is(":checked")) { >- $("select[name='all_budget_id']").html(disabledBudgetsCopy); >- } >- else { >- $("select[name='all_budget_id'] .b_inactive").remove(); >- } >- }); >- >- $("select[name='budget_id']").change(function(){ >- var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); >- var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); >- var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]'); >- var sort1 = $(destination_sort1).val() || ""; >- if ( destination_sort1.length < 1 ) { >- destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]'); >- } >- var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]'); >- var sort2 = $(destination_sort2).val() || ""; >- if ( destination_sort2.length < 1 ) { >- destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]'); >- } >- getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); >- >- getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); >- } ); >- >- $("select[name='budget_id']").change(); >- >- $("select[name='all_budget_id']").change(function(){ >- var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); >- var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); >- var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]'); >- if ( destination_sort1.length < 1 ) { >- destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]'); >- } >- var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]'); >- if ( destination_sort2.length < 1 ) { >- destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]'); >- } >- getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 ); >- getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 ); >- $(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1'); >- $(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1'); >- $(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2'); >- $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2'); >- } ); >- >- $("select[name='all_budget_id']").change(); >- > $("#records_to_import fieldset.rows div").hide(); > $('input:checkbox[name="import_record_id"]').change(function(){ > var container = $(this).parents("fieldset"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js b/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js >new file mode 100644 >index 0000000000..6659e3e7be >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/funds_sorts.js >@@ -0,0 +1,67 @@ >+/* getAuthValueDropbox from js/acq.js is needed */ >+$(document).ready(function() { >+ // keep copy of the inactive budgets >+ disabledBudgetsCopy = $("select[name='all_budget_id']").html(); >+ $("select[name='all_budget_id'] .b_inactive").remove(); >+ $("select[name='budget_id'] .b_inactive").remove(); >+ >+ $("#showallbudgets").click(function() { >+ if ($(this).is(":checked")) { >+ $("select[name='budget_id']").html(disabledBudgetsCopy) >+ } >+ else { >+ $("select[name='budget_id'] .b_inactive").remove(); >+ } >+ }); >+ >+ $("#all_showallbudgets").click(function() { >+ if ($(this).is(":checked")) { >+ $("select[name='all_budget_id']").html(disabledBudgetsCopy); >+ } >+ else { >+ $("select[name='all_budget_id'] .b_inactive").remove(); >+ } >+ }); >+ >+ $("select[name='budget_id']").change(function(){ >+ var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); >+ var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); >+ var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]'); >+ var sort1 = $(destination_sort1).val() || ""; >+ if ( destination_sort1.length < 1 ) { >+ destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]'); >+ } >+ var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]'); >+ var sort2 = $(destination_sort2).val() || ""; >+ if ( destination_sort2.length < 1 ) { >+ destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]'); >+ } >+ getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); >+ >+ getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); >+ } ); >+ >+ $("select[name='budget_id']").change(); >+ >+ $("select[name='all_budget_id']").change(function(){ >+ var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); >+ var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); >+ var destination_sort1 = $(this).parent().siblings('li').find('input[name="all_sort1"]'); >+ if ( destination_sort1.length < 1 ) { >+ destination_sort1 = $(this).parent().siblings('li').find('select[name="all_sort1"]'); >+ } >+ var destination_sort2 = $(this).parent().siblings('li').find('input[name="all_sort2"]'); >+ if ( destination_sort2.length < 1 ) { >+ destination_sort2 = $(this).parent().siblings('li').find('select[name="all_sort2"]'); >+ } >+ getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1 ); >+ getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2 ); >+ $(this).parent().siblings('li').find('select[name="sort1"]').attr('name', 'all_sort1'); >+ $(this).parent().siblings('li').find('input[name="sort1"]').attr('name', 'all_sort1'); >+ $(this).parent().siblings('li').find('select[name="sort2"]').attr('name', 'all_sort2'); >+ $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2'); >+ } ); >+ >+ $("select[name='all_budget_id']").change(); >+ >+}); >-- >2.11.0
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 15184
:
77314
|
77315
|
77316
|
77317
|
77318
|
77513
|
77514
|
77515
|
77516
|
77517
|
77966
|
77967
|
77968
|
77969
|
77970
|
78074
|
78075
|
78076
|
78077
|
78078
|
78277
|
78278
|
78279
|
78280
|
78281
|
78282
|
78283
|
78284
|
78285
|
78340
|
78535
|
78536
|
78537
|
78538
|
78539
|
78697
|
78698
|
78699
|
78700
|
78701
|
78702
|
78703
|
78704
|
78705
|
78706
|
78898
|
78911
|
78927
|
78958
|
78959
|
78960
|
78961
|
78962
|
78963
|
78964
|
78965
|
78966
|
78967
|
78968
|
78969
|
78970
|
80485
|
80486
|
80487
|
80488
|
80489
|
80490
|
80491
|
80492
|
80493
|
80494
|
80495
|
80638
|
81435
|
81436
|
81437
|
81438
|
81439
|
81440
|
81441
|
81442
|
81443
|
81444
|
81445
|
81446
|
81447
|
81448
|
82079