@@ -173,21 +173,12 @@ public function channelrulesAction()
173173 'action ' => 'add ' ]
174174 )));
175175
176- // $this->actions()->add(Link::create($this->translate('Edit'), 'TODO', [
177- // 'what' => 'ever'
178- // ], [
179- // 'class' => 'icon-edit'
180- // ]));
181176 $ uuid = $ this ->requireUuid ();
182177 $ ns = $ this ->Window ()->getSessionNamespace ('eventtracker ' );
183178 $ sessionKey = 'simulationObject/ ' . $ uuid ->toString ();
184179
185180 $ form = $ this ->getForm ($ action ); // TODO: w/o form
186181 $ modifierRuleStore = new ModifierRuleStore ($ ns , $ uuid , $ form );
187- $ rules = $ modifierRuleStore ->getStoredRules ();
188- $ rules = $ modifierRuleStore ->getRules ();
189- // $form->addElement('submit', 'submit', ['label' => $this->translate('Save32')]);
190- // $this->addContent($form);
191182 if ($ this ->params ->get ('action ' ) === 'add ' ) {
192183 $ ruleForm = new ChannelRuleForm ();
193184 $ ruleForm ->handleRequest ($ this ->getServerRequest ());
@@ -659,7 +650,6 @@ protected function showRules(
659650 UuidInterface $ uuid ,
660651 UuidObjectForm $ form
661652 ) {
662- $ sessionKey = 'channelrules/ ' . $ uuid ->toString ();
663653 $ form ->addElement ('submit ' , 'add_modifier ' , []);
664654
665655 if ($ modifierRuleStore ->getSessionRules () !== null ) {
@@ -670,9 +660,6 @@ protected function showRules(
670660 $ message = Hint::warning (
671661 'The order has been modified please safe if you want to preserver the new order '
672662 );
673- // $form->addHtml(Hint::warning(
674- // 'The order has been modified please safe if you want to preserver the new order'
675- // ));
676663 if ($ newForm ->hasBeenSubmitted ()) {
677664 $ form ->populate (['rules ' => JsonString::encode ($ modifierRuleStore ->getRules ())]);
678665 $ form ->storeObject ();
@@ -681,21 +668,11 @@ protected function showRules(
681668 }
682669 $ this ->content ()->add ([$ message , $ newForm ]);
683670 }
684- // $modifierRuleStore->setModifierRules($modifierRuleStore->getSessionRules());
685671 }
686672 if ($ modifierRuleStore ->getRules () === null ) {
687- var_dump ("foobar " );
688- return ;
689- }
690- try {
691- $ modifiers = $ modifierRuleStore ->getRules ();
692- } catch (JsonDecodeException $ e ) {
693- $ this ->content ()->add (Hint::error (sprintf (
694- $ this ->translate ('Configured rules are invalid: %s ' ),
695- $ e ->getMessage ()
696- )));
697673 return ;
698674 }
675+ $ modifiers = $ modifierRuleStore ->getRules ();
699676 $ url = Url::fromPath ('eventtracker/configuration/channelrule ' , [
700677 'uuid ' => $ uuid ->toString ()
701678 ]);
0 commit comments