This commit is contained in:
James Cole committed 2018-04-22 11:29:20 +02:00
1 parent 8f3e4a2dee
commit c2e8a67330
2 files changed
+14 -6

No files matched your search

+3 -1
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 = [];
+11 -5
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']);