* Finish task #46670.

This commit is contained in:
孙广明
2021-12-30 16:04:32 +08:00
parent 9b2df17e26
commit e9c8da2f1e
6 changed files with 77 additions and 13 deletions

View File

@@ -10,5 +10,6 @@ $config->productplan->start->requiredFields = 'begin,end';
$config->productplan->editor = new stdclass();
$config->productplan->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
$config->productplan->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
$config->productplan->editor->start = array('id' => 'desc', 'tools' => 'simpleTools');
$config->productplan->laneColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#FFC20E', '#00A78E', '#7FBB00', '#424BAC', '#C0E9FF', '#EC2761');

View File

@@ -420,6 +420,7 @@ class productplan extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess,'locate' => 'parent'));
}
$this->view->plan = $plan;
$this->display();
}

View File

@@ -198,8 +198,7 @@ function findDropColumns($element, $root)
var $col = $element.closest('.kanban-col');
var col = $col.data();
var lane = $col.closest('.kanban-lane').data();
var kanbanID = $root.data('id');
var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules[kanbanID] : null;
var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules : null;
if(!kanbanRules) return $root.find('.kanban-lane[data-id="' + lane.id + '"] .kanban-lane-col:not([data-type="project"],[data-type="' + col.type + '"])');
@@ -251,6 +250,50 @@ function handleFinishDrop(event)
function changeCardColType(card, fromColType, toColType, kanbanID)
{
if(typeof card == 'undefined') return false;
var objectID = card.id;
var privs = card.actions;
var showIframe = false;
var link = '';
if(toColType == 'doing')
{
if(fromColType == 'wait' && privs.includes('start'))
{
var link = createLink('productplan', 'start', 'planID=' + objectID, '', true);
showIframe = true;
}
else if((fromColType == 'done' || fromColType == 'closed') && privs.includes('activate'))
{
var link = createLink('productplan', 'activate', 'planID=' + objectID, '', true);
showIframe = false;
}
}
else if(toColType == 'done')
{
if(fromColType == 'doing')
{
var link = createLink('productplan', 'finish', 'planID=' + objectID, '', true);
showIframe = false;
}
}
else if(toColType == 'closed')
{
if(fromColType == 'done')
{
var link = createLink('productplan', 'close', 'planID=' + objectID);
showIframe = false;
}
}
if(showIframe)
{
var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '50%', url: link});
modalTrigger.show();
}
else if(!showIframe && link)
{
hiddenwin.location.href = link;
}
}
/**
@@ -374,3 +417,14 @@ function getPlanID(obj, branch)
}
});
}
if(!window.kanbanDropRules)
{
window.kanbanDropRules =
{
wait: ['doing'],
doing: ['done'],
done: ['doing', 'closed'],
closed: ['doing']
}
}

View File

@@ -521,10 +521,15 @@ class productplanModel extends model
if($status == 'doing' and !empty($_POST))
{
$plan = fixer::input('post')->add('status', $status)->get();
$plan = fixer::input('post')
->add('status', $status)
->stripTags($this->config->productplan->editor->start['id'], $this->config->allowedTags)
->remove('uid')
->get();
$this->checkDate4Plan($oldPlan, $plan->begin, $plan->end);
if(dao::isError()) return false;
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->start['id'], $this->post->uid);
$this->dao->update(TABLE_PRODUCTPLAN)
->data($plan)
@@ -534,6 +539,8 @@ class productplanModel extends model
->where('id')->eq($planID)
->beginIF(isset($parentPlan))->orWhere('id')->eq($oldPlan->parent)->fi()
->exec();
$this->file->updateObjectID($this->post->uid, $planID, 'productplan');
if($parentPlan->status != 'doing') $parentChange = true;
}
elseif($status == 'doing' and isset($parentPlan) and $parentPlan->status != 'doing')
@@ -959,7 +966,7 @@ class productplanModel extends model
if($plan->status != 'done' or $plan->parent < 0) return false;
break;
case 'activate' :
if($plan->status != 'closed' or $plan->parent < 0) return false;
if(($plan->status != 'closed' and $plan->status != 'done') or $plan->parent < 0) return false;
break;
}

View File

@@ -147,12 +147,12 @@
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
{
$class = 'iframe';
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
$attr = "data-id='{$plan->id}' data-width='550px'";
$isOnlyBody = true;
}
common::printIcon('productplan', 'start', "planID=$plan->id", $plan, 'list', 'play', '', $class, $isOnlyBody, $attr, $lang->productplan->start);
common::printIcon('productplan', 'finish', "planID=$plan->id", $plan, 'list', 'checked', '', $class, false, $attr, $lang->productplan->finish);
common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr, $lang->productplan->close);
common::printIcon('productplan', 'start', "planID=$plan->id", $plan, 'list', 'play', '', $class, $isOnlyBody);
common::printIcon('productplan', 'finish', "planID=$plan->id", $plan, 'list', 'checked', '', $class, false, $attr);
common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr);
}
$attr = $plan->expired ? "disabled='disabled'" : '';

View File

@@ -10,11 +10,8 @@
* @link https://www.zentao.net
*/
?>
<style>
.table-form {margin-top: 90px;}
.form-actions {height:160px;}
</style>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -31,7 +28,11 @@
<td colspan='2'><?php echo html::input('end', $plan->end != '2030-01-01' ? formatTime($plan->end) : '', 'class="form-control form-date"');?></td>
</tr>
<tr>
<td colspan='4' class='text-center form-actions'>
<th><?php echo $lang->productplan->desc;?></th>
<td colspan='4'><?php echo html::textarea('desc', $plan->desc, 'class="form-control"');?></td>
</tr>
<tr>
<td colspan='5' class='text-center form-actions'>
<?php echo html::submitButton($lang->productplan->start);?>
<?php echo html::commonButton($lang->cancel, "data-dismiss='modal'", 'btn btn-wide');?>
</td>