diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js index e2e43fde11..8c5c3451c3 100644 --- a/module/doc/js/edit.js +++ b/module/doc/js/edit.js @@ -6,7 +6,7 @@ $(function() { $('#content').html(draft); editor = KindEditor.instances[0]; - editor.html(draft); + editor.html('' + draft); $('.kindeditor-ph').remove(); } }, 100) diff --git a/module/execution/js/task.js b/module/execution/js/task.js index 032f77cbbe..013627478d 100644 --- a/module/execution/js/task.js +++ b/module/execution/js/task.js @@ -9,7 +9,7 @@ $(function() $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60); }); - toggleFold('#projectTaskForm', unfoldTasks, executionID, 'project'); + toggleFold('#executionTaskForm', unfoldTasks, executionID, 'project'); adjustTableFooter(); $('body').on('click', '#toggleFold', adjustTableFooter); diff --git a/module/mr/model.php b/module/mr/model.php index db71b79297..d86e635062 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -327,7 +327,7 @@ class mrModel extends model $todo->assignedBy = $this->app->user->account; $todo->date = date("Y-m-d", strtotime($rawTodo->target->created_at)); $todo->assignedDate = $rawTodo->target->created_at; - $todo->begin = date("Hi", strtotime($rawTodo->target->created_at)); + $todo->begin = '2400'; /* 2400 means begin is 'undefined'. */; $todo->end = '2400'; /* 2400 means end is 'undefined'. */ $todo->type = 'custom'; $todo->idvalue = $rawTodo->id; diff --git a/module/product/model.php b/module/product/model.php index 9f78b9598a..25256181bd 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1592,7 +1592,11 @@ class productModel extends model $hourList = $this->loadModel('project')->computerProgress($latestExecutionList); - $releaseList = $this->dao->select('id,product,name,marker')->from(TABLE_RELEASE)->where('product')->in(array_keys($productList))->fetchGroup('product', 'id'); + $releaseList = $this->dao->select('id,product,name,marker')->from(TABLE_RELEASE) + ->where('product')->in(array_keys($productList)) + ->andWhere('deleted')->eq('0') + ->andWhere('status')->eq('normal') + ->fetchGroup('product', 'id'); return array('programList' => $programList, 'productList' => $productList, 'planList' => $planList, 'projectList' => $projectList, 'executionList' => $executionList, 'projectProduct' => $projectProduct, 'projectLatestExecutions' => $projectLatestExecutions, 'hourList' => $hourList, 'releaseList' => $releaseList); } diff --git a/module/project/model.php b/module/project/model.php index c31a42e922..1adebc2bff 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1017,6 +1017,14 @@ class projectModel extends model if($oldProject->parent != $project->parent) $this->loadModel('program')->processNode($projectID, $project->parent, $oldProject->path, $oldProject->grade); + /* Fix whitelist changes. */ + $oldWhitelist = explode(',', $oldProject->whitelist) and $oldWhitelist = array_filter($oldWhitelist); + $newWhitelist = explode(',', $project->whitelist) and $newWhitelist = array_filter($newWhitelist); + if(count($oldWhitelist) == count($newWhitelist) and count(array_diff($oldWhitelist, $newWhitelist)) == 0) unset($project->whitelist); + /* Add linkedproducts changes. */ + $oldProject->linkedProducts = implode(',', $linkedProducts); + $project->linkedProducts = implode(',', $_POST['products']); + return common::createChanges($oldProject, $project); } } diff --git a/module/task/control.php b/module/task/control.php index 5251bc74d9..4a027260f4 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -389,9 +389,9 @@ class task extends control $task = $this->task->getById($taskID); if($this->post->comment != '' or !empty($changes) or !empty($files)) { - $action = (!empty($changes) or !empty($files)) ? 'Edited' : 'Commented'; + $action = (!empty($changes) or !empty($files)) ? 'Edited' : 'Commented'; $fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : ''; - $actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment); + $actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } diff --git a/module/task/model.php b/module/task/model.php index 9e87c22359..d59db80472 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -848,8 +848,7 @@ class taskModel extends model $now = helper::now(); $task = fixer::input('post') ->setDefault('story, estimate, left, consumed', 0) - ->setDefault('estStarted', '0000-00-00') - ->setDefault('deadline', '0000-00-00') + ->setDefault('realStarted', '0000-00-00 00:00:00') ->setIF(is_numeric($this->post->estimate), 'estimate', (float)$this->post->estimate) ->setIF(is_numeric($this->post->consumed), 'consumed', (float)$this->post->consumed) ->setIF(is_numeric($this->post->left), 'left', (float)$this->post->left) @@ -1922,7 +1921,7 @@ class taskModel extends model if($task->assignedTo == 'closed') $task->assignedToRealName = 'Closed'; foreach($task as $key => $value) { - if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $task->$key = ''; + if((strpos($key, 'Date') !== false or strpos('estStarted|deadline', $key) !== false) and !(int)substr($value, 0, 4)) $task->$key = ''; } $task->files = $this->loadModel('file')->getByObject('task', $taskID); diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 2f281bc080..5c3862a9c4 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -176,11 +176,11 @@
| task->estStarted;?> | -estStarted) ? '' : $task->estStarted, "class='form-control form-date'");?> | +estStarted, "class='form-control form-date'");?> |
|---|---|---|
| task->deadline;?> | -deadline) ? '' : $task->deadline, "class='form-control form-date'");?> | +deadline, "class='form-control form-date'");?> |
| task->estimate;?> |