This commit is contained in:
James Cole 2018-04-22 11:29:20 +02:00
parent 8f3e4a2dee
commit c2e8a67330
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 14 additions and 6 deletions

View File

@ -83,7 +83,9 @@ class RuleController extends Controller
$this->createDefaultRule();
$bill = null;
$billId = (int)$request->get('fromBill');
$preFilled = [];
$preFilled = [
'strict' => true,
];
$groups = ExpandedForm::makeSelectList($ruleGroupRepository->get());
$oldTriggers = [];
$oldActions = [];

View File

@ -169,11 +169,17 @@ class ExpandedForm
*/
public function checkbox(string $name, $value = 1, $checked = null, $options = []): string
{
$options['checked'] = true === $checked ? true : null;
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name);
$value = $this->fillFieldValue($name, $value);
$options['checked'] = true === $checked ? true : false;
if (Session::has('preFilled')) {
$preFilled = session('preFilled');
$options['checked'] = $preFilled[$name] ?? $options['checked'];
}
$label = $this->label($name, $options);
$options = $this->expandOptionArray($name, $label, $options);
$classes = $this->getHolderClasses($name);
$value = $this->fillFieldValue($name, $value);
unset($options['placeholder'], $options['autocomplete'], $options['class']);