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

set default template group on saving a ne template

parent ec51f7cc
Branches
Tags
No related merge requests found
......@@ -214,6 +214,11 @@ public class TemplateController extends BaseController
}
transactionService.handleTags(template);
if(template.getTemplateGroup() == null)
{
template.setTemplateGroup(templateGroupService.getDefaultGroup());
}
template.updateIcon(iconService, iconImageID, builtinIconIdentifier, fontColor, templateService);
if(bindingResult.hasErrors())
......
......@@ -100,6 +100,8 @@ public class TemplateService implements Resettable, AccessAllEntities<Template>,
template.setAccount(null);
}
template.setTemplateGroup(templateGroupService.getDefaultGroup());
getRepository().save(template);
}
......
......@@ -39,6 +39,7 @@
<form name="NewTemplate" action="<@s.url '/templates/newTemplate'/>" method="post" onsubmit="return validateForm(true)">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<input type="hidden" name="ID" value="<#if template.getID()??>${template.getID()?c}</#if>">
<input type="hidden" name="templateGroup" value="<#if template.getTemplateGroup()??>${template.getTemplateGroup().getID()?c}</#if>">
<#-- isPayment switch -->
<@newTransactionMacros.isExpenditureSwitch template/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment