Merge branch 'sprint/183_tianshujie_47981' into 'master'

* Finish task #47981.

See merge request easycorp/zentaopms!1495
This commit is contained in:
王怡栋
2022-01-19 05:48:00 +00:00
3 changed files with 30 additions and 6 deletions
+4 -2
View File
@@ -678,14 +678,16 @@ class kanban extends control
{
if($_POST)
{
$cardID = $this->kanban->createCard($kanbanID, $regionID, $groupID, $laneID, $columnID);
$cardID = $this->kanban->createCard($kanbanID, $regionID, $groupID, $columnID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('kanbancard', $cardID, 'created');
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
$this->view->lanePairs = $this->kanban->getLanePairsByGroup($groupID);
$this->display();
}
+20 -4
View File
@@ -413,12 +413,11 @@ class kanbanModel extends model
* @param int $kanbanID
* @param int $regionID
* @param int $groupID
* @param int $laneID
* @param int $columnID
* @access public
* @return void
*/
public function createCard($kanbanID, $regionID, $groupID, $laneID, $columnID)
public function createCard($kanbanID, $regionID, $groupID, $columnID)
{
if($this->post->estimate < 0)
{
@@ -446,7 +445,7 @@ class kanbanModel extends model
->stripTags($this->config->kanban->editor->createcard['id'], $this->config->allowedTags)
->join('assignedTo', ',')
->setIF(is_numeric($this->post->estimate), 'estimate', (float)$this->post->estimate)
->remove('uid')
->remove('uid,lane')
->get();
$card = $this->loadModel('file')->processImgURL($card, $this->config->kanban->editor->createcard['id'], $this->post->uid);
@@ -461,7 +460,7 @@ class kanbanModel extends model
$cardID = $this->dao->lastInsertID();
$this->file->saveUpload('kanbancard', $cardID);
$this->file->updateObjectID($this->post->uid, $cardID, 'kanbancard');
$this->addKanbanCell($kanbanID, $laneID, $columnID, 'common', $cardID);
$this->addKanbanCell($kanbanID, $this->post->lane, $columnID, 'common', $cardID);
return $cardID;
}
@@ -772,6 +771,23 @@ class kanbanModel extends model
return $laneGroup;
}
/**
* Get kanban lane pairs by group id.
*
* @param int $groupID
* @param string $orderBy
* @access public
* @return array
*/
public function getLanePairsByGroup($groupID, $orderBy = '`order`_asc')
{
return $this->dao->select('id,name')->from(TABLE_KANBANLANE)
->where('deleted')->eq(0)
->andWhere('`group`')->eq($groupID)
->orderBy($orderBy)
->fetchPairs();
}
/**
* Get column group by regions.
*
+6
View File
@@ -42,6 +42,12 @@
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->kanbanlane->common;?></th>
<td colspan='2'>
<?php echo html::select('lane', $lanePairs, key($lanePairs), "class='form-control chosen'");?>
</td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->assignedTo;?></th>
<td colspan='2'>