diff --git a/Controller/TaskContentEditController.php b/Controller/TaskContentEditController.php index 07b16bf..f357dfb 100644 --- a/Controller/TaskContentEditController.php +++ b/Controller/TaskContentEditController.php @@ -148,6 +148,9 @@ public function edit() { $this->set('listTitle', $this->_taskTitle); $key = $this->params['key']; $taskContent = $this->TaskContent->getTask($key); + if (empty($taskContent)) { + return $this->throwBadRequest(); + } $calendarKey = $taskContent['TaskContent']['calendar_key']; //ADD カレンダ連携キーの取り出し $taskContent['TaskContent']['use_calendar'] = ($calendarKey == "") ? 0 : 1; @@ -158,10 +161,6 @@ public function edit() { // ToDo担当者ユーザー保持 $this->request->data = $this->TaskCharge->getSelectUsers($this->request->data, false); - if (empty($taskContent)) { - return $this->throwBadRequest(); - } - if ($this->TaskContent->canEditWorkflowContent($taskContent) === false) { return $this->throwBadRequest(); } diff --git a/Test/Case/Controller/TaskContentEditController/BeforeFilterTest.php b/Test/Case/Controller/TaskContentEditController/BeforeFilterTest.php index 05ca1b1..87ffeb7 100644 --- a/Test/Case/Controller/TaskContentEditController/BeforeFilterTest.php +++ b/Test/Case/Controller/TaskContentEditController/BeforeFilterTest.php @@ -84,7 +84,7 @@ public function testBeforeFilterGet() { //テスト実行 $this->_testGetAction( array( - 'action' => 'edit', 'block_id' => $blockId + 'action' => 'edit', 'block_id' => $blockId, 'key' => 'content_key_9' ), array( 'method' => 'assertEmpty' diff --git a/Test/Case/Controller/TaskContentEditController/EditTest.php b/Test/Case/Controller/TaskContentEditController/EditTest.php index 3472334..e7b0933 100644 --- a/Test/Case/Controller/TaskContentEditController/EditTest.php +++ b/Test/Case/Controller/TaskContentEditController/EditTest.php @@ -25,6 +25,14 @@ class TaskContentEditControllerEditTest extends WorkflowControllerEditTest { * @var array */ public $fixtures = array( + 'plugin.tasks.calendar_for_task', + 'plugin.tasks.calendar_event_for_task', + 'plugin.tasks.calendar_frame_setting_for_task', + 'plugin.tasks.calendar_frame_setting_select_room_for_task', + 'plugin.tasks.calendar_rrule_for_task', + 'plugin.tasks.calendar_event_share_user_for_task', + 'plugin.tasks.calendar_event_content_for_task', + 'plugin.rooms.room_role', 'plugin.categories.category', 'plugin.categories.category_order', 'plugin.categories.categories_language', @@ -32,6 +40,7 @@ class TaskContentEditControllerEditTest extends WorkflowControllerEditTest { 'plugin.tasks.task_charge', 'plugin.tasks.task_content', 'plugin.tasks.block_setting_for_task', + 'plugin.tasks.rooms_language_for_task', 'plugin.workflow.workflow_comment', ); diff --git a/Test/Case/Controller/TaskContentsController/ViewTest.php b/Test/Case/Controller/TaskContentsController/ViewTest.php index 736a6ba..0e787c5 100644 --- a/Test/Case/Controller/TaskContentsController/ViewTest.php +++ b/Test/Case/Controller/TaskContentsController/ViewTest.php @@ -25,6 +25,14 @@ class TaskContentsControllerViewTest extends WorkflowControllerViewTest { * @var array */ public $fixtures = array( + 'plugin.tasks.calendar_for_task', + 'plugin.tasks.calendar_event_for_task', + 'plugin.tasks.calendar_frame_setting_for_task', + 'plugin.tasks.calendar_frame_setting_select_room_for_task', + 'plugin.tasks.calendar_rrule_for_task', + 'plugin.tasks.calendar_event_share_user_for_task', + 'plugin.tasks.calendar_event_content_for_task', + 'plugin.rooms.room_role', 'plugin.categories.category', 'plugin.categories.category_order', 'plugin.categories.categories_language', @@ -32,6 +40,7 @@ class TaskContentsControllerViewTest extends WorkflowControllerViewTest { 'plugin.tasks.task_charge', 'plugin.tasks.task_content', 'plugin.tasks.block_setting_for_task', + 'plugin.tasks.rooms_language_for_task', 'plugin.workflow.workflow_comment', 'plugin.content_comments.content_comment', ); diff --git a/Test/Case/Model/TaskContent/DeleteContentByKeyTest.php b/Test/Case/Model/TaskContent/DeleteContentByKeyTest.php index 4dd1e2c..ecb55dd 100644 --- a/Test/Case/Model/TaskContent/DeleteContentByKeyTest.php +++ b/Test/Case/Model/TaskContent/DeleteContentByKeyTest.php @@ -28,6 +28,14 @@ class TaskContentDeleteContentByKeyTest extends NetCommonsModelTestCase { * @var array */ public $fixtures = array( + 'plugin.tasks.calendar_for_task', + 'plugin.tasks.calendar_event_for_task', + 'plugin.tasks.calendar_frame_setting_for_task', + 'plugin.tasks.calendar_frame_setting_select_room_for_task', + 'plugin.tasks.calendar_rrule_for_task', + 'plugin.tasks.calendar_event_share_user_for_task', + 'plugin.tasks.calendar_event_content_for_task', + 'plugin.rooms.room_role', 'plugin.categories.category', 'plugin.categories.category_order', 'plugin.categories.categories_language', @@ -35,6 +43,7 @@ class TaskContentDeleteContentByKeyTest extends NetCommonsModelTestCase { 'plugin.tasks.task_charge', 'plugin.tasks.task_content', 'plugin.tasks.block_setting_for_task', + 'plugin.tasks.rooms_language_for_task', 'plugin.workflow.workflow_comment', 'plugin.content_comments.content_comment', ); diff --git a/Test/Case/Model/TaskContent/SaveContentTest.php b/Test/Case/Model/TaskContent/SaveContentTest.php index 317d18b..9483e84 100644 --- a/Test/Case/Model/TaskContent/SaveContentTest.php +++ b/Test/Case/Model/TaskContent/SaveContentTest.php @@ -27,6 +27,14 @@ class TaskContentSaveContentTest extends WorkflowSaveTest { * @var array */ public $fixtures = array( + 'plugin.tasks.calendar_for_task', + 'plugin.tasks.calendar_event_for_task', + 'plugin.tasks.calendar_frame_setting_for_task', + 'plugin.tasks.calendar_frame_setting_select_room_for_task', + 'plugin.tasks.calendar_rrule_for_task', + 'plugin.tasks.calendar_event_share_user_for_task', + 'plugin.tasks.calendar_event_content_for_task', + 'plugin.rooms.room_role', 'plugin.categories.category', 'plugin.categories.category_order', 'plugin.categories.categories_language', @@ -37,6 +45,7 @@ class TaskContentSaveContentTest extends WorkflowSaveTest { 'plugin.tasks.task_charge', 'plugin.tasks.task_content', 'plugin.tasks.block_setting_for_task', + 'plugin.tasks.rooms_language_for_task', 'plugin.categories.category', 'plugin.workflow.workflow_comment', ); @@ -87,6 +96,9 @@ public function dataProviderSave() { $data['TaskContent'] = (new TaskContentFixture())->records[1]; $data['TaskCharge'][] = (new TaskChargeFixture())->records[0]; $data['TaskContent']['status'] = '1'; + + $data['TaskContent']['use_calendar'] = false; + $data['TaskContent']['calendar_key'] = ''; $results = array(); // * 編集の登録処理 diff --git a/Test/Case/Model/TaskContent/SetReminderMailTest.php b/Test/Case/Model/TaskContent/SetReminderMailTest.php index fc477d5..b67d02b 100644 --- a/Test/Case/Model/TaskContent/SetReminderMailTest.php +++ b/Test/Case/Model/TaskContent/SetReminderMailTest.php @@ -13,6 +13,12 @@ App::uses('NetCommonsModelTestCase', 'NetCommons.TestSuite'); App::uses('TaskContentFixture', 'Tasks.Test/Fixture'); App::uses('TaskChargeFixture', 'Tasks.Test/Fixture'); +App::uses('CalendarFixture', 'Calendars.Test/Fixture'); +App::uses('CalendarFixture', 'Calendars.Test/Fixture'); +App::uses('CalendarEventFixture', 'Calendars.Test/Fixture'); +App::uses('CalendarEventContentFixture', 'Calendars.Test/Fixture'); +App::uses('CalendarFrameSettingFixture', 'Calendars.Test/Fixture'); +App::uses('CalendarFrameSettingSelectRoomFixture', 'Calendars.Test/Fixture'); /** * TaskContent::setReminderMail()のテスト @@ -28,6 +34,15 @@ class TaskContentSetReminderMailTest extends NetCommonsModelTestCase { * @var array */ public $fixtures = array( + 'plugin.tasks.calendar_for_task', + 'plugin.tasks.calendar_event_for_task', + 'plugin.tasks.calendar_frame_setting_for_task', + 'plugin.tasks.calendar_frame_setting_select_room_for_task', + 'plugin.tasks.calendar_rrule_for_task', + 'plugin.tasks.calendar_event_share_user_for_task', + 'plugin.tasks.calendar_event_content_for_task', + 'plugin.rooms.room_role', +// 'plugin.tasks.event_content', 'plugin.categories.category', 'plugin.categories.category_order', 'plugin.categories.categories_language', @@ -38,6 +53,7 @@ class TaskContentSetReminderMailTest extends NetCommonsModelTestCase { 'plugin.tasks.task_charge', 'plugin.tasks.task_content', 'plugin.tasks.block_setting_for_task', + 'plugin.tasks.rooms_language_for_task', 'plugin.categories.category', 'plugin.workflow.workflow_comment', ); diff --git a/Test/Fixture/CalendarEventContentForTaskFixture.php b/Test/Fixture/CalendarEventContentForTaskFixture.php new file mode 100644 index 0000000..b17400c --- /dev/null +++ b/Test/Fixture/CalendarEventContentForTaskFixture.php @@ -0,0 +1,57 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarEventContentFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarEventContentFixture + */ +class CalendarEventContentForTaskFixture extends CalendarEventContentFixture { + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'CalendarEventContents'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendar_event_contents'; + +/** + * Records + * + * @var array + */ + public $records = array( + array( + 'id' => 1, + 'model' => 'calendarmodel', + 'content_key' => 'calendarplan1', + 'calendar_event_id' => 1, + 'created_user' => 1, + 'created' => '2016-03-24 07:09:51', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:09:51' + ), + ); + +} diff --git a/Test/Fixture/CalendarEventForTaskFixture.php b/Test/Fixture/CalendarEventForTaskFixture.php new file mode 100644 index 0000000..e921c31 --- /dev/null +++ b/Test/Fixture/CalendarEventForTaskFixture.php @@ -0,0 +1,947 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarEventFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarEventFixture + */ +class CalendarEventForTaskFixture extends CalendarEventFixture { + + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'CalendarEvents'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendar_events'; + +/** + * Records + * + * @var array + */ + public $records = array( + //adminが書いた予定(パブリック) + array( + 'id' => '1', + 'calendar_rrule_id' => '1', + 'key' => 'calendarplan1', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'calendarplan1', + 'title_icon' => '/net_commons/img/title_icon/10_010_new.svg', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160908', + 'start_time' => '150000', + 'dtstart' => '20160908150000', + 'end_date' => '20160909', + 'end_time' => '150000', + 'dtend' => '20160909150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //一般が書いた予定 一度も公開していない + 'id' => '2', + 'calendar_rrule_id' => '2', + 'key' => 'calendarplan2', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'generaluser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '3', + 'is_active' => false, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '4', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '4', + 'modified' => '2016-03-24 07:09:51' + ), + array( //一般が書いた予定 一度公開している + 'id' => '3', + 'calendar_rrule_id' => '3', + 'key' => 'calendarplan3', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'generaluser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => '1', + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '4', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //editorが書いた予定 一度も公開していない + 'id' => '4', + 'calendar_rrule_id' => '4', + 'key' => 'calendarplan4', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'editoruser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '3', + 'is_active' => false, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '3', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '3', + 'modified' => '2016-03-24 07:09:51' + ), + array( //editorが書いた予定 一度公開している + 'id' => '5', + 'calendar_rrule_id' => '5', + 'key' => 'calendarplan5', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'editoruser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '3', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '3', + 'modified' => '2016-03-24 07:09:51' + ), + array( //chief_editorが書いた予定 一度公開している + 'id' => '6', + 'calendar_rrule_id' => '6', + 'key' => 'calendarplan6', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'chiefeditoruser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '2', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '2', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(日/2回) 1 + 'id' => '7', + 'calendar_rrule_id' => '8', + 'key' => 'calendarplan7', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplandaytime', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '1', //この予定のみ更新した + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', //1 + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', //1 + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(日/2回) 2 + 'id' => '8', + 'calendar_rrule_id' => '8', //8 + 'key' => 'calendarplan7', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplan', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '1', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //予定(期間) + 'id' => '9', + 'calendar_rrule_id' => '9', + 'key' => 'calendarplan9line', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'calendarplan9line', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => 0, + 'start_date' => '20160901', + 'start_time' => '050000', + 'dtstart' => '20160901050000', + 'end_date' => '20160902', + 'end_time' => '060000', + 'dtend' => '20160902060000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '2', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '2', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(週/2回) 1 + 'id' => '10', + 'calendar_rrule_id' => '10', + 'key' => 'calendarplan10', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanweek', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160909', + 'start_time' => '070000', + 'dtstart' => '20160909070000', + 'end_date' => '20160909', + 'end_time' => '080000', + 'dtend' => '20160909080000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(週/2回) 2 + 'id' => '11', + 'calendar_rrule_id' => '10', + 'key' => 'calendarplan10', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanweek', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/第1週日曜日/2回) 1 + 'id' => '12', + 'calendar_rrule_id' => '12', + 'key' => 'calendarplan12', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanmonth', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/第1週日曜日/2回) 2 + 'id' => '13', + 'calendar_rrule_id' => '12', + 'key' => 'calendarplan12', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanmonth', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(年/2回) 1 + 'id' => '14', + 'calendar_rrule_id' => '14', + 'key' => 'calendarplan14', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanyear', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(年/2回) 2 + 'id' => '15', + 'calendar_rrule_id' => '14', + 'key' => 'calendarplan14', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanyear', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(週/木/9月2日まで) + 'id' => '16', + 'calendar_rrule_id' => '16', + 'key' => 'calendarplan16', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatweekThursdaySep2', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160831', + 'start_time' => '150000', + 'dtstart' => '20160831150000', + 'end_date' => '20160901', + 'end_time' => '150000', + 'dtend' => '20160901150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/2か月おき2日/10月1日まで) + 'id' => '17', + 'calendar_rrule_id' => '17', + 'key' => 'calendarplan17', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatmonthlyuntil', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160831', + 'start_time' => '150000', + 'dtstart' => '20160831150000', + 'end_date' => '20160901', + 'end_time' => '150000', + 'dtend' => '20160901150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(2年ごとに,9月 / 開始日と同日 / 2017年09月01日まで) + 'id' => '18', + 'calendar_rrule_id' => '18', + 'key' => 'calendarplan18', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatmonthlyuntil', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => false, //test + 'start_date' => '20160831', + 'start_time' => '150000', + 'dtstart' => '20160831150000', + 'end_date' => '20160901', + 'end_time' => '150000', + 'dtend' => '20160901150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(日/2日ごと/2016.9.2まで) + 'id' => '19', + 'calendar_rrule_id' => '19', + 'key' => 'calendarplan19', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeat2dayuntil', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160831', + 'start_time' => '150000', + 'dtstart' => '20160831150000', + 'end_date' => '20160901', + 'end_time' => '150000', + 'dtend' => '20160901150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/第2週月曜日1回) + 'id' => '20', + 'calendar_rrule_id' => '20', + 'key' => 'calendarplan20', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanmonth', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/第3週火曜日1回) + 'id' => '21', + 'calendar_rrule_id' => '21', + 'key' => 'calendarplan21', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanmonth', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/第4週水曜日1回) + 'id' => '22', + 'calendar_rrule_id' => '22', + 'key' => 'calendarplan22', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanmonth', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //adminが書いた予定 繰り返しあり(月/最終週木曜日1回) + 'id' => '23', + 'calendar_rrule_id' => '23', + 'key' => 'calendarplan23', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'adminrepeatplanmonth', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + //adminが書いた予定(全会員) + array( + 'id' => '24', + 'calendar_rrule_id' => '24', + 'key' => 'calendarplan24', + 'room_id' => '4', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'calendarplan24', + 'title_icon' => '/net_commons/img/title_icon/10_010_new.svg', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160909', + 'start_time' => '070000', + 'dtstart' => '20160909070000', + 'end_date' => '20160909', + 'end_time' => '080000', + 'dtend' => '20160909080000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //一般が書いた予定(承認待ち) + 'id' => '25', + 'calendar_rrule_id' => '25', + 'key' => 'calendarplan25', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'generaluser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '2', + 'is_active' => '1', + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '4', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '4', + 'modified' => '2016-03-24 07:09:51' + ), + array( //一般が書いた予定(差し戻し) + 'id' => '26', + 'calendar_rrule_id' => '26', + 'key' => 'calendarplan26', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'generaluser', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160728', + 'start_time' => '070951', + 'dtstart' => '20160731150000', + 'end_date' => '20160728', + 'end_time' => '070951', + 'dtend' => '20160731150000', + 'timezone_offset' => '9.0', + 'status' => '4', + 'is_active' => '1', + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '4', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '4', + 'modified' => '2016-03-24 07:09:51' + ), + //adminが書いた予定(プライベート)(共有あり) + array( + 'id' => '27', + 'calendar_rrule_id' => '27', + 'key' => 'calendarplan27', + 'room_id' => '8', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'calendarplan27', + 'title_icon' => '/net_commons/img/title_icon/10_010_new.svg', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => true, + 'start_date' => '20160909', + 'start_time' => '070000', + 'dtstart' => '20160909070000', + 'end_date' => '20160909', + 'end_time' => '080000', + 'dtend' => '20160909080000', + 'timezone_offset' => '9.0', + 'status' => '1', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '1', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '1', + 'modified' => '2016-03-24 07:09:51' + ), + array( //予定(期間)(一時保存) + 'id' => '28', + 'calendar_rrule_id' => '0', + 'key' => 'calendarplan28line', + 'room_id' => '2', + 'language_id' => '2', + 'target_user' => '1', + 'title' => 'calendarplan28line', + 'title_icon' => 'Lorem ipsum dolor sit amet', + 'location' => 'Lorem ipsum dolor sit amet', + 'contact' => 'Lorem ipsum dolor sit amet', + 'description' => 'testdescription', + 'is_allday' => 0, + 'start_date' => '20160901', + 'start_time' => '050000', + 'dtstart' => '20160901050000', + 'end_date' => '20160902', + 'end_time' => '060000', + 'dtend' => '20160902060000', + 'timezone_offset' => '9.0', + 'status' => '3', + 'is_active' => true, + 'is_latest' => true, + 'recurrence_event_id' => '0', + 'exception_event_id' => '0', + 'is_enable_mail' => false, + 'email_send_timing' => '0', + 'created_user' => '2', + 'created' => '2016-03-24 07:09:51', + 'modified_user' => '2', + 'modified' => '2016-03-24 07:09:51' + ), + ); + +} diff --git a/Test/Fixture/CalendarEventShareUserForTaskFixture.php b/Test/Fixture/CalendarEventShareUserForTaskFixture.php new file mode 100644 index 0000000..6746d76 --- /dev/null +++ b/Test/Fixture/CalendarEventShareUserForTaskFixture.php @@ -0,0 +1,65 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarEventShareUserFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarEventShareUserFixture + */ +class CalendarEventShareUserForTaskFixture extends CalendarEventShareUserFixture { + + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'CalendarEventShareUsers'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendar_event_share_users'; + +/** + * Records + * + * @var array + */ + public $records = array( + array( + 'id' => 1, + 'calendar_event_id' => 1, + 'share_user' => 1, + 'created_user' => 1, + 'created' => '2016-03-24 07:09:58', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:09:58' + ), + array( + 'id' => 2, + 'calendar_event_id' => 27, + 'share_user' => 3, //編集長と共有 + 'created_user' => 1, + 'created' => '2016-03-24 07:09:58', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:09:58' + ), + ); +} diff --git a/Test/Fixture/CalendarForTaskFixture.php b/Test/Fixture/CalendarForTaskFixture.php new file mode 100644 index 0000000..d8ae2b1 --- /dev/null +++ b/Test/Fixture/CalendarForTaskFixture.php @@ -0,0 +1,64 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarFixture + */ +class CalendarForTaskFixture extends CalendarFixture { + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'Calendars'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendars'; + +/** + * Records + * + * @var array + */ + public $records = array( + array( + 'id' => 1, + 'block_key' => 'block_1', + //'use_workflow' => 1, + 'created_user' => 1, + 'created' => '2016-03-24 07:10:30', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:30' + ), + array( + 'id' => 2, + 'block_key' => 'block_1', + //'use_workflow' => 1, + 'created_user' => 1, + 'created' => '2016-03-24 07:10:30', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:30' + ), + ); +} diff --git a/Test/Fixture/CalendarFrameSettingForTaskFixture.php b/Test/Fixture/CalendarFrameSettingForTaskFixture.php new file mode 100644 index 0000000..dfa43b9 --- /dev/null +++ b/Test/Fixture/CalendarFrameSettingForTaskFixture.php @@ -0,0 +1,73 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarFrameSettingFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarFrameSettingFixture + */ +class CalendarFrameSettingForTaskFixture extends CalendarFrameSettingFixture { + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'CalendarFrameSettings'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendar_frame_settings'; + +/** + * Records + * + * @var array + */ + public $records = array( + array( + 'id' => 1, + 'frame_key' => 'frame_3', + 'display_type' => 1, + 'start_pos' => 1, + 'display_count' => 3, + 'is_myroom' => 1, + 'is_select_room' => 1, + 'room_id' => '2', + 'timeline_base_time' => 1, + 'created_user' => 1, + 'created' => '2016-03-24 07:10:18', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:18' + ), + ); + +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Calendars') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new CalendarsSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } + +} diff --git a/Test/Fixture/CalendarFrameSettingSelectRoomForTaskFixture.php b/Test/Fixture/CalendarFrameSettingSelectRoomForTaskFixture.php new file mode 100644 index 0000000..eaa6b15 --- /dev/null +++ b/Test/Fixture/CalendarFrameSettingSelectRoomForTaskFixture.php @@ -0,0 +1,95 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarFrameSettingSelectRoomFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarFrameSettingSelectRoomFixture + */ +class CalendarFrameSettingSelectRoomForTaskFixture extends CalendarFrameSettingSelectRoomFixture { + + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'CalendarFrameSettingSelectRooms'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendar_frame_setting_select_rooms'; + +/** + * Records + * + * @var array + */ + public $records = array( + array( + 'id' => 1, + 'calendar_frame_setting_id' => 1, + 'room_id' => '2', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:11', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:11' + ), + array( + 'id' => 2, + 'calendar_frame_setting_id' => 1, + 'room_id' => '3', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:11', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:11' + ), + array( + 'id' => 3, + 'calendar_frame_setting_id' => 1, + 'room_id' => '4', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:11', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:11' + ), + array( + 'id' => 4, + 'calendar_frame_setting_id' => 1, + 'room_id' => '5', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:11', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:11' + ), + ); + +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Calendars') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new CalendarsSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } + +} \ No newline at end of file diff --git a/Test/Fixture/CalendarRruleForTaskFixture.php b/Test/Fixture/CalendarRruleForTaskFixture.php new file mode 100644 index 0000000..8c0f3ce --- /dev/null +++ b/Test/Fixture/CalendarRruleForTaskFixture.php @@ -0,0 +1,352 @@ + + * @author AllCreator + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('CalendarRruleFixture', 'Calendars.Test/Fixture'); + +/** + * Summary for CalendarRruleFixture + */ +class CalendarRruleForTaskFixture extends CalendarRruleFixture { + + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'calendars'; + + /** + * Model name + * + * @var string + */ + public $name = 'CalendarRrules'; + + /** + * Full Table Name + * + * @var string + */ + public $table = 'calendar_rrules'; + +/** + * Records + * + * @var array + */ + public $records = array( + array( + 'id' => 1, + 'calendar_id' => 1, + 'key' => 'calendarplan1', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 2, + 'calendar_id' => 2, + 'key' => 'calendarplan2', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 4, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 4, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 3, + 'calendar_id' => 3, + 'key' => 'calendarplan3', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 4, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 4, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 4, + 'calendar_id' => 4, + 'key' => 'calendarplan4', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 5, + 'calendar_id' => 5, + 'key' => 'calendarplan5', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 6, + 'calendar_id' => 1, + 'key' => 'calendarplan6', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 2, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 2, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 7, + 'calendar_id' => 1, + 'key' => 'calendarplan7', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=DAILY;INTERVAL=1;COUNT=2', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 8, + 'calendar_id' => 8, + 'key' => 'calendarplan8', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 9, + 'calendar_id' => 9, + 'key' => 'calendarplan9line', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 10, + 'calendar_id' => 1, + 'key' => 'calendarplan10', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=WEEKLY;INTERVAL=1;BYDAY=1SU;COUNT=2', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 12, + 'calendar_id' => 1, + 'key' => 'calendarplan12', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=MONTHLY;INTERVAL=1;BYDAY=1SU;COUNT=2', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 14, + 'calendar_id' => 1, + 'key' => 'calendarplan14', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=YEARLY;INTERVAL=1;BYMONTH=2;COUNT=2', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 16, + 'calendar_id' => 1, + 'key' => 'calendarplan16', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=WEEKLY;INTERVAL=2;BYDAY=TH;UNTIL=20160902T150000', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 17, + 'calendar_id' => 1, + 'key' => 'calendarplan17', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=2;COUNT=1', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 1, //test1 + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 18, + 'calendar_id' => 1, + 'key' => 'calendarplan18', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=YEARLY;INTERVAL=2;BYMONTH=9;BYDAY=2SA;UNTIL=20170901T150000', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 19, + 'calendar_id' => 1, + 'key' => 'calendarplan19', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=DAILY;INTERVAL=2;UNTIL=20160902T150000', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 20, + 'calendar_id' => 1, + 'key' => 'calendarplan20', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=MONTHLY;INTERVAL=1;BYDAY=2MO;COUNT=1', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 21, + 'calendar_id' => 1, + 'key' => 'calendarplan21', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=MONTHLY;INTERVAL=1;BYDAY=3TU;COUNT=1', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 22, + 'calendar_id' => 1, + 'key' => 'calendarplan22', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=MONTHLY;INTERVAL=1;BYDAY=4WE;COUNT=1', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 23, + 'calendar_id' => 1, + 'key' => 'calendarplan23', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => 'FREQ=MONTHLY;INTERVAL=1;BYDAY=-1TH;COUNT=1', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '2', + 'created_user' => 3, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 3, + 'modified' => '2016-03-24 07:10:24' + ), + array( + 'id' => 27, + 'calendar_id' => 1, + 'key' => 'calendarplan27', + 'name' => 'Lorem ipsum dolor sit amet', + 'rrule' => '', + 'icalendar_uid' => 'Lorem ipsum dolor sit amet', + 'icalendar_comp_name' => 'Lorem ipsum dolor sit amet', + 'room_id' => '8', + 'created_user' => 1, + 'created' => '2016-03-24 07:10:24', + 'modified_user' => 1, + 'modified' => '2016-03-24 07:10:24' + ), + ); + +/** + * Initialize the fixture. + * + * @return void + */ + public function init() { + require_once App::pluginPath('Calendars') . 'Config' . DS . 'Schema' . DS . 'schema.php'; + $this->fields = (new CalendarsSchema())->tables[Inflector::tableize($this->name)]; + parent::init(); + } + +} diff --git a/Test/Fixture/Room4testFixture.php b/Test/Fixture/Room4testFixture.php new file mode 100644 index 0000000..c325318 --- /dev/null +++ b/Test/Fixture/Room4testFixture.php @@ -0,0 +1,179 @@ + + * @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('RoomFixture', 'Rooms.Test/Fixture'); + +/** + * Room4testFixture + * + * @author Shohei Nakajima + * @package NetCommons\Rooms\Test\Fixture + */ +class Room4testFixture extends RoomFixture { + +/** + * Model name + * + * @var string + */ + public $name = 'Room'; + +/** + * Full Table Name + * + * @var string + */ + public $table = 'rooms'; + +/** + * Records + * + * @var array + */ + public $records = array( + //サイト全体 + array( + 'id' => '1', + 'space_id' => '1', + 'page_id_top' => null, + 'parent_id' => null, + 'lft' => '1', + 'rght' => '18', + 'active' => '1', + 'default_role_key' => 'visitor', + 'need_approval' => '1', + 'default_participation' => '1', + 'page_layout_permitted' => '0', + 'theme' => null, + ), + //パブリックスペース + array( + 'id' => '2', + 'space_id' => '2', + 'page_id_top' => '1', + 'parent_id' => '1', + 'lft' => '2', + 'rght' => '9', + 'active' => true, + 'default_role_key' => 'visitor', + 'need_approval' => true, + 'default_participation' => true, + 'page_layout_permitted' => true, + 'theme' => null, + ), + //パブリックスペース、別ルーム(room_id=4) + array( + 'id' => '5', + 'space_id' => '2', + 'page_id_top' => '3', + 'parent_id' => '2', + 'lft' => '3', + 'rght' => '6', + 'active' => true, + 'default_role_key' => 'visitor', + 'need_approval' => true, + 'default_participation' => true, + 'page_layout_permitted' => true, + 'theme' => null, + ), + //パブリックスペース、サブサブルーム(room_id=8) + array( + 'id' => '9', + 'space_id' => '2', + 'page_id_top' => '8', + 'parent_id' => '5', + 'lft' => '4', + 'rght' => '5', + 'active' => true, + 'default_role_key' => 'visitor', + 'need_approval' => true, + 'default_participation' => true, + 'page_layout_permitted' => true, + 'theme' => null, + ), + //パブリックスペース、別ルーム(room_id=5、ブロックなし) + array( + 'id' => '6', + 'space_id' => '2', + 'page_id_top' => '4', + 'parent_id' => '2', + 'lft' => '7', + 'rght' => '8', + 'active' => true, + 'default_role_key' => 'visitor', + 'need_approval' => true, + 'default_participation' => true, + 'page_layout_permitted' => true, + 'theme' => null, + ), + //プライベートスペース + array( + 'id' => '3', + 'space_id' => '3', + 'page_id_top' => null, + 'parent_id' => '1', + 'lft' => '10', + 'rght' => '13', + 'active' => true, + 'default_role_key' => 'room_administrator', + 'need_approval' => false, + 'default_participation' => false, + 'page_layout_permitted' => false, + 'theme' => null, + ), + //プライベートスペース、別ルーム(room_id=7, プライベートルーム) + array( + 'id' => '8', + 'space_id' => '3', + 'page_id_top' => '7', + 'parent_id' => '3', + 'lft' => '11', + 'rght' => '12', + 'active' => true, + 'default_role_key' => 'room_administrator', + 'need_approval' => '0', + 'default_participation' => '0', + 'page_layout_permitted' => '0', + 'theme' => null, + ), + //コミュニティスペース + array( + 'id' => '4', + 'space_id' => '4', + 'page_id_top' => null, + 'parent_id' => '1', + 'lft' => '14', + 'rght' => '17', + 'active' => true, + 'default_role_key' => 'general_user', + 'need_approval' => true, + 'default_participation' => true, + 'page_layout_permitted' => true, + 'theme' => null, + ), + //コミュニティスペース、別ルーム(room_id=6, 準備中) + array( + 'id' => '7', + 'space_id' => '4', + 'page_id_top' => '5', + 'parent_id' => '4', + 'lft' => '15', + 'rght' => '16', + 'active' => '0', + 'default_role_key' => 'general_user', + 'need_approval' => true, + 'default_participation' => false, + 'page_layout_permitted' => true, + 'theme' => null, + ), + ); + +} diff --git a/Test/Fixture/RoomsLanguageForTaskFixture.php b/Test/Fixture/RoomsLanguageForTaskFixture.php new file mode 100644 index 0000000..8161cda --- /dev/null +++ b/Test/Fixture/RoomsLanguageForTaskFixture.php @@ -0,0 +1,97 @@ + + * @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('RoomsLanguageFixture', 'Rooms.Test/Fixture'); + +/** + * RoomsLanguage4testFixture + * + * @author Shohei Nakajima + * @package NetCommons\Rooms\Test\Fixture + */ +class RoomsLanguageForTaskFixture extends RoomsLanguageFixture { + + /** + * Plugin key + * + * @var string + */ + public $pluginKey = 'tasks'; + +/** + * Model name + * + * @var string + */ + public $name = 'RoomsLanguage'; + +/** + * Full Table Name + * + * @var string + */ + public $table = 'rooms_languages'; + +/** + * Records + * + * @var array + */ + public $records = array( + //パブリックスペース + //--日本語 + array('id' => '17', 'language_id' => '2', 'room_id' => '1', 'name' => 'サイト全体'), + //--英語 + array('id' => '18', 'language_id' => '1', 'room_id' => '1', 'name' => 'Whole site'), + //パブリックスペース + //--日本語 + array('id' => '1', 'language_id' => '2', 'room_id' => '2', 'name' => 'パブリックスペース'), + //--英語 + array('id' => '2', 'language_id' => '1', 'room_id' => '2', 'name' => 'Public space'), + //プライベートスペース + //--日本語 + array('id' => '3', 'language_id' => '2', 'room_id' => '3', 'name' => 'プライベートスペース'), + //--英語 + array('id' => '4', 'language_id' => '1', 'room_id' => '3', 'name' => 'Private space'), + //コミュニティスペース + //--日本語 + array('id' => '5', 'language_id' => '2', 'room_id' => '4', 'name' => 'コミュニティスペース'), + //--英語 + array('id' => '6', 'language_id' => '1', 'room_id' => '4', 'name' => 'Group space'), + + //パブリックスペース、別ルーム(room_id=4) + //--日本語 + array('id' => '7', 'language_id' => '2', 'room_id' => '5', 'name' => 'サブルーム1'), + //--英語 + array('id' => '8', 'language_id' => '1', 'room_id' => '5', 'name' => 'Sub room 1'), + //パブリックスペース、別ルーム(room_id=5、ブロックなし) + //--日本語 + array('id' => '9', 'language_id' => '2', 'room_id' => '6', 'name' => 'サブルーム2'), + //--英語 + array('id' => '10', 'language_id' => '1', 'room_id' => '6', 'name' => 'Sub room 2'), + //コミュニティスペース、別ルーム(room_id=6, 準備中) + //--日本語 + array('id' => '11', 'language_id' => '2', 'room_id' => '7', 'name' => 'ルーム1'), + //--英語 + array('id' => '12', 'language_id' => '1', 'room_id' => '7', 'name' => 'Room 1'), + //パブリックスペース、別ルーム(room_id=7, プライベートルーム) + //--日本語 + array('id' => '13', 'language_id' => '2', 'room_id' => '8', 'name' => 'プライベート'), + //--英語 + array('id' => '14', 'language_id' => '1', 'room_id' => '8', 'name' => 'Private room'), + //パブリックスペース、サブサブルーム(room_id=8) + //--日本語 + array('id' => '15', 'language_id' => '2', 'room_id' => '9', 'name' => 'サブサブルーム1'), + //--英語 + array('id' => '16', 'language_id' => '1', 'room_id' => '9', 'name' => 'Sub Sub room 1'), + ); + +} diff --git a/composer.json b/composer.json index b316e13..e371ebf 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "cakedc/migrations": "~2.2", "netcommons/blocks": "@dev", "netcommons/categories": "@dev", + "netcommons/calendars": "@dev", "netcommons/content-comments": "@dev", "netcommons/groups": "@dev", "netcommons/mails": "@dev",