| @@ 56-76 (lines=21) @@ | ||
| 53 | ||
| 54 | $form = $builder->getForm(); |
|
| 55 | ||
| 56 | if ($app['request']->getMethod() === 'POST') { |
|
| 57 | $form->handleRequest($app['request']); |
|
| 58 | if ($form->isValid()) { |
|
| 59 | $app['orm.em']->persist($BaseInfo); |
|
| 60 | $app['orm.em']->flush(); |
|
| 61 | ||
| 62 | $event = new EventArgs( |
|
| 63 | array( |
|
| 64 | 'form' => $form, |
|
| 65 | 'BaseInfo' => $BaseInfo, |
|
| 66 | ), |
|
| 67 | $request |
|
| 68 | ); |
|
| 69 | $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_SHOP_INDEX_COMPLETE, $event); |
|
| 70 | ||
| 71 | $app->addSuccess('admin.shop.save.complete', 'admin'); |
|
| 72 | ||
| 73 | return $app->redirect($app->url('admin_setting_shop')); |
|
| 74 | } |
|
| 75 | $app->addError('admin.shop.save.error', 'admin'); |
|
| 76 | } |
|
| 77 | ||
| 78 | $app['twig']->addGlobal('BaseInfo', $CloneInfo); |
|
| 79 | ||
| @@ 89-110 (lines=22) @@ | ||
| 86 | /* @var $form \Symfony\Component\Form\FormInterface */ |
|
| 87 | $form = $builder->getForm(); |
|
| 88 | ||
| 89 | if ('POST' === $request->getMethod()) { |
|
| 90 | $form->handleRequest($request); |
|
| 91 | if ($this->isValid($app['orm.em'], $form)) { |
|
| 92 | $app['orm.em']->persist($TargetTaxRule); |
|
| 93 | ||
| 94 | $app['orm.em']->flush(); |
|
| 95 | ||
| 96 | $event = new EventArgs( |
|
| 97 | array( |
|
| 98 | 'form' => $form, |
|
| 99 | 'BaseInfo' => $BaseInfo, |
|
| 100 | 'TargetTaxRule' => $TargetTaxRule, |
|
| 101 | ), |
|
| 102 | $request |
|
| 103 | ); |
|
| 104 | $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_TAX_RULE_INDEX_COMPLETE, $event); |
|
| 105 | ||
| 106 | $app->addSuccess('admin.shop.tax.save.complete', 'admin'); |
|
| 107 | ||
| 108 | return $app->redirect($app->url('admin_setting_shop_tax')); |
|
| 109 | } |
|
| 110 | } |
|
| 111 | ||
| 112 | // 共通税率一覧 |
|
| 113 | $TaxRules = $app['eccube.repository.tax_rule']->getList(); |
|