Bug 29352: Runtime parameter labels should not be said to be optional
This patch alters the form shown when using the "Insert runtime parameter" button in SQL reports. It makes the label field required and removes "optional" from the field hint. To test, apply the patch and go to Reports -> Create from SQL. - Click the "Insert runtime parameter" button and select "Authorized value." - Clear the "parameter label" field and click "Insert parameter." - The form should display an error asking you to fill in the label field. - Test that the category field is also required. - Close the modal and select a different runtime parameter. - Test again that the label field is required. - Test that the form submits correctly when the label field is populated. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
c0a000d5df
commit
ca6c81ec5c
|
|
@ -1379,9 +1379,9 @@
|
|||
<input type="hidden" name="param_category" id="param_category" />
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="paramLabel">Parameter label: </label>
|
||||
<input class="form-control" type="text" name="paramLabel" id="paramLabel">
|
||||
<div class="hint">Optional. The label for the field shown when the report is run, e.g. "Select a library."</div>
|
||||
<label for="paramLabel" class="required">Parameter label: </label>
|
||||
<input class="form-control required" type="text" name="paramLabel" id="paramLabel" required="required" />
|
||||
<div class="hint">The label for the field shown when the report is run, e.g. "Select a library."</div>
|
||||
</div>
|
||||
<div id="authorised_value_category" class="form-group" style="display:none">
|
||||
<label for="authorised_value">Authorized value category:</label>
|
||||
|
|
@ -1528,7 +1528,8 @@
|
|||
modalTitle.text( _("Insert authorized value parameter") );
|
||||
$("#paramLabel").val( _("Authorized value") );
|
||||
$("#authorised_value_category").show();
|
||||
$("#authorised_value").prop("required", true ).attr("required", "required");
|
||||
$("label[for='authorised_value']").addClass("required");
|
||||
$("#authorised_value").prop("required", true ).attr("required", "required").addClass("required");
|
||||
break;
|
||||
case "insertDate":
|
||||
modalTitle.text( _("Insert date parameter") );
|
||||
|
|
@ -1958,7 +1959,8 @@
|
|||
$("#runtime_parameters").on("hide.bs.modal", function(){
|
||||
$("#send_runtime_parameter")[0].reset();
|
||||
$("#authorised_value_category").val("").hide();
|
||||
$("#authorised_value").prop("required", false ).removeAttr("required");
|
||||
$("label[for='authorised_value']").removeClass("required");
|
||||
$("#authorised_value").prop("required", false ).removeAttr("required").removeClass("required");
|
||||
});
|
||||
|
||||
$("#send_runtime_parameter").on("submit", function(e){
|
||||
|
|
|
|||
Loading…
Reference in New Issue