From f7129c224001e797bf5871e646c1e004e4b42c2b Mon Sep 17 00:00:00 2001 From: "ohga.ryohei" Date: Thu, 13 Sep 2018 17:17:37 +0900 Subject: [PATCH 01/42] =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=81=8C=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=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/CircularNoticesAnswerController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Controller/CircularNoticesAnswerController.php b/Controller/CircularNoticesAnswerController.php index d8c2ded..26145de 100644 --- a/Controller/CircularNoticesAnswerController.php +++ b/Controller/CircularNoticesAnswerController.php @@ -87,14 +87,16 @@ public function edit() { } } - $data = array_merge($this->params['data'], [ - 'CircularNoticeTargetUser' => [ + $data = $this->params['data']; + $data['CircularNoticeTargetUser'] = array_merge( + $this->params['data']['CircularNoticeTargetUser'], + [ 'is_reply' => true, 'reply_datetime' => date('Y-m-d H:i:s'), 'reply_text_value' => $replyTextValue, 'reply_selection_value' => $replySelectionValue ] - ]); + ); if ($this->CircularNoticeTargetUser->saveCircularNoticeTargetUser($data)) { //新着データを回答済みにする From 358a3471ff9f6d6ed98166a3c82d5b4307b82da8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 11 Aug 2019 00:02:40 +0900 Subject: [PATCH 02/42] =?UTF-8?q?fix:=20test:=20UnitTest=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20https://github.com/researchmap/RmNetCommons3/issues/1468?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Test/Case/Config/RoutesTest.php | 78 ------------------- .../DownloadTest.php | 5 +- 2 files changed, 4 insertions(+), 79 deletions(-) delete mode 100644 Test/Case/Config/RoutesTest.php diff --git a/Test/Case/Config/RoutesTest.php b/Test/Case/Config/RoutesTest.php deleted file mode 100644 index 4b0800a..0000000 --- a/Test/Case/Config/RoutesTest.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author Shohei Nakajima - * @link http://www.netcommons.org NetCommons Project - * @license http://www.netcommons.org/license.txt NetCommons License - * @copyright Copyright 2014, NetCommons Project - */ - -App::uses('NetCommonsRoutesTestCase', 'NetCommons.TestSuite'); - -/** - * Config/routes.phpのテスト - * - * @author Shohei Nakajima - * @package NetCommons\Pages\Test\Case\Routing\Route\SlugRoute - */ -class RoutesTest extends NetCommonsRoutesTestCase { - -/** - * Fixtures - * - * @var array - */ - public $fixtures = array(); - -/** - * Plugin name - * - * @var string - */ - public $plugin = 'circular_notices'; - -/** - * DataProvider - * - * ### 戻り値 - * - url URL - * - expected 期待値 - * - * @return array テストデータ - */ - public function dataProvider() { - return array( - array( - 'url' => '/circular_notices/circular_notices/view/1/content_key', - 'expected' => array( - 'plugin' => 'circular_notices', 'controller' => 'circular_notices', 'action' => 'view', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - array( - 'url' => '/circular_notices/circular_notices/edit/1/content_key', - 'expected' => array( - 'plugin' => 'circular_notices', 'controller' => 'circular_notices', 'action' => 'edit', - 'block_id' => '1', 'key' => 'content_key' - ) - ), - array( - 'url' => '/circular_notices/circular_notices/delete/1/content_key', - 'expected' => array( - 'plugin' => 'circular_notices', 'controller' => 'circular_notices', 'action' => 'delete', - 'block_id' => '1', 'key' => 'content_key' - ) - ), - array( - 'url' => '/circular_notices/circular_notices/download/1/content_key', - 'expected' => array( - 'plugin' => 'circular_notices', 'controller' => 'circular_notices', 'action' => 'download', - 'block_id' => '1', 'key' => 'content_key', - ) - ), - ); - } - -} diff --git a/Test/Case/Controller/CircularNoticesController/DownloadTest.php b/Test/Case/Controller/CircularNoticesController/DownloadTest.php index e2d5793..351fc33 100644 --- a/Test/Case/Controller/CircularNoticesController/DownloadTest.php +++ b/Test/Case/Controller/CircularNoticesController/DownloadTest.php @@ -190,7 +190,10 @@ public function testDownload($urlOptions, $data, $assert, $exception = null, $re ); $this->controller->request->params['key'] = $urlOptions['key']; $this->controller->request->data = $data; - Current::initialize($this->controller); + + $instance = Current::getInstance(); + $instance->initialize($this->controller); + $id = empty($urlOptions['frame_id']) ? '6' : $urlOptions['frame_id']; Current::write('Frame', [ 'id' => $id, From 348d952f22fa09f7467efa7f2aff2a39a5669ee9 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 11 Aug 2019 00:11:20 +0900 Subject: [PATCH 03/42] =?UTF-8?q?fix:=20test:=20travis=20php7.2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 ++ phpunit.xml.dist | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 108e0da..3097275 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,10 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 sudo: false +dist: trusty env: matrix: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b16e5da..6d97e26 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,5 @@ - From 4f23dd61b2bba46354b595df81f488ac5e581cd8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 11 Aug 2019 08:42:52 +0900 Subject: [PATCH 04/42] =?UTF-8?q?fix:=20php7.2=E5=AF=BE=E5=BF=9C=20https:/?= =?UTF-8?q?/github.com/NetCommons3/NetCommons3/issues/1451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/CircularNoticeContent.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Model/CircularNoticeContent.php b/Model/CircularNoticeContent.php index 69dd218..c2743be 100644 --- a/Model/CircularNoticeContent.php +++ b/Model/CircularNoticeContent.php @@ -276,8 +276,7 @@ public function validateNotEmptyChoices($check) { $this->data['CircularNoticeContent']['reply_type'] == CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION ) { - if (! isset($this->data['CircularNoticeChoices']) || - count($this->data['CircularNoticeChoices']) == 0) { + if (empty($this->data['CircularNoticeChoices'])) { return false; } } From 5f48755c8e85beb0e6f5350113ff88f5ae9c8271 Mon Sep 17 00:00:00 2001 From: goto Date: Fri, 11 Oct 2019 15:15:07 +0900 Subject: [PATCH 05/42] =?UTF-8?q?=E5=9B=9E=E8=A6=A7=E5=85=88=E3=81=AB?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E4=B8=8D=E5=8F=AF=E3=81=AE=E4=BC=9A=E5=93=A1?= =?UTF-8?q?=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E4=B8=8D?= =?UTF-8?q?=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/CircularNoticeContent.php | 3 ++- Model/CircularNoticeTargetUser.php | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Model/CircularNoticeContent.php b/Model/CircularNoticeContent.php index c2743be..66670c5 100644 --- a/Model/CircularNoticeContent.php +++ b/Model/CircularNoticeContent.php @@ -443,7 +443,8 @@ public function saveCircularNoticeContent($data) { 'RolesRoomsUser' => 'Rooms.RolesRoomsUser', ]); $rolesRoomsUsers = $this->RolesRoomsUser->getRolesRoomsUsers(array( - 'Room.id' => Current::read('Room.id') + 'Room.id' => Current::read('Room.id'), + 'User.status' => UserAttributeChoice::STATUS_CODE_ACTIVE )); $userIdArr = []; diff --git a/Model/CircularNoticeTargetUser.php b/Model/CircularNoticeTargetUser.php index a24cfc2..375f713 100644 --- a/Model/CircularNoticeTargetUser.php +++ b/Model/CircularNoticeTargetUser.php @@ -82,7 +82,8 @@ public function validateNotEmptyReplyValue($check) { 'User' => array( 'className' => 'Users.User', 'foreignKey' => 'user_id', - 'conditions' => '', + 'conditions' => ['status' => UserAttributeChoice::STATUS_CODE_ACTIVE], + 'type' => 'inner', 'fields' => '', 'order' => '' ), @@ -151,7 +152,7 @@ public function getCircularNoticeTargetUserCount($contentId) { // 回覧先件数を取得 $targetCount = $this->find('count', array( - 'recursive' => -1, + 'recursive' => 1, 'conditions' => $conditions, )); @@ -162,7 +163,7 @@ public function getCircularNoticeTargetUserCount($contentId) { // 閲覧済件数を取得 $readCount = $this->find('count', array( - 'recursive' => -1, + 'recursive' => 1, 'conditions' => $conditions, )); @@ -173,7 +174,7 @@ public function getCircularNoticeTargetUserCount($contentId) { // 回答済件数を取得 $replyCount = $this->find('count', array( - 'recursive' => -1, + 'recursive' => 1, 'conditions' => $conditions, )); From 676c24f81fdd3daae66dc1255da74170c276047f Mon Sep 17 00:00:00 2001 From: Mitsuru Mutaguchi Date: Thu, 19 Dec 2019 19:12:43 +0900 Subject: [PATCH 06/42] =?UTF-8?q?bugfix:=20=E5=9B=9E=E8=A6=A7=E6=9D=BF?= =?UTF-8?q?=E3=80=81=E8=A8=98=E4=BA=8B=E5=89=8A=E9=99=A4=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1547 --- Controller/CircularNoticesController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index f169056..ec6f921 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -428,6 +428,15 @@ public function edit() { )); $this->set('circularNoticeContent', $results['CircularNoticeContent']); $this->set('circularNoticeChoice', $results['CircularNoticeChoice']); + + // 回覧板の記事が削除できないため、削除Formの$this->NetCommonsForm->hidden('Frame.id')等を配置してる項目は + // リクエストにセットする。 + // リクエストにセットすると、$this->NetCommonsForm->hidden('Frame.id')のvalueに自動的にセットされる。 + // 削除Form: app/Plugin/CircularNotices/View/Elements/CircularNotices/delete_form.ctp + // @see https://github.com/NetCommons3/NetCommons3/issues/1547 + $this->request->data['CircularNoticeContent'] = $results['CircularNoticeContent']; + $this->request->data['Frame'] = Current::read('Frame'); + $this->request->data['Block'] = Current::read('Block'); } /** From 715c8f99485ef4cf6927c76295cda00c1fbfe4f0 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 27 Dec 2019 12:56:25 +0900 Subject: [PATCH 07/42] =?UTF-8?q?fix:=20=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E5=8F=96=E5=BE=97=E3=81=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesAnswerController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/CircularNoticesAnswerController.php b/Controller/CircularNoticesAnswerController.php index 26145de..0f901fd 100644 --- a/Controller/CircularNoticesAnswerController.php +++ b/Controller/CircularNoticesAnswerController.php @@ -117,6 +117,6 @@ public function edit() { } // 元の画面を表示 - $this->redirect($this->request->referer()); + $this->redirect($this->request->referer(true)); } } From 76c85b4ae93703c3dfa0ea1aac2cba7d5e12a20f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Mar 2020 08:14:43 +0900 Subject: [PATCH 08/42] =?UTF-8?q?change:=20test:=20travis.yml=E3=81=8B?= =?UTF-8?q?=E3=82=89php5.4,5.5=E3=82=92=E5=89=8A=E9=99=A4=E3=80=82php7.3,7?= =?UTF-8?q?.4=E3=82=92=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/?= =?UTF-8?q?NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3097275..1c9512b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: php php: - - 5.4 - - 5.5 - 5.6 - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 sudo: false dist: trusty From 5ee7b93f4a88fcb8912702e499302984cb9aab4d Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Mar 2020 23:25:39 +0900 Subject: [PATCH 09/42] =?UTF-8?q?change:=20php7.4=E3=81=A7Notice=E3=81=8C?= =?UTF-8?q?=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20=E2=80=BBPHP7.4=E3=81=8B=E3=82=89=E3=82=B9=E3=82=AB?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E5=9E=8B=E5=A4=89=E6=95=B0=E3=81=AB=E9=85=8D?= =?UTF-8?q?=E5=88=97=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=A8E=5FNOTICE=E3=81=8C=E5=87=BA=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AA=E3=81=A3=E3=81=9F=E3=80=82=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/CircularNoticeTargetUserBehavior.php | 2 +- Model/CircularNoticeContent.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Model/Behavior/CircularNoticeTargetUserBehavior.php b/Model/Behavior/CircularNoticeTargetUserBehavior.php index 0c9e377..b0e2210 100644 --- a/Model/Behavior/CircularNoticeTargetUserBehavior.php +++ b/Model/Behavior/CircularNoticeTargetUserBehavior.php @@ -38,7 +38,7 @@ public function beforeValidate(Model $model, $options = array()) { 'User' => 'Users.User', )); - if (! $model->data['CircularNoticeContent']['is_room_target']) { + if (empty($model->data['CircularNoticeContent']['is_room_target'])) { // 回覧先ユーザのバリデーション処理 if (! isset($model->data['CircularNoticeTargetUser'])) { $model->data['CircularNoticeTargetUser'] = array(); diff --git a/Model/CircularNoticeContent.php b/Model/CircularNoticeContent.php index 66670c5..3353cc1 100644 --- a/Model/CircularNoticeContent.php +++ b/Model/CircularNoticeContent.php @@ -493,11 +493,13 @@ public function saveCircularNoticeContent($data) { } // 保存されたCircularNoticeContentでデータを差し替え - $data['CircularNoticeContent'] = $content['CircularNoticeContent']; + if (isset($content['CircularNoticeContent'])) { + $data['CircularNoticeContent'] = $content['CircularNoticeContent']; - // CircularNoticeChoices・CircularNoticeTargetUsersを保存 - if (! $this->__saveChoiceAndTargetUsers($data)) { - return false; + // CircularNoticeChoices・CircularNoticeTargetUsersを保存 + if (! $this->__saveChoiceAndTargetUsers($data)) { + return false; + } } $this->commit(); From e0f0d4a4b5eb2d70dc9bba0979228ce4498a1e36 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 14 Mar 2020 08:57:10 +0900 Subject: [PATCH 10/42] =?UTF-8?q?change:=20php7.4=E3=81=A7Notice=E3=81=8C?= =?UTF-8?q?=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20=E2=80=BBPHP7.4=E3=81=8B=E3=82=89=E3=82=B9=E3=82=AB?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E5=9E=8B=E5=A4=89=E6=95=B0=E3=81=AB=E9=85=8D?= =?UTF-8?q?=E5=88=97=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=A8E=5FNOTICE=E3=81=8C=E5=87=BA=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AA=E3=81=A3=E3=81=9F=E3=80=82=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1560?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/CircularNoticeContent.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Model/CircularNoticeContent.php b/Model/CircularNoticeContent.php index 3353cc1..e47725f 100644 --- a/Model/CircularNoticeContent.php +++ b/Model/CircularNoticeContent.php @@ -495,11 +495,13 @@ public function saveCircularNoticeContent($data) { // 保存されたCircularNoticeContentでデータを差し替え if (isset($content['CircularNoticeContent'])) { $data['CircularNoticeContent'] = $content['CircularNoticeContent']; + } else { + $data['CircularNoticeContent'] = null; + } - // CircularNoticeChoices・CircularNoticeTargetUsersを保存 - if (! $this->__saveChoiceAndTargetUsers($data)) { - return false; - } + // CircularNoticeChoices・CircularNoticeTargetUsersを保存 + if (! $this->__saveChoiceAndTargetUsers($data)) { + return false; } $this->commit(); From 1642adfa8de1e3b249c49016de7171465fe177fa Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 1 Aug 2020 17:55:17 +0900 Subject: [PATCH 11/42] =?UTF-8?q?change:=20test:=20Travis=E3=81=8B?= =?UTF-8?q?=E3=82=89PHP5.6=E3=82=92=E5=89=8A=E9=99=A4,php72=E4=BB=A5?= =?UTF-8?q?=E9=99=8D=E3=81=A7UnitTest=E3=81=A7Warning=E3=81=8C=E5=87=BA?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1588?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 1 - phpunit.xml.dist | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1c9512b..ac5375c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: php php: - - 5.6 - 7.0 - 7.1 - 7.2 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6d97e26..c0bacd0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,11 @@ + + + + + + app/Plugin/CircularNotices From 3eb8a467c0b2c338f0e9fb55f6fac2d21e4c7e2f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 26 Aug 2020 20:17:13 +0900 Subject: [PATCH 12/42] change: Version number to 3.3.2 --- VERSION.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..4772543 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +3.3.2 From 08ccd19e0429f21bd8dad966f3be5c954f64ef50 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 13 Dec 2020 16:52:12 +0900 Subject: [PATCH 13/42] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=AEphp7.3?= =?UTF-8?q?=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ac5375c..1b2842c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.0 - 7.1 - 7.2 - - 7.3 + - 7.3.24 - 7.4 sudo: false From 4cf19955aab9a07c24561e91535f7c3bc13efd61 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Mon, 14 Dec 2020 08:46:05 +0000 Subject: [PATCH 14/42] =?UTF-8?q?fix:=20Wysiwyg=E3=81=AB=E3=81=A6=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=83=BB=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=83=AD=E3=83=BC=E3=83=89=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=81=A8=E3=81=8D=E3=80=81contents=E3=81=AEsave?= =?UTF-8?q?=E6=99=82=E3=81=ABupload=5Ffiles=E3=81=ABblock=5Fkey=E3=81=8C?= =?UTF-8?q?=E5=85=A5=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/CircularNotices/edit.ctp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/View/CircularNotices/edit.ctp b/View/CircularNotices/edit.ctp index 82bddc4..a0fecc9 100644 --- a/View/CircularNotices/edit.ctp +++ b/View/CircularNotices/edit.ctp @@ -57,6 +57,11 @@ 'value' => Current::read('Block.id'), )); ?> + + NetCommonsForm->hidden('Block.key', array( + 'value' => Current::read('Block.key'), + )); ?> + NetCommonsForm->hidden('CircularNoticeContent.id', array( 'value' => isset($circularNoticeContent['id']) ? $circularNoticeContent['id'] : null, )); ?> From 5af168e1fa9f0f30648a253b4c89f98da3d88353 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 6 Jan 2021 10:42:30 +0900 Subject: [PATCH 15/42] =?UTF-8?q?fix:=20=E8=A1=A8=E7=A4=BA=E9=A0=86(sort)?= =?UTF-8?q?=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=80=81=E3=82=BD=E3=83=BC=E3=83=88=E6=96=B9=E6=B3=95?= =?UTF-8?q?(direction)=E3=81=AE=E5=90=8D=E5=89=8D=E4=BB=98=E3=81=8D?= =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=A8=E3=81=8DNotice=E3=81=8C=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https:?= =?UTF-8?q?//github.com/researchmap/RmNetCommons3/issues/1970?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index ec6f921..59a049c 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -89,7 +89,7 @@ public function beforeFilter() { * index action * * @return void - * + * * 速度改善の修正に伴って発生したため抑制 * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -139,7 +139,7 @@ public function index() { $currentSort = isset($this->params['named']['sort']) ? $this->params['named']['sort'] : 'CircularNoticeContent.modified'; - $currentDirection = isset($this->params['named']['sort']) + $currentDirection = isset($this->params['named']['direction']) ? $this->params['named']['direction'] : 'desc'; if (! isset($sortOptions[$currentSort . '.' . $currentDirection])) { From 0ceda0da852ddb0754c5c69657af57ce636bda3a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:53:40 +0900 Subject: [PATCH 16/42] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From 5389949656776a9d757319093200e132ad10ccf2 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 13:53:45 +0900 Subject: [PATCH 17/42] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From 4604b791fd935a3785dd235d94fc6cd464e505a7 Mon Sep 17 00:00:00 2001 From: ryu818 Date: Tue, 16 Feb 2021 07:48:24 +0900 Subject: [PATCH 18/42] =?UTF-8?q?fix:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=AD=E3=82=B0=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=20https://github.com/researchmap/Rm?= =?UTF-8?q?NetCommons3/issues/2404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/CircularNoticeTargetUser.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/CircularNoticeTargetUser.php b/Model/CircularNoticeTargetUser.php index 375f713..f9f0846 100644 --- a/Model/CircularNoticeTargetUser.php +++ b/Model/CircularNoticeTargetUser.php @@ -56,7 +56,6 @@ public function beforeValidate($options = array()) { * @return bool */ public function validateNotEmptyReplyValue($check) { - CakeLog::error(var_export($this->data['CircularNoticeTargetUser'], true)); if (! $this->data['CircularNoticeTargetUser']['reply_text_value'] && ! $this->data['CircularNoticeTargetUser']['reply_selection_value'] ) { From 60ce1d6768944f2acf46593328a9b64ca4e7e3eb Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Fri, 7 May 2021 19:52:29 +0900 Subject: [PATCH 19/42] =?UTF-8?q?fix:=20=E5=9B=9E=E8=A6=A7=E6=9D=BF?= =?UTF-8?q?=E3=81=AE=E5=9B=9E=E7=AD=94CSV=E3=81=AE=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E8=82=A2=E3=81=8C=E3=83=A9=E3=83=99=E3=83=AB=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=81=8FID=E3=81=A7=E5=87=BA=E5=8A=9B=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=80=81=E4=BD=95=E3=81=8C=E9=81=B8=E3=81=B0=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=81=8B=E3=82=8F=E3=81=8B=E3=82=89=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NetCommons3/NetCommons3/issues/1641 --- Controller/CircularNoticesController.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 59a049c..925a2f3 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -506,9 +506,13 @@ public function download() { $csvFile->add($header); // 回答データ整形 + $choices = array(); + foreach ($content['CircularNoticeChoice'] as $choice) { + $choices[$choice['id']] = $choice; + } $content = $content['CircularNoticeContent']; foreach ($targetUsers as $targetUser) { - $answer = $this->__parseAnswer($content['reply_type'], $targetUser); + $answer = $this->__parseAnswer($content['reply_type'], $targetUser, $choices); $readDatetime = __d('circular_notices', 'Unread'); if ($targetUser['CircularNoticeTargetUser']['read_datetime']) { @@ -550,9 +554,10 @@ public function download() { * * @param string $replyType 回答種別 * @param array $targetUser 回答者 + * @param array $choices 選択肢情報 * @return null|string */ - private function __parseAnswer($replyType, $targetUser) { + private function __parseAnswer($replyType, $targetUser, $choices) { $answer = null; switch ($replyType) { case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_TEXT: @@ -562,6 +567,10 @@ private function __parseAnswer($replyType, $targetUser) { case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION: $selectionValues = explode(CircularNoticeComponent::SELECTION_VALUES_DELIMITER, $targetUser['CircularNoticeTargetUser']['reply_selection_value']); + // 取り出したreply_selection_valueの値を選択肢のラベルに変換する + foreach ($selectionValues as &$selectVal) { + $selectVal = $choices[$selectVal]['value'] ?? ''; + } $answer = implode(__d('circular_notices', 'Answer separator'), $selectionValues); break; } From f375d2a1ac107421c650288dc5b8a772161ec103 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Mon, 10 May 2021 10:37:47 +0900 Subject: [PATCH 20/42] fix: phpunit error --- .../CircularNoticesController/ParseAnswerTest.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php b/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php index 8741440..a458e11 100644 --- a/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php +++ b/Test/Case/Controller/CircularNoticesController/ParseAnswerTest.php @@ -65,6 +65,7 @@ public function dataProviderParseAnswer() { 'reply_text_value' => 'Lorem ipsum dolor sit amet' ), ), + 'choices' => array() ), 'assert' => 'Lorem ipsum dolor sit amet' ); @@ -78,8 +79,14 @@ public function dataProviderParseAnswer() { 'reply_selection_value' => '1|3', ), ), + 'choices' => array( + 1 => array('id' => 1, 'value' => 'AAA'), + 2 => array('id' => 2, 'value' => 'BBB'), + 3 => array('id' => 3, 'value' => 'CCC'), + 4 => array('id' => 4, 'value' => 'DDD') + ) ), - 'assert' => '1、3' + 'assert' => 'AAA、CCC' ); return $results; @@ -103,7 +110,8 @@ public function testParseAnswer($data, $assert, $exception = null) { $result = $method->invoke( $stub, $data['CircularNoticeContent']['reply_type'], - $data['CircularNoticeTargetUser'] + $data['CircularNoticeTargetUser'], + $data['choices'] ); $this->assertEquals($result, $assert); } From 3fb2c3fd15b19b47b026da0ed9343cda90a0ee85 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 30 Jul 2021 19:34:28 +0900 Subject: [PATCH 21/42] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 14 +--- phpunit.xml.dist | 4 +- 4 files changed, 141 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - 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 + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + 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: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1b2842c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "gfM6LvQaWwrQEtqTT3eXv4RNKXF1UBZWuGlO8DHe8X+S/ocpM5oMPBI7pYzCEheIsRhRccciBUFOaXVcI/bFkUCWsgEarimZBkCpTisKX7MwlFSuJX+rX8QNhGqXrn5aUZZ6K8F92aLipsi+j3gwccgebgTh7wHWYtfkLAxdLUw=" - - GIT_COMMITTER_NAME=kitalab - - GIT_COMMITTER_EMAIL=kitatsuji.yuto@withone.co.jp - - GIT_AUTHOR_NAME=kitalab - - GIT_AUTHOR_EMAIL=kitatsuji.yuto@withone.co.jp - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index 9a2a20b..46a9136 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,6 @@ CircularNotices ======= -CircularNotices for NetComomns3 - -[![Build Status](https://travis-ci.org/NetCommons3/CircularNotices.svg?branch=master)](https://travis-ci.org/NetCommons3/CircularNotices) -[![Coverage Status](https://img.shields.io/coveralls/NetCommons3/CircularNotices.svg)](https://coveralls.io/r/NetCommons3/CircularNotices?branch=master) - -| dependencies | status | -| ------------ | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/54d34c21ee3836ec1000002a/badge.svg?style=flat)](https://www.versioneye.com/user/projects/54d34c21ee3836ec1000002a) | - - - +[![Tests Status](https://github.com/NetCommons3/CircularNotices/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/CircularNotices/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/CircularNotices/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/CircularNotices?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/circular-notices.svg?label=stable)](https://packagist.org/packages/netcommons/circular-notices) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c0bacd0..1154cd3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/CircularNotices @@ -20,5 +17,6 @@ + From 3b69b8ae2a485c7a42a24905f366cbd133005387 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 3 Aug 2021 11:59:57 +0900 Subject: [PATCH 22/42] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ViewElementsCircularNoticeFrameSettingsEditFormController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php index 72f92c6..6c4f6dd 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticeFrameSettingsEditFormController.php @@ -27,6 +27,7 @@ class TestViewElementsCircularNoticeFrameSettingsEditFormController extends AppC public $helpers = array( 'Mails.MailsHtml', 'Mails.MailForm', + 'NetCommons.DisplayNumber', ); /** From 260959d8dfb5b76681e2343a6cb333c8f136aae3 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 3 Aug 2021 12:34:07 +0900 Subject: [PATCH 23/42] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...wElementsCircularNoticesSubjectEditFormController.php | 9 +++++++++ ...ewElementsCircularNoticesTargetEditFormController.php | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php index d7ce550..f82f1ff 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php @@ -19,6 +19,15 @@ */ class TestViewElementsCircularNoticesSubjectEditFormController extends AppController { +/** + * use helpers + * + * @var array + */ + public $helpers = array( + 'Groups.GroupUserList', + ); + /** * subject_edit_form * diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php index fa7fdb4..76b1585 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php @@ -19,6 +19,15 @@ */ class TestViewElementsCircularNoticesTargetEditFormController extends AppController { +/** + * use helpers + * + * @var array + */ + public $helpers = array( + 'NetCommons.TitleIcon', + ); + /** * target_edit_form * From a514725ee2a777332e9e273eea587e0172934973 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 3 Aug 2021 12:39:59 +0900 Subject: [PATCH 24/42] =?UTF-8?q?fix:=20test:=20UnitTest=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TestViewElementsCircularNoticesSubjectEditFormController.php | 2 +- .../TestViewElementsCircularNoticesTargetEditFormController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php index f82f1ff..6fd88fb 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesSubjectEditFormController.php @@ -25,7 +25,7 @@ class TestViewElementsCircularNoticesSubjectEditFormController extends AppContro * @var array */ public $helpers = array( - 'Groups.GroupUserList', + 'NetCommons.TitleIcon', ); /** diff --git a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php index 76b1585..d6fa86a 100644 --- a/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php +++ b/Test/test_app/Plugin/TestCircularNotices/Controller/TestViewElementsCircularNoticesTargetEditFormController.php @@ -25,7 +25,7 @@ class TestViewElementsCircularNoticesTargetEditFormController extends AppControl * @var array */ public $helpers = array( - 'NetCommons.TitleIcon', + 'Groups.GroupUserList', ); /** From 36923a094e8439e49bdc464d953ac0f98588c860 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Aug 2021 23:03:53 +0900 Subject: [PATCH 25/42] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From 48272245de828c052e9ed3d2575a4126f4eca475 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 15:00:27 +0900 Subject: [PATCH 26/42] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From 5ef6f69fe1855bd9f241f354a5fc45c0755f04c3 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 25 Aug 2021 09:47:35 +0900 Subject: [PATCH 27/42] refs : /NetCommons3/NetCommons3/issues/1657 --- Controller/CircularNoticesController.php | 4 ++-- Model/CircularNoticeContent.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 925a2f3..66bd39d 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -100,13 +100,13 @@ public function index() { } // コンテンツステータスの絞り込み値チェック - if (isset($this->params['named']['content_status']) + if (!empty($this->params['named']['content_status']) && ! $this->CircularNotice->existsContentStatus($this->params['named']['content_status'])) { return $this->throwBadRequest(); } // 回答状況の絞り込み値チェック - if (isset($this->params['named']['reply_status']) + if (!empty($this->params['named']['reply_status']) && ! $this->CircularNotice->existsReplyStatus($this->params['named']['reply_status'])) { return $this->throwBadRequest(); } diff --git a/Model/CircularNoticeContent.php b/Model/CircularNoticeContent.php index e47725f..c9c2131 100644 --- a/Model/CircularNoticeContent.php +++ b/Model/CircularNoticeContent.php @@ -375,7 +375,7 @@ public function getCircularNoticeContentsForPaginate($blockKey, $userId, $pagina ), ); - if (isset($paginatorParams['reply_status'])) { + if (!empty($paginatorParams['reply_status'])) { // 未回答の場合 if ($paginatorParams['reply_status'] == CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_STATUS_NOT_REPLIED) { @@ -387,7 +387,7 @@ public function getCircularNoticeContentsForPaginate($blockKey, $userId, $pagina $conditions['CircularNoticeContent.reply_status'] = (int)$paginatorParams['reply_status']; } } - if (isset($paginatorParams['content_status'])) { + if (!empty($paginatorParams['content_status'])) { $conditions['CircularNoticeContent.content_status'] = (int)$paginatorParams['content_status']; } From 09f0e0f23e0a88136c1d8ef6ab95b9e650bd55b7 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 25 Aug 2021 10:41:19 +0900 Subject: [PATCH 28/42] refs : /NetCommons3/NetCommons3/issues/1658 --- View/CircularNotices/index.ctp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/View/CircularNotices/index.ctp b/View/CircularNotices/index.ctp index 1f7ea24..5451225 100644 --- a/View/CircularNotices/index.ctp +++ b/View/CircularNotices/index.ctp @@ -79,6 +79,15 @@ element('CircularNotices/status_label', array( 'circularNoticeContent' => $circularNoticeContent['CircularNoticeContent']) ); ?> + + + +
+ + + CircularNotice->displayDate($circularNoticeContent['CircularNoticeContent']['reply_deadline']); ?> + +
From 4c2ee0e77a1c680d62aeb3b7d00b649b4d22b658 Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 29 Sep 2021 09:38:47 +0900 Subject: [PATCH 29/42] =?UTF-8?q?fix=20:=20=E5=9B=9E=E7=AD=94=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=20/NetCommons3/NetCommons3/issues/1663?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/CircularNotices/view.ctp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/View/CircularNotices/view.ctp b/View/CircularNotices/view.ctp index 3cae1fd..487e98e 100644 --- a/View/CircularNotices/view.ctp +++ b/View/CircularNotices/view.ctp @@ -24,6 +24,12 @@ ) ); ?> +
@@ -179,10 +185,8 @@ )); break; case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_SELECTION: - $selections = array(); $selected = ''; foreach ($circularNoticeChoice as $choice) : - $selections[$choice['id']] = $choice['value']; if ($choice['id'] === $myAnswer['CircularNoticeTargetUser']['reply_selection_value']) : $selected = $choice['id']; endif; @@ -197,11 +201,9 @@ )); break; case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION: - $selections = array(); $selected = explode(CircularNoticeComponent::SELECTION_VALUES_DELIMITER, $myAnswer['CircularNoticeTargetUser']['reply_selection_value']); $selectedValue = array(); foreach ($circularNoticeChoice as $choices) : - $selections[$choices['id']] = $choices['value']; if (in_array($choices['id'], $selected, true)) : $selectedValue[] = $choices['value']; endif; From 0fb80fdc6bdba3527164839df273e3ee0172f39d Mon Sep 17 00:00:00 2001 From: RikaFujiwara Date: Wed, 29 Sep 2021 10:00:10 +0900 Subject: [PATCH 30/42] =?UTF-8?q?fix=20:=20=E8=A8=98=E8=BF=B0=E5=BC=8F?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=81=AE=E6=94=B9=E8=A1=8C=E3=81=8C=EF=BD=82?= =?UTF-8?q?=EF=BD=92=E3=81=A7=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /NetCommons3/NetCommons3/issues/1667 --- View/CircularNotices/view.ctp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/View/CircularNotices/view.ctp b/View/CircularNotices/view.ctp index 487e98e..9fbf2fa 100644 --- a/View/CircularNotices/view.ctp +++ b/View/CircularNotices/view.ctp @@ -333,7 +333,7 @@ foreach ($circularNoticeChoice as $choice) { $answer = null; switch ($circularNoticeContent['reply_type']) { case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_TEXT: - $answer = nl2br(h($circularNoticeTargetUser['CircularNoticeTargetUser']['reply_text_value'])); + $answer = $circularNoticeTargetUser['CircularNoticeTargetUser']['reply_text_value']; break; case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_SELECTION: case CircularNoticeComponent::CIRCULAR_NOTICE_CONTENT_REPLY_TYPE_MULTIPLE_SELECTION: @@ -364,7 +364,7 @@ foreach ($circularNoticeChoice as $choice) { $this->NetCommonsHtml->handleLink($circularNoticeTargetUser, array('avatar' => true), array(), 'User'), array($readDatetime, array('class' => 'row-datetime')), array($replyDatetime, array('class' => 'row-datetime')), - array(h($answer), array('class' => 'circular-notices-reply-col circular-notices-word-break')), + array(nl2br(h($answer)), array('class' => 'circular-notices-reply-col circular-notices-word-break')), )); endforeach; ?> From 85a0e93ac65e718f1d74ca085e7ea67e1cb87638 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 13 Nov 2021 15:17:24 +0900 Subject: [PATCH 31/42] comment: Change release tags. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 592d72f..96097ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: | - NetCommons ${{ github.ref }} released. + ${{ github.repository }}@${{ github.ref }} released. draft: false prerelease: false From d2a3f665619b15750192e3afb7ebe99052f6a3cc Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 13 Nov 2021 17:29:26 +0900 Subject: [PATCH 32/42] comment: Change release tags. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96097ff..c55f5d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} body: | - ${{ github.repository }}@${{ github.ref }} released. + ${{ github.ref }} released. draft: false prerelease: false From b2159b37400c41c296c5b6c6ec00562751ace5e0 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 18:32:33 +0900 Subject: [PATCH 33/42] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From 06d4004cd7428986ab5b365e028d6232d017d23f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Apr 2022 10:02:08 +0900 Subject: [PATCH 34/42] =?UTF-8?q?fix:=20=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=82=92=E5=89=8A=E9=99=A4=20https://github.?= =?UTF-8?q?com/researchmap/RmNetCommons3/issues/2722?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 66bd39d..176c647 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -50,7 +50,7 @@ class CircularNoticesController extends CircularNoticesAppController { 'NetCommons.Permission' => array( //アクセスの権限 'allow' => array( - 'index,view,downloads' => 'content_readable', + //'index,view,downloads' => 'content_readable', 'add,edit,delete' => 'content_creatable', ), ), From 24c22b3fa635ec16ccb01caca17a5b139a472f94 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 27 Apr 2022 10:04:44 +0900 Subject: [PATCH 35/42] =?UTF-8?q?test:=20github=20actions=E3=81=AE?= =?UTF-8?q?=E3=82=A8=E3=83=A9=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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: 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 +61,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 8d4c60da546904f23ed4ebd1ea6f7f0529ecbb05 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sun, 27 Nov 2022 14:52:58 +0900 Subject: [PATCH 36/42] fix: edit problem --- Controller/CircularNoticesController.php | 6 ++++++ Test/Case/Controller/CircularNoticesController/EditTest.php | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 176c647..42e0a3c 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -355,10 +355,16 @@ public function edit() { $key = $this->request->params['key']; $content = $this->CircularNoticeContent->getCircularNoticeContent($key, $userId); + // フレームから取得したCircularNoticeSetting.keyとコンテンツのcircularnotice_setting_keyが一致しない場合はBadRequest if (! $content) { return $this->throwBadRequest(); } + $settingKey = $this->viewVars['circularNoticeSetting']['CircularNoticeSetting']['key'] ?? null; + if ($content['CircularNoticeContent']['circular_notice_setting_key'] !== $settingKey) { + return $this->throwBadRequest(); + } + if ($this->CircularNoticeContent->canEditWorkflowContent($content) === false) { return $this->throwBadRequest(); } diff --git a/Test/Case/Controller/CircularNoticesController/EditTest.php b/Test/Case/Controller/CircularNoticesController/EditTest.php index 5c48253..0f52d19 100644 --- a/Test/Case/Controller/CircularNoticesController/EditTest.php +++ b/Test/Case/Controller/CircularNoticesController/EditTest.php @@ -93,6 +93,7 @@ public function dataProviderEdit() { $results[0] = array( 'urlOptions' => Hash::insert($data, 'frame_id', ''), 'assert' => null, + 'exception' => 'BadRequestException' ); $results[1] = array( 'urlOptions' => Hash::insert($data, 'key', 'A'), @@ -105,7 +106,8 @@ public function dataProviderEdit() { ); $results[3] = array( 'urlOptions' => Hash::insert($data, 'key', 'circular_notice_content_4'), - 'assert' => array('method' => 'assertNotEmpty'), + 'assert' => null, + 'exception' => 'BadRequestException' ); return $results; From eb801d15e9a4288c652e76b7117444cb2be6d462 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sun, 27 Nov 2022 16:28:44 +0900 Subject: [PATCH 37/42] =?UTF-8?q?comment:=20phpmd=E6=8A=91=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/CircularNoticesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Controller/CircularNoticesController.php b/Controller/CircularNoticesController.php index 42e0a3c..f7f9b8a 100644 --- a/Controller/CircularNoticesController.php +++ b/Controller/CircularNoticesController.php @@ -347,6 +347,7 @@ public function add() { * edit action * * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function edit() { $userId = Current::read('User.id'); @@ -355,11 +356,11 @@ public function edit() { $key = $this->request->params['key']; $content = $this->CircularNoticeContent->getCircularNoticeContent($key, $userId); - // フレームから取得したCircularNoticeSetting.keyとコンテンツのcircularnotice_setting_keyが一致しない場合はBadRequest if (! $content) { return $this->throwBadRequest(); } + // フレームから取得したCircularNoticeSetting.keyとコンテンツのcircular_notice_setting_keyが一致しない場合はBadRequest $settingKey = $this->viewVars['circularNoticeSetting']['CircularNoticeSetting']['key'] ?? null; if ($content['CircularNoticeContent']['circular_notice_setting_key'] !== $settingKey) { return $this->throwBadRequest(); From eb5b7e6ac0b32746632d45541c2868afbe410924 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 13:34:30 +0900 Subject: [PATCH 38/42] =?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 9501566..7cfa881 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 ab3efcbb49f09ba907f5c2f1b4a2e7d7b784f452 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 22:13:23 +0900 Subject: [PATCH 39/42] =?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 --- Test/Case/AllCircularNoticesTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Test/Case/AllCircularNoticesTest.php b/Test/Case/AllCircularNoticesTest.php index 2eb94dc..18e66eb 100644 --- a/Test/Case/AllCircularNoticesTest.php +++ b/Test/Case/AllCircularNoticesTest.php @@ -9,6 +9,8 @@ * @copyright Copyright 2014, NetCommons Project */ +App::uses('NetCommonsTestSuite', 'NetCommons.TestSuite'); + /** * CircularNotices All Test Case * @@ -25,7 +27,7 @@ class AllCircularNoticesTest extends CakeTestSuite { */ public static function suite() { $plugin = preg_replace('/^All([\w]+)Test$/', '$1', __CLASS__); - $suite = new CakeTestSuite(sprintf('All %s Plugin tests', $plugin)); + $suite = new NetCommonsTestSuite(sprintf('All %s Plugin tests', $plugin)); $suite->addTestDirectoryRecursive(CakePlugin::path($plugin) . 'Test' . DS . 'Case'); return $suite; } From 8df92999c436020754bb97c17d306d5b6004baac Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 25 Feb 2023 21:37:28 +0900 Subject: [PATCH 40/42] 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 f1b993bfe206ae583960368aaedf45a74b84bf6f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 17:17:03 +0900 Subject: [PATCH 41/42] =?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 | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..eb2068b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,10 +15,11 @@ 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 +29,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 +93,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 +147,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 +156,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 a8342737bea0b41e212975a2c6e156134acc7f08 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 15:53:53 +0900 Subject: [PATCH 42/42] 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