Merge branch 'sprint/177_liumengyi_setlane' into 'kanban'

* Fix bug #17537,#17542.

See merge request easycorp/zentaopms!948
This commit is contained in:
孙广明
2021-12-15 02:37:07 +00:00
3 changed files with 21 additions and 11 deletions
+4 -4
View File
@@ -228,10 +228,10 @@ class kanban extends control
if(!empty($_POST))
{
$laneID = $this->kanban->createLane($kanbanID, $regionID, $lane = null);
if(dao::isError()) die(js::error(dao::getError()));
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('kanbanLane', $laneID, 'created');
die(js::reload('parent.parent'));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
$this->view->lanes = $this->kanban->getLanePairsByRegion($regionID);
@@ -254,11 +254,11 @@ class kanban extends control
{
$order = $position == 'left' ? $column->order : $column->order + 1;
$columnID = $this->kanban->createColumn($column->region, null, $order);
if(dao::isError()) $this->send(array('message' => $this->lang->fail, 'result' => 'fail'));
if(dao::isError()) $this->send(array('message' => dao::getError(), 'result' => 'fail'));
$this->loadModel('action')->create('kanbanColumn', $columnID, 'Created');
$this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => 'parent'));
}
}
$this->view->title = $this->lang->kanban->createColumn;
$this->view->column = $column;
+15 -5
View File
@@ -119,6 +119,7 @@ class kanbanModel extends model
->add('space', $kanban->space)
->add('createdBy', $account)
->add('createdDate', helper::today())
->trim('name')
->get();
}
@@ -208,8 +209,10 @@ class kanbanModel extends model
->add('region', $regionID)
->setIF($order, 'order', $order)
->setDefault('color', '#272E33')
->trim('name')
->remove('WIPCount,noLimit')
->get();
if(!$order)
{
$maxOrder = $this->dao->select('MAX(`order`) AS maxOrder')->from(TABLE_KANBANCOLUMN)
@@ -220,7 +223,7 @@ class kanbanModel extends model
}
if(!$column->limit && empty($column->noLimit)) dao::$errors['limit'][] = sprintf($this->lang->error->notempty, $this->lang->kanban->WIP);
if(!preg_match("/^-?\d+$/", $column->limit))
if(!preg_match("/^-?\d+$/", $column->limit) or (!isset($_POST['noLimit']) and $column->limit <= 0))
{
dao::$errors['limit'] = $this->lang->kanban->error->mustBeInt;
return false;
@@ -315,6 +318,7 @@ class kanbanModel extends model
->add('createdBy', $this->app->user->account)
->add('createdDate', $now)
->add('assignedDate', $now)
->trim('name')
->setDefault('estimate', 0)
->setIF(is_numeric($this->post->estimate), 'estimate', (float)$this->post->estimate)
->remove('uid')
@@ -816,6 +820,7 @@ class kanbanModel extends model
->setDefault('createdDate', helper::now())
->join('whitelist', ',')
->join('team', ',')
->trim('name')
->remove('uid,contactListMenu')
->get();
@@ -855,6 +860,7 @@ class kanbanModel extends model
->setDefault('lastEditedDate', helper::now())
->join('whitelist', ',')
->join('team', ',')
->trim('name')
->remove('uid,contactListMenu')
->get();
@@ -912,7 +918,8 @@ class kanbanModel extends model
->add('order', $maxOrder + 1)
->add('lastEditedTime', helper::now())
->add('type', 'common')
->setDefault('color', '#3DC6FD')
->trim('name')
->setDefault('color', '#7ec5ff')
->get();
$mode = zget($lane, 'mode', '');
@@ -954,6 +961,7 @@ class kanbanModel extends model
->setDefault('createdDate', helper::now())
->join('whitelist', ',')
->join('team', ',')
->trim('name')
->remove('uid,contactListMenu')
->get();
@@ -996,6 +1004,7 @@ class kanbanModel extends model
->setDefault('lastEditedDate', helper::now())
->join('whitelist', ',')
->join('team', ',')
->trim('name')
->remove('uid,contactListMenu')
->get();
@@ -1481,7 +1490,7 @@ class kanbanModel extends model
*/
public function updateLaneColumn($columnID, $column)
{
$data = fixer::input('post')->get();
$data = fixer::input('post')->trim('name')->get();
$this->dao->update(TABLE_KANBANCOLUMN)->data($data)
->autoCheck()
@@ -1551,6 +1560,7 @@ class kanbanModel extends model
$card = fixer::input('post')
->add('lastEditedBy', $this->app->user->account)
->add('createdDate', $now)
->trim('name')
->setDefault('estimate', $oldCard->estimate)
->setIF(!empty($this->post->assignedTo) and $oldCard->assignedTo != $this->post->assignedTo, 'assignedDate', $now)
->setIF(is_numeric($this->post->estimate), 'estimate', (float)$this->post->estimate)
@@ -1587,7 +1597,7 @@ class kanbanModel extends model
{
$oldColumn = $this->getColumnById($columnID);
$column = fixer::input('post')->remove('WIPCount,noLimit')->get();
if(!preg_match("/^-?\d+$/", $column->limit) or (!isset($_POST['noLimit']) and $column->limit < 0))
if(!preg_match("/^-?\d+$/", $column->limit) or (!isset($_POST['noLimit']) and $column->limit <= 0))
{
dao::$errors['limit'] = $this->lang->kanban->error->mustBeInt;
return false;
@@ -1655,7 +1665,7 @@ class kanbanModel extends model
*/
public function setLane($laneID)
{
$lane = fixer::input('post')->get();
$lane = fixer::input('post')->trim('name')->get();
$this->dao->update(TABLE_KANBANLANE)->data($lane)
->autoCheck()
+2 -2
View File
@@ -7,7 +7,7 @@
<?php echo $lang->kanban->createLane;?>
</h2>
</div>
<form class='load-indicator main-form' method='post' target='hiddenwin'>
<form class='load-indicator main-form form-ajax' method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr>
@@ -29,7 +29,7 @@
<th><?php echo $lang->kanbanlane->color;?></th>
<td>
<div id='color-picker'></div>
<?php echo html::input('color', '#7EC5FF', "class='hidden'");?>
<?php echo html::input('color', '#7ec5ff', "class='hidden'");?>
</td>
</tr>
<tr>