Bugzilla – Attachment 162307 Details for
Bug 35856
Runtime parameter modal should provide option of ":all"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35856: added options to runtime parameter modal
Bug-35856-added-options-to-runtime-parameter-modal.patch (text/plain), 8.03 KB, created by
Brendan Lawlor
on 2024-02-20 17:47:50 UTC
(
hide
)
Description:
Bug 35856: added options to runtime parameter modal
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-02-20 17:47:50 UTC
Size:
8.03 KB
patch
obsolete
>From dd9f2839971572aaa5d7ea23549443e312e546ea Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Wed, 24 Jan 2024 17:15:09 +0000 >Subject: [PATCH] Bug 35856: added options to runtime parameter modal > >This patch adds radio checkboxes to the reports runtime parameter modal for adding param options :all and :in. > >The :in param option functionality depends on https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35746 > >Test plan: >1. Apply patch >2. Create a report from SQL >3. Click Insert runtime parameter and choose any option other than date, list or text field >4. Note the form now includes a radio checkbox for parameter options >5. Choose 'Include option for all' and click Insert parameter >6. Note the parameter is inserted with :all option like <<label|authval:all>> >7. Choose 'Allow multiple selections' and click Insert parameter >8. Note the parameter is inserted with :in option like <<label|authval:in>> >9. Make sure that parameter options are not included on the form for date, list and text field > >Thanks! >--- > .../modules/reports/guided_reports_start.tt | 28 +++++++++++++++++++ > 1 file changed, 28 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index 1b639d26c6..f44f42ec0f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -1504,6 +1504,20 @@ > </select> > <div class="hint">Select which authorized value category the user will choose from.</div> > </div> >+ <div id="runtime_param_options" style="display:none"> >+ <label>Parameter options:</label> >+ <div class="form-check-inline"> >+ <input type="radio" class="form-check-input" id="single_param_check" name="param_option" value="" checked> >+ <label class="form-check-label" for="single_param_check">Single parameter only</label> >+ <i id="info_param_options" data-toggle="tooltip" title="" data-placement="top" class="fa fa-info-circle" data-original-title="Query expression should use ="></i> >+ <input type="radio" class="form-check-input" id="include_all_check" name="param_option" value=":all"> >+ <label class="form-check-label" for="include_all_check">Include option for all</label> >+ <i id="info_param_options" data-toggle="tooltip" title="" data-placement="top" class="fa fa-info-circle" data-original-title="Query expression must use LIKE"></i> >+ <input type="radio" class="form-check-input" id="multi_select_check" name="param_option" value=":in"> >+ <label class="form-check-label" for="multi_select_check">Allow multiple selections</label> >+ <i id="info_param_options" data-toggle="tooltip" title="" data-placement="top" class="fa fa-info-circle" data-original-title="Query expression must use IN"></i> >+ </div> >+ </div> > </div> <!-- /.modal-body --> > <div class="modal-footer"> > <button type="submit" id="sendParam" class="btn btn-default approve">Insert parameter</button> >@@ -1691,16 +1705,19 @@ > $("#authorised_value_category").show(); > $("label[for='authorised_value']").addClass("required"); > $("#authorised_value").prop("required", true ).attr("required", "required").addClass("required"); >+ $("#runtime_param_options").show(); > break; > case "insertCnSource": > modalTitle.text( _("Insert classification source parameter") ); > $("#paramLabel").val( _("Source of classification or shelving scheme") ); > $("#param_category").val("cn_source"); >+ $("#runtime_param_options").show(); > break; > case "insertFramework": > modalTitle.text( _("Insert bibliographic framework parameter") ); > $("#paramLabel").val( _("Framework") ); > $("#param_category").val("biblio_framework"); >+ $("#runtime_param_options").show(); > break; > case "insertDate": > modalTitle.text( _("Insert date parameter") ); >@@ -1711,31 +1728,37 @@ > modalTitle.text( _("Insert item types parameter") ); > $("#paramLabel").val( _("Item type") ); > $("#param_category").val("itemtypes"); >+ $("#runtime_param_options").show(); > break; > case "insertBranches": > modalTitle.text( _("Insert libraries parameter") ); > $("#paramLabel").val( _("Library") ); > $("#param_category").val("branches"); >+ $("#runtime_param_options").show(); > break; > case "insertCategorycode": > modalTitle.text( _("Insert patron category parameter") ); > $("#paramLabel").val( _("Patron category") ); > $("#param_category").val("categorycode"); >+ $("#runtime_param_options").show(); > break; > case "insertCashregister": > modalTitle.text( _("Insert cash register parameter") ); > $("#paramLabel").val( _("Cash register") ); > $("#param_category").val("cash_registers"); >+ $("#runtime_param_options").show(); > break; > case "insertDebittypes": > modalTitle.text( _("Insert debit type parameter") ); > $("#paramLabel").val( _("Debit type") ); > $("#param_category").val("debit_types"); >+ $("#runtime_param_options").show(); > break; > case "insertCredittypes": > modalTitle.text( _("Insert credit type parameter") ); > $("#paramLabel").val( _("Credit type") ); > $("#param_category").val("credit_types"); >+ $("#runtime_param_options").show(); > break; > case "insertList": > modalTitle.text( _("Insert list parameter") ); >@@ -2150,6 +2173,7 @@ > $("#runtime_parameters").on("hide.bs.modal", function(){ > $("#send_runtime_parameter")[0].reset(); > $("#authorised_value_category").val("").hide(); >+ $("#runtime_param_options").val("").hide(); > $("label[for='authorised_value']").removeClass("required"); > $("#authorised_value").prop("required", false ).removeAttr("required").removeClass("required"); > }); >@@ -2160,6 +2184,7 @@ > var paramLabel = $("#paramLabel").val(); > var param_category = $("#param_category").val(); > var categoryLabel = $("#authorised_value").val(); >+ var param_option = $('#runtime_param_options input[name="param_option"]:checked').val(); > // Get CodeMirror environment variables > var selection = editor.getSelection(); > var doc = editor.getDoc(); >@@ -2177,6 +2202,9 @@ > } else if( param_category ){ > text += param_category; > } >+ if( param_option ){ >+ text += param_option; >+ } > if( text != "" ){ > text = " <<" + text + ">> "; > if( selection.length > 0){ >-- >2.30.2
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 35856
:
161357
|
162306
|
162307
|
162308
|
164050
|
164287