From da90fc62423c72c6d6fa0058011c84204a838972 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 12 Jan 2023 11:01:48 +0900 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20test:=20WorkflowBehavior=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=AB=E3=81=A8=E3=82=82=E3=81=AA=E3=81=84=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/QuestionnaireAnswersController/ViewTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Test/Case/Controller/QuestionnaireAnswersController/ViewTest.php b/Test/Case/Controller/QuestionnaireAnswersController/ViewTest.php index 5949eef..e8c3edb 100644 --- a/Test/Case/Controller/QuestionnaireAnswersController/ViewTest.php +++ b/Test/Case/Controller/QuestionnaireAnswersController/ViewTest.php @@ -325,7 +325,8 @@ public function testGetShuffle() { 'action' => 'view', 'frame_id' => 6, 'block_id' => 2, - 'key' => 'questionnaire_4' + 'key' => 'questionnaire_4', + '?' => ['lang' => 'ja'] ); $assert = array('method' => 'assertTextContains', 'expected' => __d('questionnaires', 'This questionnaire is being temporarily stored . You can questionnaire test before performed in this page . If you want to modify or change the questionnaire , you will be able to edit by pressing the [ Edit question ] button in the upper-right corner .')); From 144d978ee36c1dd95e174b47f0ae81e57da0d03d Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 12 Jan 2023 16:01:26 +0900 Subject: [PATCH 02/11] =?UTF-8?q?change:=20PHP7.1=E3=82=92=E8=87=AA?= =?UTF-8?q?=E5=8B=95=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=AF=BE=E8=B1=A1?= =?UTF-8?q?=E3=81=8B=E3=82=89=E5=A4=96=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当プラグインは、composer.lockファイルを参照する処理があるのだが、PHP7.1ではcomposer install時にjms/serializerのインストールに失敗しcomposer.lockファイルが参照できなくなる。それが原因でテストに失敗するため。 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9501566..8262600 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - php: [ '7.1', '7.2', '7.3', '7.4' ] + php: [ '7.2', '7.3', '7.4' ] mysql: [ '5.7', '8.0' ] env: From e6f72e1ddc3ffaab197151995a2d149323337b5b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 16:09:30 +0900 Subject: [PATCH 03/11] =?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 | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8262600..3195c64 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 From 7d9d29ed49314cfca0d6bc08bb1c8cc485669234 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 04:15:54 +0900 Subject: [PATCH 04/11] 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 9f9038e6865570ae45a90238e8e465884a83f22e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 18 Sep 2023 21:22:16 +0900 Subject: [PATCH 05/11] =?UTF-8?q?fix:=20=E3=82=A2=E3=83=B3=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=AE=E7=A2=BA=E8=AA=8D=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E7=A4=BA=E5=BE=8C=E3=81=AB=E5=9B=9E=E7=AD=94?= =?UTF-8?q?=E3=82=92=E7=B5=82=E4=BA=86=E3=81=9B=E3=81=9A=E3=81=AB=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=82=A6=E3=82=B6=E3=82=92=E9=96=89=E3=81=98=E3=80=81?= =?UTF-8?q?=E3=81=9D=E3=81=AE=E5=BE=8C=E3=81=82=E3=82=89=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=81=A6=E5=9B=9E=E7=AD=94=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AB?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=82=A6=E3=82=B6=E3=82=92=E9=96=89=E3=81=98?= =?UTF-8?q?=E3=82=8B=E5=89=8D=E3=81=AE=E5=9B=9E=E7=AD=94=E6=97=A5=E6=99=82?= =?UTF-8?q?=E3=81=8CCSV=E3=81=AB=E5=87=BA=E5=8A=9B=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=83=90=E3=82=B0=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/QuestionnaireAnswerSummary.php | 6 ++++-- Model/QuestionnaireAnswerSummaryCsv.php | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Model/QuestionnaireAnswerSummary.php b/Model/QuestionnaireAnswerSummary.php index 2441f21..f6cd2ea 100644 --- a/Model/QuestionnaireAnswerSummary.php +++ b/Model/QuestionnaireAnswerSummary.php @@ -113,11 +113,13 @@ class QuestionnaireAnswerSummary extends QuestionnairesAppModel { */ public function saveAnswerStatus($questionnaire, $summary, $status) { $summary['QuestionnaireAnswerSummary']['answer_status'] = $status; + if ($status == QuestionnairesComponent::ACTION_ACT) { + // サマリの状態を完了にして確定する + $summary['QuestionnaireAnswerSummary']['answer_time'] = (new NetCommonsTime())->getNowDatetime(); + } if ($status == QuestionnairesComponent::ACTION_ACT && $questionnaire['Questionnaire']['is_answer_mail_send']) { - // サマリの状態を完了にして確定する - $summary['QuestionnaireAnswerSummary']['answer_time'] = (new NetCommonsTime())->getNowDatetime(); // メールのembed のURL設定を行っておく $url = NetCommonsUrl::actionUrl(array( 'controller' => 'questionnaire_blocks', diff --git a/Model/QuestionnaireAnswerSummaryCsv.php b/Model/QuestionnaireAnswerSummaryCsv.php index 781fc2c..578f5b8 100644 --- a/Model/QuestionnaireAnswerSummaryCsv.php +++ b/Model/QuestionnaireAnswerSummaryCsv.php @@ -257,7 +257,12 @@ protected function _getRows($questionnaire, $summary, $answers) { $cols = array(); $cols[] = $this->_getUserName($questionnaire, $summary); - $cols[] = $summary['QuestionnaireAnswerSummaryCsv']['modified']; + if (isset($summary['QuestionnaireAnswerSummaryCsv']['answer_time'])) { + $anserTime = $summary['QuestionnaireAnswerSummaryCsv']['answer_time']; + } else { + $anserTime = $summary['QuestionnaireAnswerSummaryCsv']['modified']; + } + $cols[] = $anserTime; $cols[] = $summary['QuestionnaireAnswerSummaryCsv']['answer_number']; foreach ($questionnaire['QuestionnairePage'] as $page) { From bf62bf50f600d895213527d898ead01fb663f777 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 18 Sep 2023 21:30:00 +0900 Subject: [PATCH 06/11] =?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 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3195c64..3142402 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ 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 @@ -28,7 +28,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.2', '7.3', '7.4' ] @@ -92,46 +92,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 @@ -148,7 +155,7 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される From 9baea8425b61f5c9de85c96dbc6bf1da52e8971a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 21:46:55 +0900 Subject: [PATCH 07/11] =?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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3142402..36cd2b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,12 +3,10 @@ on: branches: - main - master - - availability pull_request: branches: - main - master - - availability name: tests @@ -19,6 +17,7 @@ jobs: 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 @@ -146,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 @@ -160,8 +159,8 @@ jobs: 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 e59721340eb07bca9f16aea70b766a39ab933fe8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 21:33:17 +0900 Subject: [PATCH 08/11] 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 f5a05b3c06638599c75d5ff318604793d27ac42b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 27 Nov 2025 15:24:15 +0900 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=E3=80=8C=E3=83=86=E3=82=AD?= =?UTF-8?q?=E3=82=B9=E3=83=88=E5=9E=8B=EF=BC=8B=E5=BF=85=E9=A0=88=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=AA=E3=81=84=EF=BC=8B=E6=95=B0=E5=80=A4=E5=9E=8B?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E5=A0=B4=E5=90=88=E3=80=81=E6=9C=AA=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E3=81=AB=E3=81=97=E3=81=A6=E3=82=82=E6=95=B0=E5=80=A4?= =?UTF-8?q?=E3=82=92=E5=85=A5=E5=8A=9B=E3=81=97=E3=81=A6=E3=81=8F=E3=81=A0?= =?UTF-8?q?=E3=81=95=E3=81=84=E3=81=A8=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E5=87=BA=E3=82=8B=E3=80=82=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1730?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/QuestionnaireAnswerTextBehavior.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Behavior/QuestionnaireAnswerTextBehavior.php b/Model/Behavior/QuestionnaireAnswerTextBehavior.php index 996013f..73dd32d 100644 --- a/Model/Behavior/QuestionnaireAnswerTextBehavior.php +++ b/Model/Behavior/QuestionnaireAnswerTextBehavior.php @@ -77,7 +77,7 @@ public function answerTextValidation($model, $data, $question, $allAnswers) { $ret = true; // 数値型回答を望まれている場合 if ($question['question_type_option'] == QuestionnairesComponent::TYPE_OPTION_NUMERIC) { - if (!Validation::numeric($data['answer_value'])) { + if (mb_strlen($data['answer_value']) !== 0 && !Validation::numeric($data['answer_value'])) { $ret = false; $model->validationErrors['answer_value'][] = __d('questionnaires', 'Number required'); } @@ -86,7 +86,7 @@ public function answerTextValidation($model, $data, $question, $allAnswers) { $data['answer_value'], intval($question['min']), intval($question['max'])); - if (!$rangeRes) { + if (mb_strlen($data['answer_value']) !== 0 && !$rangeRes) { $ret = false; $model->validationErrors['answer_value'][] = __d('questionnaires', 'Please enter the answer between %s and %s.', From 2f73fd1b1fa93a7d358bea05c076f3fd89381468 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 27 Nov 2025 15:27:54 +0900 Subject: [PATCH 10/11] =?UTF-8?q?ci:=20phpunit=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=B1=E3=83=BC=E3=82=B9=E3=82=92=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=EF=BC=88php7.4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 36cd2b9..f46fc05 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,8 +30,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [ '7.2', '7.3', '7.4' ] - mysql: [ '5.7', '8.0' ] + php: [ '7.4' ] + mysql: [ '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" From c24ca6cb450f4e48449ebd2384dd6b7a2a423a6f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 27 Nov 2025 16:49:38 +0900 Subject: [PATCH 11/11] =?UTF-8?q?style:=20phpmd=E5=9B=9E=E9=81=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/QuestionnaireAnswerTextBehavior.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/Behavior/QuestionnaireAnswerTextBehavior.php b/Model/Behavior/QuestionnaireAnswerTextBehavior.php index 73dd32d..d7d57ab 100644 --- a/Model/Behavior/QuestionnaireAnswerTextBehavior.php +++ b/Model/Behavior/QuestionnaireAnswerTextBehavior.php @@ -69,6 +69,7 @@ public function answerMaxLength($model, $data, $question, $max) { * @param array $question 回答データに対応する質問 * @param array $allAnswers 入力された回答すべて * @return bool + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function answerTextValidation($model, $data, $question, $allAnswers) { if (! in_array($question['question_type'], $this->_textValidateType)) {