Skip to content

Commit

Permalink
Merge pull request #3723 from kiy0taka/sf/last-boss
Browse files Browse the repository at this point in the history
新オーナーズストア周りの実装
  • Loading branch information
okazy authored Aug 31, 2018
2 parents 39f08e4 + 06d0f3d commit 996c69a
Show file tree
Hide file tree
Showing 42 changed files with 1,095 additions and 736 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ jobs:
- *eccube_setup
env: DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
script:
- ./bin/phpunit --exclude-group cache-clear
- ./bin/phpunit --exclude-group cache-clear,cache-clear-install
- ./bin/phpunit --group cache-clear
- ./bin/phpunit --group cache-clear-install
- <<: *unit_test
env: DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
- &e2e_test
Expand Down
3 changes: 2 additions & 1 deletion app/config/eccube/packages/eccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parameters:
env(ECCUBE_COOKIE_PATH): '/'
env(ECCUBE_COOKIE_LIFETIME): 0
env(ECCUBE_GC_MAXLIFETIME): 1440
env(ECCUBE_PACKAGE_API_URL): 'https://beta-package-api.ec-cube.net'

# EC-CUBE parameter
eccube_database_url: '%env(DATABASE_URL)%'
Expand Down Expand Up @@ -103,7 +104,7 @@ parameters:
eccube_forgot_mail_template_id: 6 #パスワードリセット
eccube_reset_complete_mail_template_id: 7 #パスワードリマインダー
eccube_shipping_notify_mail_template_id: 8 #出荷通知メール
eccube_package_repo_url: null
eccube_package_api_url: '%env(ECCUBE_PACKAGE_API_URL)%'
# 注文番号のフォーマット. 以下のフォーマットが利用可能です. フォーマットを空にした場合, dtb_order.idを出力します.
# {yyyy} : 西暦(4桁)
# {yy}: 西暦(2桁)
Expand Down
14 changes: 7 additions & 7 deletions app/config/eccube/packages/eccube_nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,23 @@ parameters:
icon: fa-plug
children:
plugin:
name: admin.nav.store.plugin
name: admin.store.plugin
children:
plugin_owners_search:
name: admin.nav.store.plugin.plugin_owners_install
name: admin.store.plugin.plugin_owners_install
url: admin_store_plugin_owners_search
plugin_list:
name: admin.nav.store.plugin.plugin_list
name: admin.store.plugin.plugin_list
url: admin_store_plugin
template:
name: admin.nav.store.template
name: admin.store.template
children:
template_list:
name: admin.nav.store.template.template_list
name: admin.store.template.template_list
url: admin_store_template
template_install:
name: admin.nav.store.template.template_install
name: admin.store.template.template_install
url: admin_store_template_install
authentication_setting:
name: admin.nav.store.authentication_setting
name: admin.store.setting
url: admin_store_authentication_setting
8 changes: 6 additions & 2 deletions codeception/_support/Page/Admin/TaxManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@ public function 入力_消費税率($row, $value)
return $this;
}

public function 入力_適用日($year, $month, $day) {
public function 入力_適用日($year, $month, $day)
{
$this->tester->executeJS("document.getElementById('tax_rule_apply_date_date_year').value = '{$year}'");
$this->tester->executeJS("document.getElementById('tax_rule_apply_date_date_month').value = '{$month}'");
$this->tester->executeJS("document.getElementById('tax_rule_apply_date_date_day').value = '{$day}'");

return $this;
}

public function 入力_適用時($hour, $minute) {
public function 入力_適用時($hour, $minute)
{
$this->tester->executeJS("document.getElementById('tax_rule_apply_date_time_hour').value = '{$hour}'");
$this->tester->executeJS("document.getElementById('tax_rule_apply_date_time_minute').value = '{$minute}'");

return $this;
}

Expand Down
6 changes: 5 additions & 1 deletion src/Eccube/Command/ComposerRequireCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ protected function configure()

protected function execute(InputInterface $input, OutputInterface $output)
{
$this->composerService->execRequire($input->getArgument('package'), $output);
$packageName = $input->getArgument('package');
if ($input->getArgument('version')) {
$packageName .= ':'.$input->getArgument('version');
}
$this->composerService->execRequire($packageName, $output);
}
}
4 changes: 4 additions & 0 deletions src/Eccube/Command/PluginEnableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
return;
}

if (!$plugin->isInitialized()) {
$this->pluginService->installWithCode($plugin->getCode());
}

$this->pluginService->enable($plugin);
$this->clearCache($io);

Expand Down
11 changes: 3 additions & 8 deletions src/Eccube/Command/PluginInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($this->pluginService->install($path)) {
$io->success('Installed.');

return;
return 0;
}
}

// 設置済ファイルからインストール
if ($code) {
$pluginDir = $this->pluginService->calcPluginDir($code);
$this->pluginService->checkPluginArchiveContent($pluginDir);
$config = $this->pluginService->readConfig($pluginDir);
$this->pluginService->checkSamePlugin($config['code']);
$this->pluginService->postInstall($config, false);

$this->pluginService->installWithCode($code);
$this->clearCache($io);
$io->success('Installed.');

return;
return 0;
}

$io->error('path or code is required.');
Expand Down
55 changes: 55 additions & 0 deletions src/Eccube/Command/PluginSchemaUpdateCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Eccube\Command;

use Eccube\Entity\Plugin;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

class PluginSchemaUpdateCommand extends Command
{
use PluginCommandTrait;

protected static $defaultName = 'eccube:plugin:schema-update';

protected function configure()
{
$this
->addArgument('code', InputArgument::REQUIRED, 'Plugin code')
->setDescription('Execute plugin schema update.');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);

$code = $input->getArgument('code');

/** @var Plugin $Plugin */
$Plugin = $this->pluginRepository->findByCode($code);
if (!$Plugin) {
$io->error("No such plugin `${code}`.");
return 1;
}

$config = $this->pluginService->readConfig($this->pluginService->calcPluginDir($code));
$this->pluginService->generateProxyAndUpdateSchema($Plugin, $config);
$this->clearCache($io);

$io->success('Schema Updated.');
}
}
56 changes: 56 additions & 0 deletions src/Eccube/Command/PluginUpdateCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Eccube\Command;

use Eccube\Entity\Plugin;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

class PluginUpdateCommand extends Command
{
protected static $defaultName = 'eccube:plugin:update';

use PluginCommandTrait;

protected function configure()
{
$this
->addArgument('code', InputArgument::REQUIRED, 'Plugin code')
->setDescription('Execute plugin update process.');
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);

$code = $input->getArgument('code');

/** @var Plugin $Plugin */
$Plugin = $this->pluginRepository->findByCode($code);

if (!$Plugin) {
$io->error("No such plugin `${code}`.");
return 1;
}

$config = $this->pluginService->readConfig($this->pluginService->calcPluginDir($code));
$this->pluginService->updatePlugin($Plugin, $config);
$this->clearCache($io);

$io->success('Updated.');
}
}
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Admin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function index(Request $request)
$this->eventDispatcher->dispatch(EccubeEvents::ADMIN_ADMIM_INDEX_COMPLETE, $event);

// 推奨プラグイン
$url = $this->eccubeConfig['eccube_package_repo_url'].'/plugins/recommended';
$url = $this->eccubeConfig['eccube_package_api_url'].'/plugins/recommended';
list($json, $info) = $this->pluginApiService->getRequestApi($url);
$recommendedPlugins = json_decode($json, true);

Expand Down
1 change: 0 additions & 1 deletion src/Eccube/Controller/Admin/Content/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Eccube\Controller\Admin\Content;

use Eccube\Controller\AbstractController;
use Eccube\Entity\Master\DeviceType;
use Eccube\Entity\Page;
use Eccube\Entity\PageLayout;
use Eccube\Event\EccubeEvents;
Expand Down
Loading

0 comments on commit 996c69a

Please sign in to comment.