* Finish task #3224.

This commit is contained in:
pengjiangxiu
2017-09-20 15:37:26 +08:00
parent da796c772c
commit 6a8f072e42
9 changed files with 37 additions and 19 deletions
+5 -5
View File
@@ -55,11 +55,11 @@ js::set('browseType', $browseType);
<td colspan='<?php echo $columns;?>'>
<div class='table-actions clearfix'>
<?php
$canBatchEdit = common::hasPriv('task', 'batchEdit', $task);
$canBatchClose = (common::hasPriv('task', 'batchClose', $task) && strtolower($browseType) != 'closedBy');
$canBatchCancel = common::hasPriv('task', 'batchCancel', $task);
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', $task);
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', $task);
$canBatchEdit = common::hasPriv('task', 'batchEdit', !empty($task) ? $task : null);
$canBatchClose = (common::hasPriv('task', 'batchClose', !empty($task) ? $task : null) && strtolower($browseType) != 'closedBy');
$canBatchCancel = common::hasPriv('task', 'batchCancel', !empty($task) ? $task : null);
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule', !empty($task) ? $task : null);
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo', !empty($task) ? $task : null);
if(count($tasks))
{
echo html::selectButton();
+1 -1
View File
@@ -86,7 +86,7 @@
<td><?php echo substr($task->openedDate, 5, 6);?></td>
<?php endif;?>
<td <?php echo $class;?>><?php echo $task->assignedTo == 'closed' ? 'Closed' : $users[$task->assignedTo];?></td>
<td <?php echo $class;?>><?php echo $task->assignedTo == 'closed' ? 'Closed' : zget($users, $task->assignedTo, $task->assignedTo);?></td>
<td><?php echo zget($users, $task->finishedBy, $task->finishedBy);?></td>
<?php if($this->cookie->windowWidth > $this->config->wideSize):?>
+1
View File
@@ -1272,6 +1272,7 @@ class story extends control
$storyInfo['estimate'] = $story->estimate;
$storyInfo['pri'] = $story->pri;
$storyInfo['spec'] = $story->spec;
echo json_encode($storyInfo);
}
+5 -5
View File
@@ -34,10 +34,10 @@ class task extends control
/**
* Create a task.
*
* @param int $projectID
* @param int $storyID
* @param int $moduleID
*
* @param int $projectID
* @param int $storyID
* @param int $moduleID
* @param int $taskID
* @access public
* @return void
@@ -855,7 +855,7 @@ class task extends control
$this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->finish;
$this->view->position[] = $this->lang->task->finish;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
+3 -1
View File
@@ -41,7 +41,7 @@ function copyStoryTitle(num)
$('#name\\[' + num + '\\]').val(storyTitle);
$('#estimate\\[' + num + '\\]').val($('#storyEstimate' + num).val());
$('#desc\\[' + num + '\\]').val($('#storyDesc' + num).val());
$('#desc\\[' + num + '\\]').val(($('#storyDesc' + num).val()).replace(/<[^>]+>/g,''));
var storyPri = $('#storyPri' + num).val();
if(storyPri == 0) $('#pri' + num ).val('3');
@@ -150,4 +150,6 @@ $(function()
$('#module0_chosen').width($('#module1_chosen').width());
$('#story0_chosen').width($('#story1_chosen').width());
if($.cookie('zeroTask') == 'true') toggleZeroTaskStory();
if(storyID != 0) setStoryRelated(0);
})
+15 -2
View File
@@ -5,7 +5,16 @@ function copyStoryTitle()
startPosition = storyTitle.indexOf(':') + 1;
endPosition = storyTitle.lastIndexOf('(');
storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
$('#name').attr('value', storyTitle);
$('#estimate').val($('#storyEstimate').val());
$('#desc').val($('#storyDesc').val());
$('.pri-text span:first').removeClass().addClass('pri' + $('#storyPri').val()).text($('#storyPri').val());
$('select#pri').val($('#storyPri').val());
$(window.editor.desc.edit.doc).find('span.kindeditor-ph').remove();
window.editor.desc.html($('#storyDesc').val());
}
/* Set the assignedTos field. */
@@ -31,7 +40,7 @@ function setOwners(result)
function setStoryRelated()
{
setPreview();
if($('#module').val() == 0) setStoryModule();
setStoryModule();
}
/* Set the story module. */
@@ -45,6 +54,10 @@ function setStoryModule()
{
$('#module').val(storyInfo.moduleID);
$("#module").trigger("chosen:updated");
$('#storyEstimate').val(storyInfo.estimate);
$('#storyPri' ).val(storyInfo.pri);
$('#storyDesc' ).val(storyInfo.spec);
});
}
}
@@ -137,7 +150,7 @@ function setStories(moduleID, projectID)
$(document).ready(function()
{
setPreview();
setStoryRelated();
$('#selectAllUser').on('click', function()
{
+4 -4
View File
@@ -37,7 +37,7 @@ class taskModel extends model
->setDefault('openedDate', helper::now())
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
->join('mailto', ',')
->remove('after,files,labels,assignedTo,uid')
->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri')
->get();
foreach($this->post->assignedTo as $assignedTo)
@@ -1583,9 +1583,9 @@ class taskModel extends model
/**
* Judge an action is clickable or not.
*
* @param object $task
* @param string $action
*
* @param object $task
* @param string $action
* @access public
* @return bool
*/
+2 -1
View File
@@ -133,7 +133,8 @@ if($hiddenStory and isset($visibleFields['story'])) $colspan -= 1;
</table>
<?php js::set('storyTasks', $storyTasks);?>
<?php js::set('mainField', 'name');?>
<?php js::set('ditto', $lang->task->ditto);?>
<?php js::set('ditto', $lang->task->ditto);?>
<?php js::set('storyID', $storyID);?>
<?php $customLink = $this->createLink('custom', 'ajaxSaveCustomFields', 'module=task&section=custom&key=batchCreateFields')?>
<?php include '../../common/view/customfield.html.php';?>
<?php include '../../common/view/pastetext.html.php';?>
+1
View File
@@ -68,6 +68,7 @@
<?php echo html::input('name', $task->name, "class='form-control' autocomplete='off'");?>
<?php if($this->config->global->flow != 'onlyTask'):?>
<span class='input-group-btn'><a href='javascript:copyStoryTitle();' id='copyButton' class='btn'><?php echo $lang->task->copyStoryTitle;?></a></span>
<?php echo html::hidden("storyEstimate") . html::hidden("storyDesc") . html::hidden("storyPri");?>
<?php endif;?>
</div>
</div>