Merge branch 'master' of https://github.com/easysoft/zentaopms
This commit is contained in:
@@ -360,18 +360,20 @@ $lang->project->methodOrder[190] = 'all';
|
||||
/* Task. */
|
||||
$lang->resource->task = new stdclass();
|
||||
$lang->resource->task->create = 'create';
|
||||
$lang->resource->task->batchCreate = 'batchCreate';
|
||||
$lang->resource->task->batchEdit = 'batchEdit';
|
||||
$lang->resource->task->edit = 'edit';
|
||||
$lang->resource->task->assignTo = 'assign';
|
||||
$lang->resource->task->batchAssignTo = 'batchAssignTo';
|
||||
$lang->resource->task->start = 'start';
|
||||
$lang->resource->task->pause = 'pause';
|
||||
$lang->resource->task->restart = 'restart';
|
||||
$lang->resource->task->finish = 'finish';
|
||||
$lang->resource->task->cancel = 'cancel';
|
||||
$lang->resource->task->close = 'close';
|
||||
$lang->resource->task->batchCreate = 'batchCreate';
|
||||
$lang->resource->task->batchEdit = 'batchEdit';
|
||||
$lang->resource->task->batchClose = 'batchClose';
|
||||
$lang->resource->task->batchCancel = 'batchCancel';
|
||||
$lang->resource->task->batchAssignTo = 'batchAssignTo';
|
||||
$lang->resource->task->batchChangeModule = 'batchChangeModule';
|
||||
$lang->resource->task->activate = 'activate';
|
||||
$lang->resource->task->delete = 'delete';
|
||||
$lang->resource->task->view = 'view';
|
||||
@@ -381,7 +383,6 @@ $lang->resource->task->recordEstimate = 'recordEstimate';
|
||||
$lang->resource->task->editEstimate = 'editEstimate';
|
||||
$lang->resource->task->deleteEstimate = 'deleteEstimate';
|
||||
$lang->resource->task->report = 'reportChart';
|
||||
$lang->resource->task->batchChangeModule = 'batchChangeModule';
|
||||
|
||||
$lang->task->methodOrder[5] = 'create';
|
||||
$lang->task->methodOrder[10] = 'batchCreate';
|
||||
|
||||
@@ -56,6 +56,7 @@ js::set('browseType', $browseType);
|
||||
<?php
|
||||
$canBatchEdit = common::hasPriv('task', 'batchEdit');
|
||||
$canBatchClose = (common::hasPriv('task', 'batchClose') && strtolower($browseType) != 'closedBy');
|
||||
$canBatchCancel = common::hasPriv('task', 'batchCancel');
|
||||
$canBatchChangeModule = common::hasPriv('task', 'batchChangeModule');
|
||||
$canBatchAssignTo = common::hasPriv('task', 'batchAssignTo');
|
||||
if(count($tasks))
|
||||
@@ -69,10 +70,15 @@ js::set('browseType', $browseType);
|
||||
echo html::commonButton($lang->edit, $misc);
|
||||
echo "<button id='moreAction' type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
|
||||
echo "<ul class='dropdown-menu' id='moreActionMenu'>";
|
||||
|
||||
$actionLink = $this->createLink('task', 'batchClose');
|
||||
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : "class='disabled'";
|
||||
echo "<li>" . html::a('#', $lang->close, '', $misc) . "</li>";
|
||||
|
||||
$actionLink = $this->createLink('task', 'batchCancel');
|
||||
$misc = $canBatchCancel ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : "class='disabled'";
|
||||
echo "<li>" . html::a('#', $lang->task->cancel, '', $misc) . "</li>";
|
||||
|
||||
if($canBatchChangeModule)
|
||||
{
|
||||
$withSearch = count($modules) > 10;
|
||||
|
||||
@@ -850,6 +850,40 @@ class task extends control
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch cancel tasks.
|
||||
*
|
||||
* @param string $skipTaskIdList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCancel()
|
||||
{
|
||||
if($this->post->taskIDList)
|
||||
{
|
||||
$taskIDList = $this->post->taskIDList;
|
||||
unset($_POST['taskIDList']);
|
||||
unset($_POST['assignedTo']);
|
||||
$this->loadModel('action');
|
||||
|
||||
$tasks = $this->task->getByList($taskIDList);
|
||||
foreach($tasks as $taskID => $task)
|
||||
{
|
||||
if($task->status == 'done' or $task->status == 'closed' or $task->status == 'cancel') continue;
|
||||
|
||||
$changes = $this->task->cancel($taskID);
|
||||
if($changes)
|
||||
{
|
||||
$actionID = $this->action->create('task', $taskID, 'Canceled', '');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->task->sendmail($taskID, $actionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch close tasks.
|
||||
*
|
||||
|
||||
@@ -14,6 +14,8 @@ $lang->task->create = "Create";
|
||||
$lang->task->batchCreate = "Batch Create";
|
||||
$lang->task->batchEdit = "Batch Edit";
|
||||
$lang->task->batchChangeModule = "Batch Change Module";
|
||||
$lang->task->batchClose = "Batch Close";
|
||||
$lang->task->batchCancel = "Batch Cancel";
|
||||
$lang->task->edit = "Update";
|
||||
$lang->task->delete = "Delete";
|
||||
$lang->task->deleted = "Deleted";
|
||||
@@ -26,7 +28,6 @@ $lang->task->restart = "Continue";
|
||||
$lang->task->finish = "Finish";
|
||||
$lang->task->pause = "Pause";
|
||||
$lang->task->close = "Close";
|
||||
$lang->task->batchClose = "Batch Close";
|
||||
$lang->task->cancel = "Cancel";
|
||||
$lang->task->activate = "Activate";
|
||||
$lang->task->export = "Export Data";
|
||||
|
||||
@@ -14,6 +14,8 @@ $lang->task->create = "建任务";
|
||||
$lang->task->batchCreate = "批量添加";
|
||||
$lang->task->batchEdit = "批量编辑";
|
||||
$lang->task->batchChangeModule = "批量修改模块";
|
||||
$lang->task->batchClose = "批量关闭";
|
||||
$lang->task->batchCancel = "批量取消";
|
||||
$lang->task->edit = "编辑";
|
||||
$lang->task->delete = "删除";
|
||||
$lang->task->deleted = "已删除";
|
||||
@@ -26,7 +28,6 @@ $lang->task->restart = "继续";
|
||||
$lang->task->finish = "完成";
|
||||
$lang->task->pause = "暂停";
|
||||
$lang->task->close = "关闭";
|
||||
$lang->task->batchClose = "批量关闭";
|
||||
$lang->task->cancel = "取消";
|
||||
$lang->task->activate = "激活";
|
||||
$lang->task->export = "导出数据";
|
||||
|
||||
Reference in New Issue
Block a user