| @@ 69-93 (lines=25) @@ | ||
| 66 | ||
| 67 | $form = $builder->getForm(); |
|
| 68 | ||
| 69 | if ($request->getMethod() === 'POST') { |
|
| 70 | $form->handleRequest($request); |
|
| 71 | if ($form->isValid()) { |
|
| 72 | $status = $app['eccube.repository.class_category']->save($TargetClassCategory); |
|
| 73 | ||
| 74 | if ($status) { |
|
| 75 | ||
| 76 | $event = new EventArgs( |
|
| 77 | array( |
|
| 78 | 'form' => $form, |
|
| 79 | 'ClassName' => $ClassName, |
|
| 80 | 'TargetClassCategory' => $TargetClassCategory, |
|
| 81 | ), |
|
| 82 | $request |
|
| 83 | ); |
|
| 84 | $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CLASS_CATEGORY_INDEX_COMPLETE, $event); |
|
| 85 | ||
| 86 | $app->addSuccess('admin.class_category.save.complete', 'admin'); |
|
| 87 | ||
| 88 | return $app->redirect($app->url('admin_product_class_category', array('class_name_id' => $ClassName->getId()))); |
|
| 89 | } else { |
|
| 90 | $app->addError('admin.class_category.save.error', 'admin'); |
|
| 91 | } |
|
| 92 | } |
|
| 93 | } |
|
| 94 | ||
| 95 | $ClassCategories = $app['eccube.repository.class_category']->getList($ClassName); |
|
| 96 | ||
| @@ 65-92 (lines=28) @@ | ||
| 62 | ||
| 63 | $form['template']->setData($Mail); |
|
| 64 | ||
| 65 | if ('POST' === $request->getMethod()) { |
|
| 66 | $form->handleRequest($request); |
|
| 67 | ||
| 68 | // 新規登録は現時点では未実装とする. |
|
| 69 | if (is_null($Mail)) { |
|
| 70 | $app->addError('admin.shop.mail.save.error', 'admin'); |
|
| 71 | ||
| 72 | return $app->redirect($app->url('admin_setting_shop_mail')); |
|
| 73 | } |
|
| 74 | ||
| 75 | if ($form->isValid()) { |
|
| 76 | ||
| 77 | $app['orm.em']->flush(); |
|
| 78 | ||
| 79 | $event = new EventArgs( |
|
| 80 | array( |
|
| 81 | 'form' => $form, |
|
| 82 | 'Mail' => $Mail, |
|
| 83 | ), |
|
| 84 | $request |
|
| 85 | ); |
|
| 86 | $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_MAIL_INDEX_COMPLETE, $event); |
|
| 87 | ||
| 88 | $app->addSuccess('admin.shop.mail.save.complete', 'admin'); |
|
| 89 | ||
| 90 | return $app->redirect($app->url('admin_setting_shop_mail_edit', array('id' => $id))); |
|
| 91 | } |
|
| 92 | } |
|
| 93 | ||
| 94 | return $app->render('Setting/Shop/mail.twig', array( |
|
| 95 | 'form' => $form->createView(), |
|