Skip to content
Snippets Groups Projects
Commit cebe3ae1 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#429 - removed enable repeating toggle

parent ddb0ef54
No related branches found
No related tags found
No related merge requests found
Pipeline #1292 passed
...@@ -212,7 +212,6 @@ public class TransactionController extends BaseController ...@@ -212,7 +212,6 @@ public class TransactionController extends BaseController
@ModelAttribute("NewTransaction") Transaction transaction, BindingResult bindingResult, @ModelAttribute("NewTransaction") Transaction transaction, BindingResult bindingResult,
@RequestParam(value = "isRepeating", required = false) boolean isRepeating, @RequestParam(value = "isRepeating", required = false) boolean isRepeating,
@RequestParam(value = "isPayment", required = false) boolean isPayment, @RequestParam(value = "isPayment", required = false) boolean isPayment,
@RequestParam(value = "enableRepeating", required = false) boolean enableRepeating,
@RequestParam(value = "repeatingModifierNumber", required = false) int repeatingModifierNumber, @RequestParam(value = "repeatingModifierNumber", required = false) int repeatingModifierNumber,
@RequestParam(value = "repeatingModifierType", required = false) String repeatingModifierType, @RequestParam(value = "repeatingModifierType", required = false) String repeatingModifierType,
@RequestParam(value = "repeatingEndType", required = false) String repeatingEndType, @RequestParam(value = "repeatingEndType", required = false) String repeatingEndType,
...@@ -254,9 +253,7 @@ public class TransactionController extends BaseController ...@@ -254,9 +253,7 @@ public class TransactionController extends BaseController
} }
} }
RepeatingOption repeatingOption = null; RepeatingOption repeatingOption;
if(enableRepeating)
{
RepeatingModifierType type = RepeatingModifierType.getByLocalization(repeatingModifierType); RepeatingModifierType type = RepeatingModifierType.getByLocalization(repeatingModifierType);
RepeatingModifier repeatingModifier = RepeatingModifier.fromModifierType(type, repeatingModifierNumber); RepeatingModifier repeatingModifier = RepeatingModifier.fromModifierType(type, repeatingModifierNumber);
...@@ -277,7 +274,6 @@ public class TransactionController extends BaseController ...@@ -277,7 +274,6 @@ public class TransactionController extends BaseController
} }
repeatingOption = new RepeatingOption(transaction.getDate(), repeatingModifier, repeatingEnd); repeatingOption = new RepeatingOption(transaction.getDate(), repeatingModifier, repeatingEnd);
}
transaction.setRepeatingOption(repeatingOption); transaction.setRepeatingOption(repeatingOption);
if(bindingResult.hasErrors()) if(bindingResult.hasErrors())
......
...@@ -124,22 +124,6 @@ $( document ).ready(function() { ...@@ -124,22 +124,6 @@ $( document ).ready(function() {
}); });
} }
$('#enableRepeating').change(function(){
if($(this).is(":checked"))
{
$('#transaction-repeating-modifier-row').show();
$('#transaction-repeating-end').show();
}
else
{
$('#transaction-repeating-modifier-row').hide();
$('#transaction-repeating-end').hide();
}
});
// fire change listener on page load
$('#enableRepeating').trigger("change");
// prevent form submit on enter (otherwise tag functionality will be hard to use) // prevent form submit on enter (otherwise tag functionality will be hard to use)
$(document).on("keypress", 'form', function (e) { $(document).on("keypress", 'form', function (e) {
var code = e.keyCode || e.which; var code = e.keyCode || e.which;
...@@ -284,9 +268,7 @@ function validateForm() ...@@ -284,9 +268,7 @@ function validateForm()
} }
} }
if($("#enableRepeating").length) if($(transactionRepeatingModifierID).length)
{
if(document.getElementById("enableRepeating").checked)
{ {
if(!validateNumber($(transactionRepeatingModifierID).val(), transactionRepeatingModifierID.substr(1), "hidden-" + transactionRepeatingModifierID.substr(1), numberValidationMessage)) if(!validateNumber($(transactionRepeatingModifierID).val(), transactionRepeatingModifierID.substr(1), "hidden-" + transactionRepeatingModifierID.substr(1), numberValidationMessage))
{ {
...@@ -319,11 +301,6 @@ function validateForm() ...@@ -319,11 +301,6 @@ function validateForm()
endInput.value = $("#transaction-repeating-end-date-input").val(); endInput.value = $("#transaction-repeating-end-date-input").val();
} }
} }
else
{
document.getElementById("hidden-" + transactionRepeatingModifierID.substr(1)).value = -1;
}
}
return true; return true;
} }
...@@ -204,13 +204,7 @@ ...@@ -204,13 +204,7 @@
<#macro transactionRepeating transaction currentDate> <#macro transactionRepeating transaction currentDate>
<div class="row"> <div class="row">
<div class="col s12 m12 l8 offset-l2"> <div class="col s12 m12 l8 offset-l2">
<div class="switch">
<label>
<input type="checkbox" id="enableRepeating" name="enableRepeating" <#if transaction.getRepeatingOption()??>checked</#if>>
<span class="lever"></span>
${locale.getString("transaction.new.label.repeating")} ${locale.getString("transaction.new.label.repeating")}
</label>
</div>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment