* Code for details.
This commit is contained in:
@@ -232,8 +232,9 @@ class kanban extends control
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$order = $position == 'left' ? $column->order : $column->order + 1;
|
||||
$this->kanban->createColumn($column->region, null, $order);
|
||||
$order = $position == 'left' ? $column->order : $column->order + 1;
|
||||
$columnID = $this->kanban->createColumn($column->region, null, $order);
|
||||
$this->loadModel('action')->create('kanbanColumn', $columnID, 'Created');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent', 'callback' => 'closeModalAndUpdateKanban', 'callback_params' => $column->region));
|
||||
|
||||
@@ -1,27 +1,24 @@
|
||||
$(document).ready(function()
|
||||
$(function()
|
||||
{
|
||||
$.setAjaxForm('#createColumnForm');
|
||||
|
||||
initColorPicker();
|
||||
|
||||
$(document).on('click', '#noLimit', function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$(this).parents('td').find('input[name^=limit]').val('');
|
||||
$(this).parents('td').find('input[name^=limit]').attr('readonly', true);
|
||||
}
|
||||
$('#noLimit').click(function()
|
||||
{
|
||||
if($(this).attr('checked') == 'checked')
|
||||
{
|
||||
$('#WIPCount').val('');
|
||||
$('#WIPCount').attr('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).parents('td').find('input[name^=limit]').removeAttr('readonly');
|
||||
}
|
||||
});
|
||||
});
|
||||
{
|
||||
$('#WIPCount').removeAttr('disabled');
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function setWIPLimit()
|
||||
{
|
||||
var count = $('#WIPCount').val();
|
||||
if($('#noLimit').attr('checked') == 'checked') count = -1;;
|
||||
if($('#noLimit').attr('checked') == 'checked') count = -1;
|
||||
|
||||
$('#limit').val(count);
|
||||
}
|
||||
|
||||
+10
-6
@@ -209,6 +209,7 @@ class kanbanModel extends model
|
||||
->add('region', $regionID)
|
||||
->setIF($order, 'order', $order)
|
||||
->setDefault('color', '#272E33')
|
||||
->remove('WIPCount,noLimit')
|
||||
->get();
|
||||
if(!$order)
|
||||
{
|
||||
@@ -220,9 +221,16 @@ 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))
|
||||
{
|
||||
dao::$errors['limit'] = $this->lang->kanban->error->mustBeInt;
|
||||
return false;
|
||||
}
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$limit = (int)$column->limit;
|
||||
$column->limit = (int)$column->limit;
|
||||
|
||||
$limit = $column->limit;
|
||||
if(!empty($column->parent))
|
||||
{
|
||||
/* Create a child column. */
|
||||
@@ -250,8 +258,6 @@ class kanbanModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$column->limit = (int)$column->limit;
|
||||
|
||||
if($order)
|
||||
{
|
||||
/* It means copy a column or insert a column before or after a column. */
|
||||
@@ -273,8 +279,6 @@ class kanbanModel extends model
|
||||
$maxType = $this->dao->select('type')->from(TABLE_KANBANCOLUMN)->where('`group`')->eq($column->group)->orderBy('type_desc')->limit(1)->fetch('type');
|
||||
$this->dao->update(TABLE_KANBANCOLUMN)->set('type')->eq($maxType + 1)->where('id')->eq($columnID)->exec();
|
||||
|
||||
$this->loadModel('action')->create('kanbanColumn', $columnID, 'Created');
|
||||
|
||||
return $columnID;
|
||||
}
|
||||
|
||||
@@ -679,7 +683,7 @@ class kanbanModel extends model
|
||||
{
|
||||
$table = $this->config->objectTables[$objectType];
|
||||
$objects = $this->dao->select('*')->from($table)->fetchAll('id');
|
||||
$spaceOwnerPairs = $this->dao->select('id,owner')->from(TABLE_KANBANSPACE)->fetchPairs();
|
||||
$spaceOwnerPairs = $objectType == 'kanban' ? $this->dao->select('id,owner')->from(TABLE_KANBANSPACE)->fetchPairs() : array();
|
||||
|
||||
if($this->app->user->admin) return array_keys($objects);
|
||||
|
||||
|
||||
@@ -30,10 +30,11 @@
|
||||
<td>
|
||||
<div class='required required-wrapper'></div>
|
||||
<div class='input-group'>
|
||||
<?php echo html::number('limit', '', "min='1' class='form-control'" . ($column->limit ? '' : "readonly"));?>
|
||||
<?php echo html::input('WIPCount', $column->limit != -1 ? $column->limit : '', "class='form-control'" . ($column->limit > 0 ? '' : "disabled"));?>
|
||||
<?php echo html::hidden('limit', $column->limit, "class='form-control'");?>
|
||||
<span class='input-group-addon'>
|
||||
<label class='checkbox-inline'>
|
||||
<input type='checkbox' name='noLimit' id='noLimit' value='-1' <?php if(!$column->limit) echo "checked";?>/> <?php echo $this->lang->kanban->noLimit;?>
|
||||
<input type='checkbox' name='noLimit' id='noLimit' value='-1' <?php if($column->limit == -1) echo "checked";?>/> <?php echo $this->lang->kanban->noLimit;?>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user