-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5399 from sai-gillingham/issue/5304
改正商取引法の施行に伴うECカート「最終確認画面」表示項目の変更[#5304]について
- Loading branch information
Showing
26 changed files
with
1,262 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
src/Eccube/Controller/Admin/Setting/Shop/TradeLawController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
namespace Eccube\Controller\Admin\Setting\Shop; | ||
|
||
use Eccube\Controller\AbstractController; | ||
use Eccube\Event\EccubeEvents; | ||
use Eccube\Event\EventArgs; | ||
use Eccube\Form\Type\Admin\OrderStatusSettingType; | ||
use Eccube\Form\Type\Admin\TradeLawType; | ||
use Eccube\Form\Type\Front\ForgotType; | ||
use Eccube\Repository\TradeLawRepository; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | ||
use Symfony\Component\Form\Extension\Core\Type\CollectionType; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
class TradeLawController extends AbstractController | ||
{ | ||
protected TradeLawRepository $tradeLawRepository; | ||
|
||
/** | ||
* @param TradeLawRepository $tradeLawRepository | ||
*/ | ||
public function __construct( | ||
TradeLawRepository $tradeLawRepository | ||
) { | ||
$this->tradeLawRepository = $tradeLawRepository; | ||
} | ||
|
||
/** | ||
* 特定商取引法設定の初期表示・登録 | ||
* | ||
* @Route("/%eccube_admin_route%/setting/shop/tradelaw", name="admin_setting_shop_tradelaw", methods={"GET", "POST"}) | ||
* @Template("@admin/Setting/Shop/tradelaw.twig") | ||
* @param Request $request | ||
*/ | ||
public function index(Request $request) | ||
{ | ||
$tradeLawDetails = $this->tradeLawRepository->findBy([], ['sortNo' => 'ASC']); | ||
$builder = $this->formFactory->createBuilder(); | ||
$builder | ||
->add( | ||
'TradeLaws', | ||
CollectionType::class, | ||
[ | ||
'entry_type' => TradeLawType::class, | ||
'data' => $tradeLawDetails, | ||
] | ||
); | ||
$form = $builder->getForm(); | ||
$form->handleRequest($request); | ||
|
||
$event = new EventArgs( | ||
[ | ||
'TradeLaw' => $tradeLawDetails, | ||
], | ||
$request | ||
); | ||
|
||
|
||
|
||
$form = $builder->getForm(); | ||
$form->handleRequest($request); | ||
|
||
if ($form->isSubmitted() && $form->isValid()) { | ||
foreach ($form['TradeLaws'] as $child) { | ||
$TradeLaw = $child->getData(); | ||
$this->entityManager->persist($TradeLaw); | ||
} | ||
$this->entityManager->flush(); | ||
|
||
$this->addSuccess('admin.common.save_complete', 'admin'); | ||
|
||
$this->eventDispatcher->dispatch($event, EccubeEvents::ADMIN_SETTING_SHOP_TRADE_LAW_POST_COMPLETE); | ||
|
||
return $this->redirectToRoute('admin_setting_shop_tradelaw'); | ||
} | ||
|
||
$this->eventDispatcher->dispatch($event, EccubeEvents::ADMIN_SETTING_SHOP_TRADE_LAW_INDEX_COMPLETE); | ||
|
||
return [ | ||
'form' => $form->createView(), | ||
'tradeLawDetails' => $tradeLawDetails | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of EC-CUBE | ||
* | ||
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. | ||
* | ||
* http://www.ec-cube.co.jp/ | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Eccube\Controller; | ||
|
||
use Eccube\Repository\TradeLawRepository; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class TradeLawController extends AbstractController | ||
{ | ||
/** @var TradeLawRepository */ | ||
protected $tradeLawRepository; | ||
|
||
/** | ||
* @param TradeLawRepository $tradeLawRepository | ||
*/ | ||
public function __construct( | ||
TradeLawRepository $tradeLawRepository | ||
) { | ||
$this->tradeLawRepository = $tradeLawRepository; | ||
} | ||
|
||
/** | ||
* @Route("/help/tradelaw", name="help_tradelaw", methods={"GET"}) | ||
* @Template("Help/tradelaw.twig") | ||
*/ | ||
public function index() | ||
{ | ||
$tradelaws = $this->tradeLawRepository->findBy([], ['sortNo' => 'ASC']); | ||
|
||
return [ | ||
'tradelaws' => $tradelaws | ||
]; | ||
} | ||
} |
Oops, something went wrong.