From 6cd0322090a05fbf48b4c7e86f8fe8a57b5a86b3 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 19 Jan 2023 10:16:42 +0900 Subject: [PATCH 01/19] =?UTF-8?q?fix:=20=E3=82=AB=E3=83=86=E3=82=B4?= =?UTF-8?q?=E3=83=AA=E5=88=A5=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=80=81=E3=82=AB?= =?UTF-8?q?=E3=83=86=E3=82=B4=E3=83=AA=E3=83=89=E3=83=AD=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=83=80=E3=82=A6=E3=83=B3=E3=82=92=E3=80=8C=E3=82=AB=E3=83=86?= =?UTF-8?q?=E3=82=B4=E3=83=AA=E9=81=B8=E6=8A=9E=E3=80=8D=E3=81=AE=E3=81=BE?= =?UTF-8?q?=E3=81=BE=E9=80=B1=E3=80=81=E6=97=A5=E8=A1=A8=E7=A4=BA=E3=82=92?= =?UTF-8?q?=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88=E3=81=9F=E3=82=8A=E3=80=81?= =?UTF-8?q?=E5=89=8D=E5=BE=8C=E3=81=AB=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E6=96=BD=E8=A8=AD=E3=81=8C=E3=80=8C?= =?UTF-8?q?=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E7=84=A1=E3=81=97=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E3=82=82=E3=81=AE=E3=81=AB=E3=81=AA=E3=82=8B=E4=B8=8D?= =?UTF-8?q?=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/ReservationsController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Controller/ReservationsController.php b/Controller/ReservationsController.php index bce74ec..3e06c4f 100644 --- a/Controller/ReservationsController.php +++ b/Controller/ReservationsController.php @@ -119,6 +119,11 @@ public function index() { } $categoryId = Hash::get($this->request->params['named'], 'category_id'); + if ($categoryId === '') { + // タブ切り替えや前後ページングで'カテゴリ選択'だとcategory_idが空文字になるので + // そのときはnull(カテゴリの指定無し)にする + $categoryId = null; + } $locations = $this->ReservationLocation->getLocations($categoryId); From ccc9b2a16c73eb4c78a926b4ac3a7405fab207d1 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Thu, 19 Jan 2023 11:48:05 +0900 Subject: [PATCH 02/19] =?UTF-8?q?fix:=20https://github.com/NetCommons3/Res?= =?UTF-8?q?ervations/commit/ad793ee66182d58c263784ba0860e69097b88fd5=20?= =?UTF-8?q?=E3=81=A7=E6=9C=AA=E6=89=BF=E8=AA=8D=E3=81=AE=E4=BA=88=E7=B4=84?= =?UTF-8?q?=E3=82=92=E6=89=BF=E8=AA=8D=E3=81=97=E3=81=9F=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E4=BA=88=E7=B4=84=E3=81=8C=E8=A6=8B=E3=81=88=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88=E3=81=8C?= =?UTF-8?q?=E7=99=BA=E7=94=9F=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=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/Behavior/ReservationPlanGenerationBehavior.php | 2 ++ Model/Behavior/ReservationUpdatePlanBehavior.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Model/Behavior/ReservationPlanGenerationBehavior.php b/Model/Behavior/ReservationPlanGenerationBehavior.php index 730a9eb..8d7a10b 100644 --- a/Model/Behavior/ReservationPlanGenerationBehavior.php +++ b/Model/Behavior/ReservationPlanGenerationBehavior.php @@ -249,6 +249,8 @@ private function __copyEventData(Model $model, $event, $reservationRruleId, $sta //セットするようにした。 $model->ReservationEvent->prepareLatestCreatedForIns($eventData, $createdUserWhenUpd); + // $eventDataがprepareLatestCreatedForIns()で変更されるので、再度setする + $model->ReservationEvent->set($eventData); //子もsave()で返ってくる。 $eventData = $model->ReservationEvent->save(null, false); //aaaaaaaaaaaaa if (!$eventData) { //保存のみ diff --git a/Model/Behavior/ReservationUpdatePlanBehavior.php b/Model/Behavior/ReservationUpdatePlanBehavior.php index 1abe057..d9e9b53 100644 --- a/Model/Behavior/ReservationUpdatePlanBehavior.php +++ b/Model/Behavior/ReservationUpdatePlanBehavior.php @@ -398,6 +398,8 @@ public function updateDtstartData(Model $model, $planParams, $rruleData, $eventD //is_active調整処理を行う。(eventDataの値が一部変更されます) $model->ReservationEvent->prepareActiveForUpd($eventData); + // $eventDataがprepareActiveForUpd()で変更されるので、再度setする + $model->ReservationEvent->set($eventData); if (!$model->ReservationEvent->save(null, array( 'validate' => false, From 1825ffb86363fb1086965de9a7c3bb749606f052 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 16:58:33 +0900 Subject: [PATCH 03/19] =?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 f2a3ae3dd5699f390f10a1a6febc37a8661acf6b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 05:04:02 +0900 Subject: [PATCH 04/19] 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 9c4badee8afd59e6106d8d16e17a8bd90e65cf2e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Sep 2023 16:40:03 +0900 Subject: [PATCH 05/19] =?UTF-8?q?fix:=20=E3=82=B3=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=A9=E3=81=AEpublic=E3=83=A1=E3=82=BD?= =?UTF-8?q?=E3=83=83=E3=83=89=E3=82=92protected=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/ReservationsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/ReservationsController.php b/Controller/ReservationsController.php index 3e06c4f..edb3dd0 100644 --- a/Controller/ReservationsController.php +++ b/Controller/ReservationsController.php @@ -237,7 +237,7 @@ protected function _getWeeklyVars($vars) { * @param array $vars カレンンダー情報 * @return array $vars 日単位(一覧)データ */ - public function getDailyListVars($vars) { + protected function _getDailyListVars($vars) { $this->setReservationCommonVars($vars); $vars['tab'] = 'list'; return $vars; @@ -266,7 +266,7 @@ protected function _getDailyVars($vars) { //if ($tab === 'timeline') { $vars = $this->_getDailyTimelineVars($vars); //} else { - // $vars = $this->getDailyListVars($vars); + // $vars = $this->_getDailyListVars($vars); //} $vars['selectRooms'] = array(); //マージ前の暫定 From 6db4ffd25d9a85bcd0e298dce1280fd1e40e1eec Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 25 Sep 2023 13:43:44 +0900 Subject: [PATCH 06/19] =?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 7cfa881..a4ab928 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.1', '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 ab05eacd7093dea00d28dc21a89aef15823bd394 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 25 Sep 2023 15:25:27 +0900 Subject: [PATCH 07/19] =?UTF-8?q?refactor:=20public=E3=83=A1=E3=82=BD?= =?UTF-8?q?=E3=83=83=E3=83=89=E3=81=AB=E3=81=99=E3=82=8B=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E3=81=8C=E3=81=AA=E3=81=84=E3=81=9F=E3=82=81private=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/ReservationPlansController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/ReservationPlansController.php b/Controller/ReservationPlansController.php index 5d54673..c42ab6e 100644 --- a/Controller/ReservationPlansController.php +++ b/Controller/ReservationPlansController.php @@ -153,7 +153,7 @@ public function beforeFilter() { ReservationPermissiveRooms::setRoomPermRoles($this->roomPermRoles); // 表示のための各種共通パラメータ設定 - $this->_vars = $this->getVarsForShow(); + $this->_vars = $this->__getVarsForShow(); } /** @@ -617,7 +617,7 @@ public function view() { * @return void * @throws InternalErrorException */ - public function getVarsForShow() { + private function __getVarsForShow() { $vars = array(); $this->setReservationCommonVars($vars); From 3054b951860fa0df1eddd97c049e6f6ca5132bb7 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 25 Sep 2023 23:32:00 +0900 Subject: [PATCH 08/19] =?UTF-8?q?fix:=20=E6=97=A5=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=EF=BC=88=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E3=83=BC=E5=88=A5?= =?UTF-8?q?=EF=BC=89=E3=81=AB=E3=81=97=E3=81=9F=E6=96=BD=E8=A8=AD=E4=BA=88?= =?UTF-8?q?=E7=B4=84=E3=82=92=E5=90=8C=E3=81=98=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AB2=E3=81=A4=E7=BD=AE=E3=81=8F=E3=81=A8=E3=80=81?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3=E9=96=8B?= =?UTF-8?q?=E5=A7=8B=E6=99=82=E5=88=BB=E3=82=92=E6=99=82=E5=88=BB=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E3=81=AB=E3=81=97=E3=81=A6=E3=82=82=E7=89=87=E6=96=B9?= =?UTF-8?q?=E3=81=8C0=E6=99=82=E3=81=8B=E3=82=89=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=83=90?= =?UTF-8?q?=E3=82=B0=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1710?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Reservations/all_weekly.ctp | 2 +- View/Reservations/daily_by_category.ctp | 29 ++++---- View/Reservations/weekly_by_location.ctp | 3 +- webroot/js/reservations.js | 85 +++++++++++++----------- webroot/js/reservations_timeline.js | 84 ++++++++++++----------- 5 files changed, 108 insertions(+), 95 deletions(-) diff --git a/View/Reservations/all_weekly.ctp b/View/Reservations/all_weekly.ctp index 600ac57..cdace31 100644 --- a/View/Reservations/all_weekly.ctp +++ b/View/Reservations/all_weekly.ctp @@ -25,7 +25,7 @@ echo $this->element('Reservations.scripts'); ReservationTurnReservation->getTurnReservationOperationsWrap('week', 'top', $vars); ?> -
+
全施設週表示 diff --git a/View/Reservations/daily_by_category.ctp b/View/Reservations/daily_by_category.ctp index e6f35f9..f88b9fc 100644 --- a/View/Reservations/daily_by_category.ctp +++ b/View/Reservations/daily_by_category.ctp @@ -15,28 +15,12 @@ echo $this->NetCommonsHtml->script(array( )); ?> - -
NetCommonsHtml->script(array( ?>
@@ -174,3 +159,15 @@ echo $this->NetCommonsHtml->script(array( + diff --git a/View/Reservations/weekly_by_location.ctp b/View/Reservations/weekly_by_location.ctp index 615b5ae..70876af 100644 --- a/View/Reservations/weekly_by_location.ctp +++ b/View/Reservations/weekly_by_location.ctp @@ -39,7 +39,8 @@ echo $this->element('Reservations.scripts'); $startTime = date('G', strtotime($userNow) - 60 * 60); } ?> -
+
diff --git a/webroot/js/reservations.js b/webroot/js/reservations.js index d595571..3d5aef5 100644 --- a/webroot/js/reservations.js +++ b/webroot/js/reservations.js @@ -139,46 +139,53 @@ NetCommonsApp.controller('ReservationSchedule', ['$scope', function($scope) { }]); NetCommonsApp.controller('ReservationsTimeline', ['$scope', function($scope) { - //タイムラインdiv - var coordinateOrigins = $('.reservation-vertical-timeline'); - - //指定時間のindex値を、タイムラインdivの属性から取り出し - var idx = $(coordinateOrigins[0]).attr('data-daily-start-time-idx') - 0; - - //00:00の行のtop 誤差をなくすため2300に変更 - //var row0 = $('.reservation-daily-timeline-0000'); - //var row0Top = row0[0].getBoundingClientRect().top; - - //01:00の行のtop - var row1 = $('.reservation-daily-timeline-0100'); - var row1Top = row1[0].getBoundingClientRect().top; - - //23:00の行のtop - var row23 = $('.reservation-daily-timeline-2300'); - var row23Top = row23[0].getBoundingClientRect().top; - - //1行(=1時間)の高さ - //var rowHeight = row1Top - row0Top; - var rowHeight = (row23Top - row1Top) / 22; - //指定時間が最初になるよう、divの縦スクロールを移動 - // coordinateOrigins[0].scrollTop = rowHeight * idx; - $('.reservation-vertical-timeline tbody').scrollTop(rowHeight * idx); - //$scope.origin = coordinateOrigins[0].scrollTop; - $scope.rowHeight = rowHeight; - - //0:00高さ固定 - $('.reservation-timeline-data-area').height(rowHeight); - - var row1Width = row1[0].getBoundingClientRect().width; - $scope.rowWidth = row1Width; - console.log('rowWitdh %d', row1Width); - - //初期化 - $scope.prevMargin = 0; - $scope.maxLineNum = 0; - $scope.Column = []; - $scope.Column[0] = []; + /** + * イニシャライズ処理 + * + * @param {string} frameId + * @return {void} + */ + $scope.initialize = function(frameId) { + //タイムラインdiv + var coordinateOrigins = $('#frame-' + frameId + ' .reservation-vertical-timeline'); + + //指定時間のindex値を、タイムラインdivの属性から取り出し + var idx = $(coordinateOrigins[0]).attr('data-daily-start-time-idx') - 0; + + //00:00の行のtop 誤差をなくすため2300に変更 + //var row0 = $('.reservation-daily-timeline-0000'); + //var row0Top = row0[0].getBoundingClientRect().top; + + //01:00の行のtop + var row1 = $('#frame-' + frameId + ' .reservation-daily-timeline-0100'); + var row1Top = row1[0].getBoundingClientRect().top; + //23:00の行のtop + var row23 = $('#frame-' + frameId + ' .reservation-daily-timeline-2300'); + var row23Top = row23[0].getBoundingClientRect().top; + + //1行(=1時間)の高さ + //var rowHeight = row1Top - row0Top; + var rowHeight = (row23Top - row1Top) / 22; + //指定時間が最初になるよう、divの縦スクロールを移動 + // coordinateOrigins[0].scrollTop = rowHeight * idx; + $('.reservation-vertical-timeline tbody').scrollTop(rowHeight * idx); + //$scope.origin = coordinateOrigins[0].scrollTop; + $scope.rowHeight = rowHeight; + + //0:00高さ固定 + $('#frame-' + frameId + ' .reservation-timeline-data-area').height(rowHeight); + + var row1Width = row1[0].getBoundingClientRect().width; + $scope.rowWidth = row1Width; + console.log('rowWitdh %d', row1Width); + + //初期化 + $scope.prevMargin = 0; + $scope.maxLineNum = 0; + $scope.Column = []; + $scope.Column[0] = []; + }; }]); NetCommonsApp.controller('ReservationsTimelinePlan', ['$scope', function($scope) { diff --git a/webroot/js/reservations_timeline.js b/webroot/js/reservations_timeline.js index 393430c..f1955bc 100644 --- a/webroot/js/reservations_timeline.js +++ b/webroot/js/reservations_timeline.js @@ -9,56 +9,64 @@ * */ NetCommonsApp.controller('ReservationsHorizonTimeline', ['$scope', function($scope) { - //タイムラインdiv - var coordinateOrigins = $('.reservation-horizon-timeline'); + /** + * イニシャライズ処理 + * + * @param {string} frameId + * @return {void} + */ + $scope.initialize = function(frameId) { + //タイムラインdiv + var coordinateOrigins = $('#frame-' + frameId + ' .reservation-horizon-timeline'); - //指定時間のindex値を、タイムラインdivの属性から取り出し - var idx = $(coordinateOrigins[0]).attr('data-daily-start-time-idx') - 0; + //指定時間のindex値を、タイムラインdivの属性から取り出し + var idx = $(coordinateOrigins[0]).attr('data-daily-start-time-idx') - 0; - //00:00の行のtop 誤差をなくすため2300に変更 - //var row0 = $('.reservation-daily-timeline-0000'); - //var row0Top = row0[0].getBoundingClientRect().top; + //00:00の行のtop 誤差をなくすため2300に変更 + //var row0 = $('.reservation-daily-timeline-0000'); + //var row0Top = row0[0].getBoundingClientRect().top; - //01:00の行のtop - var row1 = $('.reservation-daily-timeline-0100'); - var row1Top = row1[0].getBoundingClientRect().top; - var row1Left = row1[0].getBoundingClientRect().left; + //01:00の行のtop + var row1 = $('#frame-' + frameId + ' .reservation-daily-timeline-0100'); + var row1Top = row1[0].getBoundingClientRect().top; + var row1Left = row1[0].getBoundingClientRect().left; - //23:00の行のtop - var row23 = $('.reservation-daily-timeline-2300'); - var row23Top = row23[0].getBoundingClientRect().top; - var row23Left = row23[0].getBoundingClientRect().left; + //23:00の行のtop + var row23 = $('#frame-' + frameId + ' .reservation-daily-timeline-2300'); + var row23Top = row23[0].getBoundingClientRect().top; + var row23Left = row23[0].getBoundingClientRect().left; - //1列(1時間)の幅 - var rowWidth = (row23Left - row1Left) / 22; + //1列(1時間)の幅 + var rowWidth = (row23Left - row1Left) / 22; - ////1行(=1時間)の高さ - ////var rowHeight = row1Top - row0Top; - //var rowHeight = (row23Top - row1Top) / 22; + ////1行(=1時間)の高さ + ////var rowHeight = row1Top - row0Top; + //var rowHeight = (row23Top - row1Top) / 22; - //指定時間が最初になるよう、divの横スクロールを移動 - coordinateOrigins[0].scrollLeft = rowWidth * idx; + //指定時間が最初になるよう、divの横スクロールを移動 + coordinateOrigins[0].scrollLeft = rowWidth * idx; - ////指定時間が最初になるよう、divの縦スクロールを移動 - //coordinateOrigins[0].scrollTop = rowHeight * idx; + ////指定時間が最初になるよう、divの縦スクロールを移動 + //coordinateOrigins[0].scrollTop = rowHeight * idx; - //$scope.origin = coordinateOrigins[0].scrollTop; - //$scope.rowHeight = rowHeight; - $scope.rowWidth = rowWidth; + //$scope.origin = coordinateOrigins[0].scrollTop; + //$scope.rowHeight = rowHeight; + $scope.rowWidth = rowWidth; - //0:00幅固定 - $('.reservation-timeline-data-area').width(rowWidth); - ////0:00高さ固定 - //$('.reservation-timeline-data-area').height(rowHeight); + //0:00幅固定 + $('#frame-' + frameId + ' .reservation-timeline-data-area').width(rowWidth); + ////0:00高さ固定 + //$('.reservation-timeline-data-area').height(rowHeight); - var row1Top = row1[0].getBoundingClientRect().top; - $scope.rowTop = row1Top; + var row1Top = row1[0].getBoundingClientRect().top; + $scope.rowTop = row1Top; - //初期化 - $scope.prevMargin = 0; - $scope.maxLineNum = 0; - $scope.Column = []; - $scope.Column[0] = []; + //初期化 + $scope.prevMargin = 0; + $scope.maxLineNum = 0; + $scope.Column = []; + $scope.Column[0] = []; + }; }]); From f3a3874426cce2a23d43f58feecffba9cce80d98 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 26 Sep 2023 21:56:57 +0900 Subject: [PATCH 09/19] =?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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a4ab928..eb2068b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,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 +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 @@ -160,8 +161,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 82ddc29e62ea05483194ff44f27cb285751fc607 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 26 Sep 2023 22:01:12 +0900 Subject: [PATCH 10/19] =?UTF-8?q?change:=20=E6=96=BD=E8=A8=AD=E4=BA=88?= =?UTF-8?q?=E7=B4=84=E3=81=A7=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE=E6=96=BD?= =?UTF-8?q?=E8=A8=AD=E3=81=AB=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E3=82=92?= =?UTF-8?q?=E5=89=B2=E3=82=8A=E5=BD=93=E3=81=A6=E3=81=9F=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E3=81=AB=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=81=BF=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=81=8B=E3=82=89=E3=80=8C=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E7=84=A1=E3=81=97=E3=80=8D=E3=81=AE=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E8=82=A2=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=95=E3=81=9B=E3=81=AA?= =?UTF-8?q?=E3=81=84=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?711?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reservations/dropdown_category.ctp | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/View/Elements/Reservations/dropdown_category.ctp b/View/Elements/Reservations/dropdown_category.ctp index e507de6..29ca4b7 100644 --- a/View/Elements/Reservations/dropdown_category.ctp +++ b/View/Elements/Reservations/dropdown_category.ctp @@ -13,6 +13,14 @@ // '' => 'カテゴリ選択' // '0' => カテゴリ無し //  となるように事前準備 +$unselectedCategory = false; +foreach ($locations as $location) { + if (empty($location['ReservationLocation']['category_id'])) { + $unselectedCategory = true; + break; + } +} + $categories = $this->get('categories'); array_unshift($categories, [ @@ -23,15 +31,28 @@ array_unshift($categories, 'name' => __d('categories', 'Select Category') ] ], - [ - 'Category' => [ - 'id' => '0', +); +if ($unselectedCategory) { + array_unshift($categories, + [ + 'Category' => [ + 'id' => null, + ], + 'CategoriesLanguage' => [ + 'name' => __d('categories', 'Select Category') + ] ], - 'CategoriesLanguage' => [ - 'name' => __d('reservations', 'no category') + [ + 'Category' => [ + 'id' => '0', + ], + 'CategoriesLanguage' => [ + 'name' => __d('reservations', 'no category') + ] ] - ] ); +} + $this->set('categories', $categories); // CategoryHelper用にムリヤリcategory_id=""をセット if (!isset($this->request->params['named']['category_id'])) { @@ -55,4 +76,4 @@ echo $this->Category->dropDownToggle(array( // ムリヤリnamedを書き換えたので元にもどす if (isset($isOverwrite)) { unset($this->request->params['named']['category_id']); -} \ No newline at end of file +} From d2586d3d707a4568a0774824566bcd79b8f3359f Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 29 Sep 2023 08:58:38 +0900 Subject: [PATCH 11/19] =?UTF-8?q?fix:=20=E4=BA=88=E7=B4=84=E3=81=AE?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=81=8C=E3=80=81=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E3=81=95=E3=82=8C=E3=81=9A=E3=81=AB=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=80=81=E5=88=A5=E3=81=AE=E6=97=A5=E3=81=AE=E4=BA=88=E7=B4=84?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E8=A1=A8=E7=A4=BA=E3=81=97=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=A8=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=9F?= =?UTF-8?q?=E3=82=81=E6=AD=A3=E3=81=97=E3=81=8F=E8=A1=A8=E7=A4=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=80=82=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?714?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Elements/Reservations/weekly_timeline_element.ctp | 1 + View/Helper/ReservationWeeklyTimelineHelper.php | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/View/Elements/Reservations/weekly_timeline_element.ctp b/View/Elements/Reservations/weekly_timeline_element.ctp index aedf192..c5e8bd8 100644 --- a/View/Elements/Reservations/weekly_timeline_element.ctp +++ b/View/Elements/Reservations/weekly_timeline_element.ctp @@ -98,6 +98,7 @@
ReservationWeeklyTimeline->clearTimelineData(); echo $this->ReservationWeeklyTimeline->makeDailyBodyHtml($currentDayVars); $reservationPlans = $this->ReservationWeeklyTimeline->getTimelineData(); ?> diff --git a/View/Helper/ReservationWeeklyTimelineHelper.php b/View/Helper/ReservationWeeklyTimelineHelper.php index 1b877ab..7319de0 100644 --- a/View/Helper/ReservationWeeklyTimelineHelper.php +++ b/View/Helper/ReservationWeeklyTimelineHelper.php @@ -47,6 +47,15 @@ public function getTimelineData() { return $this->_timelineData; } +/** + * TimelineDataをクリア + * + * @return array + */ + public function clearTimelineData() { + $this->_timelineData = []; + } + /** * getPlanSummariesHtml * From c4b9bfbc074e3fc6e8619fe907a78dfa430212c0 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 22:44:17 +0900 Subject: [PATCH 12/19] =?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 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb2068b..6da4321 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 From 92d5252c81a90f742b6c5498da2a8bb3d70bc4cd Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 22:21:25 +0900 Subject: [PATCH 13/19] 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 b93565e5015e52a72bec18b1f8ed6592552ee8c5 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Oct 2023 10:46:26 +0900 Subject: [PATCH 14/19] =?UTF-8?q?fix:=20=E3=82=AB=E3=83=86=E3=82=B4?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E6=96=BD=E8=A8=AD=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AB=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E3=82=92=E9=81=B8=E6=8A=9E=E3=81=99=E3=82=8B=E3=81=A8?= =?UTF-8?q?=E3=80=8C=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E3=83=BC=E7=84=A1?= =?UTF-8?q?=E3=81=97=E3=80=8D=E3=81=AE=E9=81=B8=E6=8A=9E=E8=82=A2=E3=81=8C?= =?UTF-8?q?=E6=B6=88=E3=81=88=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=81=9F?= =?UTF-8?q?=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Ne?= =?UTF-8?q?tCommons3/issues/1711?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/ReservationsController.php | 1 + Model/ReservationLocation.php | 13 +++++++++++++ View/Elements/Reservations/dropdown_category.ctp | 9 ++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Controller/ReservationsController.php b/Controller/ReservationsController.php index edb3dd0..b06c2e5 100644 --- a/Controller/ReservationsController.php +++ b/Controller/ReservationsController.php @@ -168,6 +168,7 @@ public function index() { $frameId = Current::read('Frame.id'); $languageId = Current::read('Language.id'); $this->set(compact('frameId', 'languageId', 'vars')); + $this->set('unselectedCategory', $this->ReservationLocation->getCountUnselectedCategory()); $this->render($ctpName); //$roomId = Current::read('Room.id'); diff --git a/Model/ReservationLocation.php b/Model/ReservationLocation.php index 180b309..9d3a556 100644 --- a/Model/ReservationLocation.php +++ b/Model/ReservationLocation.php @@ -662,6 +662,19 @@ protected function _prepareData($data) { return $data; } +/** + * カテゴリーをセットしていない施設件数を取得する + * + * @return int + */ + public function getCountUnselectedCategory() { + $count = $this->find('count', [ + 'conditions' => ['category_id' => null], + ]); + + return $count; + } + /** * getAliveCondition * 現在使用中状態であるか判断する。CleanUpプラグインで使用 diff --git a/View/Elements/Reservations/dropdown_category.ctp b/View/Elements/Reservations/dropdown_category.ctp index 29ca4b7..d34a899 100644 --- a/View/Elements/Reservations/dropdown_category.ctp +++ b/View/Elements/Reservations/dropdown_category.ctp @@ -13,14 +13,9 @@ // '' => 'カテゴリ選択' // '0' => カテゴリ無し //  となるように事前準備 -$unselectedCategory = false; -foreach ($locations as $location) { - if (empty($location['ReservationLocation']['category_id'])) { - $unselectedCategory = true; - break; - } +if (! isset($unselectedCategory)) { + $unselectedCategory = true; } - $categories = $this->get('categories'); array_unshift($categories, [ From bfc241745fbd37cfe2532f043d6e46194d56712b Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 14 May 2024 14:17:33 +0900 Subject: [PATCH 15/19] =?UTF-8?q?fix:=20=E4=B8=8B=E8=A8=98=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6Warning?= =?UTF-8?q?=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=9F=E3=82=81?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Workflow/co?= =?UTF-8?q?mmit/177185656236f79b24c5588c9f17dccff3e62b5f?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/ReservationWorkflowBehavior.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Model/Behavior/ReservationWorkflowBehavior.php b/Model/Behavior/ReservationWorkflowBehavior.php index e67df2d..deea619 100644 --- a/Model/Behavior/ReservationWorkflowBehavior.php +++ b/Model/Behavior/ReservationWorkflowBehavior.php @@ -33,9 +33,16 @@ public function beforeValidate(Model $model, $options = array()) { * * @param Model $model Model using this behavior * @param array $conditions Model::find conditions default value + * @param bool $useCommentCreatable コメントの作成権限でもチェックするかどうか * @return array Conditions data + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ - public function getWorkflowConditions(Model $model, $conditions = array()) { + public function getWorkflowConditions( + Model $model, + $conditions = array(), + $useCommentCreatable = false + ) { // is_active = 1は常に表示 $activeConditions = [ $model->alias . '.is_active' => true, From 4fda413614929df6e4dda39b760a79515f98a667 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 5 Jun 2024 10:06:43 +0900 Subject: [PATCH 16/19] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=BC=8F?= =?UTF-8?q?=E3=82=8C=20https://github.com/NetCommons3/Reservations/commit/?= =?UTF-8?q?062e458afe2f6c22f04f2a6b605e237fd0fad8b4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/ReservationWorkflowBehavior.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Model/Behavior/ReservationWorkflowBehavior.php b/Model/Behavior/ReservationWorkflowBehavior.php index deea619..9a15ea1 100644 --- a/Model/Behavior/ReservationWorkflowBehavior.php +++ b/Model/Behavior/ReservationWorkflowBehavior.php @@ -95,14 +95,21 @@ public function getWorkflowConditions( * @param Model $model Model using this behavior * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) + * @param bool $useCommentCreatable コメントの作成権限でもチェックするかどうか * @return array Conditions data + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ - public function getWorkflowContents(Model $model, $type, $query = array()) { + public function getWorkflowContents( + Model $model, + $type, + $query = array(), + $useCommentCreatable = false + ) { //$this->log(var_export(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5), true), 'debug'); $query = Hash::merge(array( 'recursive' => -1, - 'conditions' => $this->getWorkflowConditions($model) + 'conditions' => $this->getWorkflowConditions($model, [], $useCommentCreatable) ), $query); return $model->find($type, $query); From 04e4c6884a10ba0f6da5c7ae783527e50b3d4d45 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 11 Jun 2024 22:20:22 +0900 Subject: [PATCH 17/19] =?UTF-8?q?fix:=20=E7=B9=B0=E3=82=8A=E8=BF=94?= =?UTF-8?q?=E3=81=97=E3=81=AE=E4=BA=88=E7=B4=84=E3=82=92=E3=80=8C=E3=81=93?= =?UTF-8?q?=E3=81=AE=E4=BA=88=E7=B4=84=E3=81=AE=E3=81=BF=E3=80=8D=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81=E5=90=8C?= =?UTF-8?q?=E3=81=98=E4=BA=88=E7=B4=84=E3=81=8C2=E9=87=8D=E3=81=AB?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B=E3=83=90=E3=82=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20*=20=E7=B9=B0=E3=82=8A=E8=BF=94=E3=81=97?= =?UTF-8?q?=E3=81=AE=E4=BA=88=E7=B4=84=E7=B7=A8=E9=9B=86=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=80=81=E3=80=8C=E3=81=93=E3=81=AE=E4=BA=88=E7=B4=84=E3=81=AE?= =?UTF-8?q?=E3=81=BF=E3=80=8D=E3=81=8B=E3=82=89=E5=88=87=E3=82=8A=E6=9B=BF?= =?UTF-8?q?=E3=81=88=E3=82=8B=E3=81=A8=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=8C?= =?UTF-8?q?Disable=E3=81=AB=E3=81=AA=E3=82=8B=E3=83=90=E3=82=B0=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=81=20*=20=E3=80=8C=E8=A8=AD=E5=AE=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F=E5=85=A8=E3=81=A6=E3=81=AE=E4=BA=88=E7=B4=84=E3=80=8D?= =?UTF-8?q?=E3=81=A7=E4=BA=88=E7=B4=84=E3=82=92=E7=B7=A8=E9=9B=86=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=82=8B=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?721?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReservationPlanGenerationBehavior.php | 25 ++++++++++++++++--- Model/ReservationActionPlan.php | 11 +++++--- .../ReservationPlanEditRepeatOptionHelper.php | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Model/Behavior/ReservationPlanGenerationBehavior.php b/Model/Behavior/ReservationPlanGenerationBehavior.php index 8d7a10b..2b08ed8 100644 --- a/Model/Behavior/ReservationPlanGenerationBehavior.php +++ b/Model/Behavior/ReservationPlanGenerationBehavior.php @@ -69,18 +69,22 @@ public function makeCurGenPlan(Model $model, $data, * @param string $status status 変更時の施設予約独自の新status * @param int $createdUserWhenUpd createdUserWhenUpd * @param bool $isMyPrivateRoom isMyPrivateRoom + * @param string|int $editRrule 編集ルール(この予約のみ、これ以降に指定した全ての予約、設定した全ての予約) * @return int 生成成功時 新しく生成した次世代予定($plan)を返す。失敗時 InternalErrorExceptionを投げる。 * @throws InternalErrorException + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function makeNewGenPlan(Model $model, $data, $status, - $createdUserWhenUpd, $isMyPrivateRoom) { + $createdUserWhenUpd, $isMyPrivateRoom, $editRrule) { $action = 'update'; $plan = $this->__makeCommonGenPlan($model, $action, $data, $data['ReservationActionPlan']['origin_rrule_id']); //keyが同じrrule -> key同一のevents -> eventsの各子供をcopy保存する - $plan = $this->__copyRruleData($model, $plan, $createdUserWhenUpd); + $plan = $this->__copyRruleData($model, $plan, $createdUserWhenUpd, $editRrule); + + $baseDate = str_replace('-', '', $data['ReservationActionPlanForDisp']['detail_start_datetime']); unset($plan['new_event_id']); //念のため変数クリア $effectiveEvents = array(); //有効なeventだけを格納する配列を用意 @@ -90,6 +94,17 @@ public function makeNewGenPlan(Model $model, $data, $status, if ($event['exception_event_id'] >= 1) { continue; } + if ($editRrule == self::CALENDAR_PLAN_EDIT_THIS && + $data['ReservationActionPlan']['origin_event_id'] != $event['id']) { + //この予約のみの場合、自分自身の予約以外は無視する。 + continue; + } + if ($editRrule == self::CALENDAR_PLAN_EDIT_AFTER && + $data['ReservationActionPlan']['origin_event_id'] != $event['id'] && + $baseDate > $event['start_date']) { + //これ以降に指定した全ての予約の場合、基準日より過去のものは無視する。 + continue; + } $newEventId = $newEventKey = null; list($event, $newEventId, $newEventKey) = $this->__copyEventData($model, @@ -123,10 +138,11 @@ public function makeNewGenPlan(Model $model, $data, $status, * @param Model $model 実際のモデル名 * @param array $plan plan * @param int $createdUserWhenUpd createdUserWhenUpd + * @param string|int $editRrule 編集ルール(この予約のみ、これ以降に指定した全ての予約、設定した全ての予約) * @return int 生成成功時 新しい$planを返す。失敗時 InternalErrorExceptionを投げる。 * @throws InternalErrorException */ - private function __copyRruleData(Model $model, $plan, $createdUserWhenUpd) { + private function __copyRruleData(Model $model, $plan, $createdUserWhenUpd, $editRrule) { //ReservationRruleには、status, is_latest, is_activeはない。 $rruleData = array(); @@ -135,6 +151,9 @@ private function __copyRruleData(Model $model, $plan, $createdUserWhenUpd) { //次世代データの新規登録 $originRruleId = $rruleData['ReservationRrule']['id']; $rruleData['ReservationRrule']['id'] = null; + if ($editRrule == self::CALENDAR_PLAN_EDIT_THIS) { + $rruleData['ReservationRrule']['rrule'] = ''; + } //作成者・作成日は原則、元予定のデータを引き継ぐ、、、が!例外がある。 //例外追加1) diff --git a/Model/ReservationActionPlan.php b/Model/ReservationActionPlan.php index 2dc8c52..72e05cc 100644 --- a/Model/ReservationActionPlan.php +++ b/Model/ReservationActionPlan.php @@ -574,7 +574,7 @@ public function validteNotExistReservation($check) { // 全ての予約を更新 $ignoreConditions = [ 'NOT' => [ - 'ReservationEvent.rrule_id' => + 'ReservationEvent.reservation_rrule_id' => Hash::get($this->data, 'ReservationActionPlan.origin_rrule_id'), 'ReservationEvent.recurrence_event_id !=' => 0, 'ReservationEvent.exception_event_id !=' => 0, @@ -910,9 +910,14 @@ public function saveReservationPlan($data, $procMode, //3. isMyPrivateRoomは、変更後の公開ルームidが「編集者・承認者(=ログイン者)のプライベート」以外の場合、 //仲間の予定はプライベートの時のみ許される子情報なので、これらはcopy対象から外す(stripする)例外処理用。 // - $newPlan = $this->makeNewGenPlan($data, $status, $createdUserWhenUpd, $isMyPrivateRoom); - $editRrule = $this->getEditRruleForUpdate($data); + $newPlan = $this->makeNewGenPlan( + $data, + $status, + $createdUserWhenUpd, + $isMyPrivateRoom, + $editRrule + ); $isInfoArray = array($isOriginRepeat, $isTimeMod, $isRepeatMod, $isMyPrivateRoom); $eventId = $this->updatePlan($planParam, $newPlan, $status, $isInfoArray, $editRrule, diff --git a/View/Helper/ReservationPlanEditRepeatOptionHelper.php b/View/Helper/ReservationPlanEditRepeatOptionHelper.php index 1f5f1e9..18c4f56 100644 --- a/View/Helper/ReservationPlanEditRepeatOptionHelper.php +++ b/View/Helper/ReservationPlanEditRepeatOptionHelper.php @@ -106,7 +106,7 @@ public function makeEditRepeatOption( 'ng-model' => 'editRrule', 'ng-init' => "editRrule = '" . $editRrule . "'", 'ng-change' => "changeEditRrule(" . Current::read('Frame.id') . ",'" . $firstSibEditLink . "')", - 'ng-click' => 'sending=true', + //'ng-click' => 'sending=true', )); if (! $isRecurrence) { $html .= '

'; From 0f593ee3818ea3a2937956a3497db118ef4be88e Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 13 Jun 2024 09:44:44 +0900 Subject: [PATCH 18/19] =?UTF-8?q?fix:=20=E7=B9=B0=E3=82=8A=E8=BF=94?= =?UTF-8?q?=E3=81=97=E3=81=AE=E4=BA=88=E7=B4=84=E3=82=92=E3=80=8C=E3=81=93?= =?UTF-8?q?=E3=81=AE=E4=BA=88=E7=B4=84=E3=81=AE=E3=81=BF=E3=80=8D=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B=E3=81=A8=E3=80=81=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E5=89=8D=E3=81=AE=E7=B9=B0=E3=82=8A=E8=BF=94=E3=81=97?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E3=81=A7=E3=83=90=E3=83=AA=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=8C=E5=AE=9F=E8=A1=8C=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=81=9F=E3=82=81?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20https://github.com/NetCommons3/Reservation?= =?UTF-8?q?s/commit/04e4c6884a10ba0f6da5c7ae783527e50b3d4d45=20https://git?= =?UTF-8?q?hub.com/NetCommons3/NetCommons3/issues/1721?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/ReservationPlansController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Controller/ReservationPlansController.php b/Controller/ReservationPlansController.php index c42ab6e..7ec0684 100644 --- a/Controller/ReservationPlansController.php +++ b/Controller/ReservationPlansController.php @@ -330,6 +330,10 @@ public function add() { */ public function edit() { if ($this->request->is('post')) { + $editRrule = $this->ReservationActionPlan->getEditRruleForUpdate($this->request->data); + if ($editRrule == ReservationAppBehavior::CALENDAR_PLAN_EDIT_THIS) { + $this->request->data['ReservationActionPlan']['is_repeat'] = '0'; + } $this->_reservationPost(); } // 表示のための処理 From 186cae5dbdcfe896a282cebc667b49a5f65f26d3 Mon Sep 17 00:00:00 2001 From: tjs-mochizuki Date: Tue, 18 Jun 2024 16:43:41 +0900 Subject: [PATCH 19/19] =?UTF-8?q?=E3=83=AC=E3=82=B9=E3=83=9D=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E9=81=85=E5=BB=B6=E3=81=AE=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReservationFrameSettingsController.php | 5 ++++ Controller/ReservationImportController.php | 5 ++++ Controller/ReservationLocationsController.php | 10 +++++++ Controller/ReservationPlansController.php | 10 +++++++ Lib/ReservationLocationOpenText.php | 18 +++++++++++++ Model/ReservationLocation.php | 26 ------------------- 6 files changed, 48 insertions(+), 26 deletions(-) diff --git a/Controller/ReservationFrameSettingsController.php b/Controller/ReservationFrameSettingsController.php index 1bcac62..f9441ac 100644 --- a/Controller/ReservationFrameSettingsController.php +++ b/Controller/ReservationFrameSettingsController.php @@ -120,6 +120,11 @@ public function edit() { $this->view = 'nolocation'; return; } + + // openTextの追加 + $openText = new ReservationLocationOpenText(); + $locations = $openText->openTextAdd($locations); + $this->set('locations', $locations); // 設定情報取り出し diff --git a/Controller/ReservationImportController.php b/Controller/ReservationImportController.php index b1fd4f8..07b6078 100644 --- a/Controller/ReservationImportController.php +++ b/Controller/ReservationImportController.php @@ -131,6 +131,11 @@ public function beforeFilter() { public function edit() { // 施設情報 $locations = $this->ReservationLocation->getReservableLocations(); + + // openTextの追加 + $openText = new ReservationLocationOpenText(); + $locations = $openText->openTextAdd($locations); + $this->set('locations', $locations); $frameId = Current::read('Frame.id'); diff --git a/Controller/ReservationLocationsController.php b/Controller/ReservationLocationsController.php index dddb01a..029081d 100644 --- a/Controller/ReservationLocationsController.php +++ b/Controller/ReservationLocationsController.php @@ -94,6 +94,11 @@ public function index() { 'ReservationLocation' => $query ]; $reservationLocations = $this->Paginator->paginate('ReservationLocation'); + + // openTextの追加 + $openText = new ReservationLocationOpenText(); + $reservationLocations = $openText->openTextAdd($reservationLocations); + $this->set('reservationLocations', $reservationLocations); } @@ -377,6 +382,11 @@ public function sort() { 'ReservationLocation' => $query ]; $reservationLocations = $this->Paginator->paginate('ReservationLocation'); + + // openTextの追加 + $openText = new ReservationLocationOpenText(); + $reservationLocations = $openText->openTextAdd($reservationLocations); + $this->set('reservationLocations', $reservationLocations); $this->request->data['ReservationLocations'] = $reservationLocations; diff --git a/Controller/ReservationPlansController.php b/Controller/ReservationPlansController.php index 7ec0684..3922f10 100644 --- a/Controller/ReservationPlansController.php +++ b/Controller/ReservationPlansController.php @@ -288,6 +288,11 @@ public function delete() { public function add() { // 施設情報 $locations = $this->ReservationLocation->getReservableLocations(); + + // openTextの追加 + $openText = new ReservationLocationOpenText(); + $locations = $openText->openTextAdd($locations); + $locations = $this->__mergeApprovalUserName($locations); $this->set('locations', $locations); @@ -347,6 +352,11 @@ public function edit() { // 施設情報 $locations = $this->ReservationLocation->getReservableLocations(); + + // openTextの追加 + $openText = new ReservationLocationOpenText(); + $locations = $openText->openTextAdd($locations); + $locations = $this->__mergeApprovalUserName($locations); $this->set('locations', $locations); diff --git a/Lib/ReservationLocationOpenText.php b/Lib/ReservationLocationOpenText.php index 63b0535..845e531 100644 --- a/Lib/ReservationLocationOpenText.php +++ b/Lib/ReservationLocationOpenText.php @@ -78,4 +78,22 @@ public function openText($reservationLocation) { } return $ret; } + +/** + * openTextをセットした施設データを返す + * + * @param array $reservationLocations 施設データ + * @return array + */ + public function openTextAdd($reservationLocations) { + foreach ($reservationLocations as $key => $value) { + if (array_key_exists('time_table', $value['ReservationLocation']) && + array_key_exists('start_time', $value['ReservationLocation']) && + array_key_exists('end_time', $value['ReservationLocation']) && + array_key_exists('timezone', $value['ReservationLocation'])) { + $reservationLocations[$key]['ReservationLocation']['openText'] = $this->openText($value); + } + } + return $reservationLocations; + } } \ No newline at end of file diff --git a/Model/ReservationLocation.php b/Model/ReservationLocation.php index 9d3a556..9866a4e 100644 --- a/Model/ReservationLocation.php +++ b/Model/ReservationLocation.php @@ -188,32 +188,6 @@ public function beforeFind($query) { return true; } -/** - * Called after each find operation. Can be used to modify any results returned by find(). - * Return value should be the (modified) results. - * - * @param mixed $results The results of the find operation - * @param bool $primary Whether this model is being queried directly (vs. being queried as an association) - * @return mixed Result of the find operation - * @SuppressWarnings(PHPMD.BooleanArgumentFlag) - * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#afterfind - */ - public function afterFind($results, $primary = false) { - if (!isset($results[0][$this->alias])) { - return $results; - } - foreach ($results as $key => $value) { - if (array_key_exists('time_table', $results[$key][$this->alias]) && - array_key_exists('start_time', $results[$key][$this->alias]) && - array_key_exists('end_time', $results[$key][$this->alias]) && - array_key_exists('timezone', $results[$key][$this->alias])) { - $openText = new ReservationLocationOpenText(); - $results[$key][$this->alias]['openText'] = $openText->openText($value); - } - } - return $results; - } - /** * Called before each save operation, after validation. Return a non-true result * to halt the save.