Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Controller/TaskContentEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 9 additions & 0 deletions Test/Case/Controller/TaskContentEditController/EditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ 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',
'plugin.tasks.task',
'plugin.tasks.task_charge',
'plugin.tasks.task_content',
'plugin.tasks.block_setting_for_task',
'plugin.tasks.rooms_language_for_task',
'plugin.workflow.workflow_comment',
);

Expand Down
9 changes: 9 additions & 0 deletions Test/Case/Controller/TaskContentsController/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ 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',
'plugin.tasks.task',
'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',
);
Expand Down
9 changes: 9 additions & 0 deletions Test/Case/Model/TaskContent/DeleteContentByKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ 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',
'plugin.tasks.task',
'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',
);
Expand Down
12 changes: 12 additions & 0 deletions Test/Case/Model/TaskContent/SaveContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
);
Expand Down Expand Up @@ -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();
// * 編集の登録処理
Expand Down
16 changes: 16 additions & 0 deletions Test/Case/Model/TaskContent/SetReminderMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()のテスト
Expand All @@ -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',
Expand All @@ -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',
);
Expand Down
57 changes: 57 additions & 0 deletions Test/Fixture/CalendarEventContentForTaskFixture.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* CalendarEventContentFixture
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author AllCreator <info@allcreator.net>
* @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'
),
);

}
Loading