* Finish task #47336,47344,47345.
This commit is contained in:
@@ -862,7 +862,7 @@ class actionModel extends model
|
||||
|
||||
/* Get actions. */
|
||||
$actions = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where(1)
|
||||
->where('objectType')->notIN('kanbanregion,kanbanlane,kanbancolumn')
|
||||
->beginIF($period != 'all')->andWhere('date')->gt($begin)->fi()
|
||||
->beginIF($period != 'all')->andWhere('date')->lt($end)->fi()
|
||||
->beginIF($date)->andWhere('date' . ($direction == 'next' ? '<' : '>') . "'{$date}'")->fi()
|
||||
|
||||
@@ -102,7 +102,7 @@ js::set('hasTaskButton', $hasTaskButton);
|
||||
$actions .= html::a('javascript:;', "<i class='icon icon-cog-outline'></i>" . $lang->kanban->setting, '', "data-toggle='dropdown' class='btn btn-link'");
|
||||
$actions .= "<ul id='kanbanActionMenu' class='dropdown-menu pull-right'>";
|
||||
$width = $this->app->getClientLang() == 'en' ? '70%' : '60%';
|
||||
if(common::hasPriv('kanban', 'createRegion')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$execution->id", '', true), '<i class="icon icon-plus"></i>' . $lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '</li>';
|
||||
if(common::hasPriv('kanban', 'createRegion')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$execution->id&from=execution", '', true), '<i class="icon icon-plus"></i>' . $lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '</li>';
|
||||
if(common::hasPriv('kanban', 'setLaneHeight')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'setLaneHeight', "kanbanID=$execution->id&from=execution", '', true), '<i class="icon icon-size-height"></i>' . $lang->kanban->laneHeight, '', "class='iframe btn btn-link' data-width=$width") . '</li>';
|
||||
$kanbanActions = '';
|
||||
if(common::hasPriv('execution', 'edit')) $kanbanActions .= '<li>' . html::a(helper::createLink('execution', 'edit', "executionID=$execution->id", '', true), '<i class="icon icon-edit"></i>' . $lang->kanban->edit, '', "class='iframe btn btn-link' data-width='75%'") . '</li>';
|
||||
|
||||
@@ -293,18 +293,19 @@ class kanban extends control
|
||||
* Create a region.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @param string $from kanban|execution
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createRegion($kanbanID)
|
||||
public function createRegion($kanbanID, $from = 'kanban')
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$kanban = $this->kanban->getByID($kanbanID);
|
||||
$kanban = $from == 'execution' ? $this->loadModel('execution')->getByID($kanbanID) : $this->kanban->getByID($kanbanID);
|
||||
$copyRegionID = (int)$_POST['region'];
|
||||
unset($_POST['region']);
|
||||
|
||||
$regionID = $this->kanban->createRegion($kanban, '', $copyRegionID);
|
||||
$regionID = $this->kanban->createRegion($kanban, '', $copyRegionID, $from);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
|
||||
@@ -65,10 +65,11 @@ class kanbanModel extends model
|
||||
* @param object $kanban
|
||||
* @param object $region
|
||||
* @param int $copyRegionID
|
||||
* @param string $from kanban|execution
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function createRegion($kanban, $region = null, $copyRegionID = 0)
|
||||
public function createRegion($kanban, $region = null, $copyRegionID = 0, $from = 'kanban')
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
$order = 1;
|
||||
@@ -82,11 +83,11 @@ class kanbanModel extends model
|
||||
$order = $maxOrder ? $maxOrder + 1 : 1;
|
||||
$region = fixer::input('post')
|
||||
->add('kanban', $kanban->id)
|
||||
->add('space', $kanban->space)
|
||||
->add('createdBy', $account)
|
||||
->add('createdDate', helper::now())
|
||||
->trim('name')
|
||||
->get();
|
||||
if($from == 'kanban') $region->space = $kanban->space;
|
||||
}
|
||||
|
||||
$region->order = $order;
|
||||
@@ -151,7 +152,7 @@ class kanbanModel extends model
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif($from == 'kanban')
|
||||
{
|
||||
$groupID = $this->createGroup($kanban->id, $regionID);
|
||||
if(dao::isError()) return false;
|
||||
|
||||
Reference in New Issue
Block a user