diff --git a/module/doc/control.php b/module/doc/control.php index ee4080d9dc..e7a596b74c 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -412,14 +412,15 @@ class doc extends control { $excludedModel = $this->config->vision == 'lite' ? '' : 'kanban'; $objects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', $excludedModel); + $this->view->executions = array(); if($lib->type == 'execution') { $execution = $this->loadModel('execution')->getById($lib->execution); $objectID = $execution->project; $libs = $this->doc->getLibs('execution', $extra = "withObject,$unclosed", $libID, $lib->execution); - $this->view->execution = $execution; + $this->view->execution = $execution; + $this->view->executions = array(0 => '') + $this->execution->getPairs($objectID, 'sprint,stage', 'multiple,leaf,noprefix'); } - $this->view->executions = array(0 => '') + $this->loadModel('execution')->getPairs($objectID, 'sprint,stage', 'multiple,leaf,noprefix'); } elseif($linkType == 'execution') { diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 80eafcf5b6..e452ecb301 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -29,7 +29,12 @@ function loadObjectModules(objectType, objectID, docType) function loadExecutions(projectID) { var link = createLink('project', 'ajaxGetExecutions', "projectID=" + projectID + "&executionID=0&mode=multiple,leaf,noprefix&type=sprint,stage"); - $('#executionBox').load(link, function(){$('#executionBox').find('select').attr('data-placeholder', holders.execution).attr('onchange', "loadObjectModules('execution', this.value)").picker()}); + $('#executionBox').load(link, function() + { + var $extension = $('#executionBox').find('select'); + $extension.attr('data-placeholder', holders.execution).attr('onchange', "loadObjectModules('execution', this.value)").picker(); + if($extension.hasClass('disabled')) $('#executionBox').find('.picker').addClass('disabled'); + }); loadObjectModules('project', projectID); } diff --git a/module/doc/js/create.js b/module/doc/js/create.js index 9fecfc5fec..68a32ef56a 100644 --- a/module/doc/js/create.js +++ b/module/doc/js/create.js @@ -6,6 +6,7 @@ $(function() setTimeout(function(){$('.CodeMirror').height($(document).height() - 112);}, 100); $('iframe.ke-edit-iframe').contents().find('.article-content').css('padding', '20px 20px 0 20px'); + if(objectType == 'project') loadExecutions($('#project').val()); setSavePath(); /* Change for show create error. */ diff --git a/module/doc/view/createtexttype.html.php b/module/doc/view/createtexttype.html.php index 26fdcaf4c9..efcb8f3c01 100644 --- a/module/doc/view/createtexttype.html.php +++ b/module/doc/view/createtexttype.html.php @@ -149,6 +149,7 @@ doc->textTypes);?> + doc->placeholder);?> doc->create->requiredFields . ',');?> diff --git a/module/project/control.php b/module/project/control.php index 7ec9d24580..bf15f03908 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -2348,16 +2348,19 @@ class project extends control * @param int $projectID * @param int $executionID * @param string $mode - * @param string $type + * @param string $type all|sprint|stage|kanban * @access public * @return void */ public function ajaxGetExecutions($projectID, $executionID = 0, $mode = '', $type = 'all') { + $project = $this->project->getById($projectID); $executions = array('' => '') + $this->loadModel('execution')->getPairs($projectID, $type, $mode); if($this->app->getViewType() == 'json') return print(json_encode($executionList)); - return print(html::select('execution', $executions, $executionID, "class='form-control'")); + + $disabled = $project->multiple ? '' : 'disabled'; + return print(html::select('execution', $executions, $executionID, "class='form-control $disabled' $disabled")); } /**