* Modify kanban set validate.
This commit is contained in:
+13
-13
@@ -1124,24 +1124,24 @@ class executionModel extends model
|
||||
public function setKanban($executionID)
|
||||
{
|
||||
$execution = fixer::input('post')
|
||||
->setDefault('colWidth', 0)
|
||||
->setDefault('minColWidth', 0)
|
||||
->setDefault('maxColWidth', 0)
|
||||
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
|
||||
->remove('heightType')
|
||||
->get();
|
||||
|
||||
if(isset($_POST['heightType']) and $this->post->heightType == 'custom' and !$this->loadModel('kanban')->checkDisplayCards($execution->displayCards)) return;
|
||||
if($this->post->fluidBoard == '0' and empty($execution->colWidth))
|
||||
{
|
||||
$execution->colWidth = 264;
|
||||
}
|
||||
if($this->post->fluidBoard)
|
||||
{
|
||||
if(empty($execution->minColWidth)) $execution->minColWidth = 180;
|
||||
if(empty($execution->maxColWidth)) $execution->maxColWidth = 384;
|
||||
}
|
||||
$this->dao->update(TABLE_EXECUTION)->data($execution)->checkIF($execution->fluidBoard , 'maxColWidth', 'ge', $execution->minColWidth)->where('id')->eq((int)$executionID)->exec();
|
||||
|
||||
$this->app->loadLang('kanban');
|
||||
$this->lang->project->colWidth = $this->lang->kanban->colWidth;
|
||||
$this->lang->project->minColWidth = $this->lang->kanban->minColWidth;
|
||||
$this->lang->project->maxColWidth = $this->lang->kanban->maxColWidth;
|
||||
$this->dao->update(TABLE_EXECUTION)->data($execution)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->kanban->edit->requiredFields, 'notempty')
|
||||
->checkIF(!$execution->fluidBoard, 'colWidth', 'gt', 0)
|
||||
->batchCheckIF($execution->fluidBoard, 'minColWidth,maxColWidth', 'gt', 0)
|
||||
->checkIF($execution->minColWidth and $execution->maxColWidth and $execution->fluidBoard, 'maxColWidth', 'ge', $kanban->minColWidth)
|
||||
->where('id')->eq((int)$executionID)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user