From 43050fc2024b435227a4687038dbb3dee87bf4c7 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 14:37:58 +0900 Subject: [PATCH 1/7] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,10 +44,14 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +62,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From f912abbcf75caf7ec875b6b8acde11148736e7c5 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 00:37:16 +0900 Subject: [PATCH 2/7] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From c1f1bd1cdabb99c1c25ad077b6e2f781ef3711e7 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 18:38:03 +0900 Subject: [PATCH 3/7] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..6da4321 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,22 +3,21 @@ on: branches: - main - master - - availability pull_request: branches: - main - master - - availability name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +27,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +91,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +145,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +154,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From ce73f8cd664f8e3e230caf054264dab8c8d04c97 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 18:21:23 +0900 Subject: [PATCH 4/7] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7 From 8b2ba8cb8bfd0a1376a9dc91feec9e172f8782ac Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 28 Mar 2024 14:14:32 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=202024=E5=B9=B49=E6=9C=8823=E6=97=A5?= =?UTF-8?q?=E3=82=92=E7=A5=9D=E6=97=A5=E3=81=AB=E4=BF=AE=E6=AD=A3=20https:?= =?UTF-8?q?//github.com/NetCommons3/NetCommons3/issues/1720?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1711535474_update_2024_holidays.php | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Config/Migration/1711535474_update_2024_holidays.php diff --git a/Config/Migration/1711535474_update_2024_holidays.php b/Config/Migration/1711535474_update_2024_holidays.php new file mode 100644 index 0000000..57a3312 --- /dev/null +++ b/Config/Migration/1711535474_update_2024_holidays.php @@ -0,0 +1,136 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('NetCommonsMigration', 'NetCommons.Config/Migration'); +App::uses('CurrentLib', 'NetCommons.Lib'); + +/** + * 令和3年の祝日の修正 + * + * @author Shohei Nakajima + * @package NetCommons\Holidays\Config\Migration + * @see https://github.com/NetCommons3/NetCommons3/issues/1621 + */ +class Update2024Holidays extends NetCommonsMigration { + +/** + * Migration description + * + * @var string + */ + public $description = 'update_2024_holidays'; + +/** + * Actions to be performed + * + * @var array $migration + */ + public $migration = array( + 'up' => array( + ), + 'down' => array( + ), + ); + +/** + * HolidayRruleモデル + * + * @var HolidayRrule + */ + private $__HolidayRrule; + +/** + * Holidayモデル + * + * @var HolidayRrule + */ + private $__Holiday; + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + $this->__HolidayRrule = ClassRegistry::init('Holidays.HolidayRrule'); + $this->__Holiday = ClassRegistry::init('Holidays.Holiday'); + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + if ($direction === 'up') { + CurrentLib::write('Language.id', 2); + //秋分日の更新 + $this->__updateAutumnalEquinoxDay(); + } + return true; + } + +/** + * 秋分日の更新 + * + * @return void + */ + private function __updateAutumnalEquinoxDay() { + $count = $this->__Holiday->find('count', array( + 'conditions' => array( + 'holiday' => '2024-09-23', + ), + 'recursive' => -1, + )); + if ($count > 0) { + return; + } + + $params = [ + 'HolidayRrule' => [ + 'id' => '146', + 'input_month_day' => [ + 'day' => '22', + 'month' => '9', + ], + 'can_substitute' => '1', + 'is_variable' => '0', + 'week' => '1', + 'day_of_the_week' => 'SU', + 'start_year' => '2024', + 'end_year' => '2024', + ], + 'Holiday' => [ + 2 => [ + 'id' => '', + 'key' => '', + 'language_id' => '2', + 'title' => '秋分の日', + 'is_origin' => true, + 'is_translation' => true, + ], + 1 => [ + 'id' => '', + 'key' => '', + 'language_id' => '1', + 'title' => 'Autumnal Equinox Day', + 'is_origin' => false, + 'is_translation' => true, + ], + ], + ]; + $this->__HolidayRrule->create(null); + $this->__HolidayRrule->saveHolidayRrule($params); + } + +} From ac8a9d76851fbbc11d19ff4c1e4718e7987375c3 Mon Sep 17 00:00:00 2001 From: "G01\\fj2532ir" Date: Thu, 5 Jun 2025 14:51:55 +0900 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20getHoliday=E3=81=A7=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E3=81=99=E3=82=8B=E3=82=AB=E3=83=A9=E3=83=A0=E6=95=B0?= =?UTF-8?q?=E3=82=92=E6=B8=9B=E3=82=89=E3=81=97=E3=81=A6=E3=80=81getHolida?= =?UTF-8?q?yInYear=E3=81=A7=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E3=82=89=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Holiday.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Model/Holiday.php b/Model/Holiday.php index 4d262be..de37395 100644 --- a/Model/Holiday.php +++ b/Model/Holiday.php @@ -93,12 +93,17 @@ public function isHoliday($date = null) { */ public function getHoliday($from, $to) { $holidays = $this->cacheFindQuery('all', array( + 'fields' => array( + 'Holiday.id', + 'Holiday.holiday', + 'Holiday.title' + ), 'conditions' => array( 'language_id' => Current::read('Language.id'), 'holiday >=' => $from, 'holiday <=' => $to ), - 'recursive' => 0, + 'recursive' => -1, 'order' => array('holiday') )); return $holidays; @@ -120,7 +125,15 @@ public function getHolidayInYear($year = null) { } $from = $year . '-01-01'; $to = $year . '-12-31'; - $holidays = $this->getHoliday($from, $to); + $holidays = $this->Find('all', array( + 'conditions' => array( + 'language_id' => Current::read('Language.id'), + 'holiday >=' => $from, + 'holiday <=' => $to + ), + 'recursive' => 0, + 'order' => array('holiday') + )); return $holidays; } From 23f480bd57c2acee5a94ed0bf9003b8172f0df66 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 24 Feb 2026 10:02:37 +0900 Subject: [PATCH 7/7] =?UTF-8?q?add:=20=E3=80=8C2026/09/26=20=E5=9B=BD?= =?UTF-8?q?=E6=B0=91=E3=81=AE=E4=BC=91=E6=97=A5=E3=80=8D=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1771893343_update_20260922_holiday.php | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Config/Migration/1771893343_update_20260922_holiday.php diff --git a/Config/Migration/1771893343_update_20260922_holiday.php b/Config/Migration/1771893343_update_20260922_holiday.php new file mode 100644 index 0000000..1a57a0e --- /dev/null +++ b/Config/Migration/1771893343_update_20260922_holiday.php @@ -0,0 +1,136 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('NetCommonsMigration', 'NetCommons.Config/Migration'); +App::uses('CurrentLib', 'NetCommons.Lib'); + +/** + * 「2026/09/26 国民の休日」追加 + * + * @author Shohei Nakajima + * @package NetCommons\Holidays\Config\Migration + * @see https://github.com/NetCommons3/NetCommons3/issues/1621 + */ +class Update20260922Holiday extends NetCommonsMigration { + +/** + * Migration description + * + * @var string + */ + public $description = 'update_20260922_holiday'; + +/** + * Actions to be performed + * + * @var array $migration + */ + public $migration = array( + 'up' => array( + ), + 'down' => array( + ), + ); + +/** + * HolidayRruleモデル + * + * @var HolidayRrule + */ + private $__HolidayRrule; + +/** + * Holidayモデル + * + * @var HolidayRrule + */ + private $__Holiday; + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + $this->__HolidayRrule = ClassRegistry::init('Holidays.HolidayRrule'); + $this->__Holiday = ClassRegistry::init('Holidays.Holiday'); + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + if ($direction === 'up') { + CurrentLib::write('Language.id', 2); + //秋分日の更新 + $this->__updateAutumnalEquinoxDay(); + } + return true; + } + +/** + * 秋分日の更新 + * + * @return void + */ + private function __updateAutumnalEquinoxDay() { + $count = $this->__Holiday->find('count', array( + 'conditions' => array( + 'holiday' => '2026-09-22', + ), + 'recursive' => -1, + )); + if ($count > 0) { + return; + } + + $params = [ + 'HolidayRrule' => [ + 'id' => '', + 'input_month_day' => [ + 'day' => '22', + 'month' => '9', + ], + 'can_substitute' => '0', + 'is_variable' => '0', + 'week' => '1', + 'day_of_the_week' => 'MO', + 'start_year' => '2026', + 'end_year' => '2026', + ], + 'Holiday' => [ + 2 => [ + 'id' => '', + 'key' => '', + 'language_id' => '2', + 'title' => '国民の休日', + 'is_origin' => true, + 'is_translation' => true, + ], + 1 => [ + 'id' => '', + 'key' => '', + 'language_id' => '1', + 'title' => 'National People\'s Day Holiday', + 'is_origin' => false, + 'is_translation' => true, + ], + ], + ]; + $this->__HolidayRrule->create(null); + $this->__HolidayRrule->saveHolidayRrule($params); + } + +}