* Finish task #44361.
This commit is contained in:
@@ -40,6 +40,7 @@ class execution extends control
|
||||
|
||||
$this->loadModel('project');
|
||||
|
||||
if(IN_UPGRADE) return false;
|
||||
$this->executions = $this->execution->getPairs(0, 'all', 'nocode');
|
||||
$skipCreateStep = array('computeburn', 'ajaxgetdropmenu', 'executionkanban', 'ajaxgetteammembers');
|
||||
if(!in_array($this->methodName, $skipCreateStep) and $this->app->tab == 'execution')
|
||||
@@ -3317,4 +3318,20 @@ class execution extends control
|
||||
$groups = $this->lang->kanban->group->$type;
|
||||
die(html::select("group", $groups, $group, 'class="form-control chosen" data-max_drop_width="215"'));
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX: Update the execution name.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param string $newExecutionName
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function ajaxUpdateExecutionName($executionID, $newExecutionName)
|
||||
{
|
||||
$this->dao->update(TABLE_EXECUTION)->set('name')->eq($newExecutionName)->where('id')->eq($executionID)->exec();
|
||||
if(dao::isError()) echo false;
|
||||
|
||||
echo true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1167,9 +1167,28 @@ $(function()
|
||||
$(this).parents('.sprintItem').next('.sprintRename').removeClass('hidden');
|
||||
})
|
||||
|
||||
$('.sprintRename button.name-confirm').click(function()
|
||||
{
|
||||
var execution = $(this).parent().siblings('input').attr('name').split('_');
|
||||
var newExecutionName = $(this).parent().siblings('input').val();
|
||||
var link = createLink('execution', 'ajaxUpdateExecutionName', 'executionID=' + execution[1] + '&newExecutionName=' + newExecutionName);
|
||||
var $this = $(this);
|
||||
|
||||
$.post(link, function(data)
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
$this.closest('.sprintRename').addClass('hidden');
|
||||
$this.closest('.sprintRename').prev('.sprintItem').removeClass('hidden').find('.checkbox-primary label').text(newExecutionName);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
$('.sprintRename button.name-cancel').click(function()
|
||||
{
|
||||
var oldValue = $(this).closest('.sprintRename').prev('.sprintItem').find('.checkbox-primary label').text();
|
||||
$(this).closest('.sprintRename').addClass('hidden');
|
||||
$(this).closest('.sprintRename').prev('.sprintItem').removeClass('hidden');
|
||||
$(this).parent().siblings('input').val(oldValue);
|
||||
})
|
||||
})
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<a href='#' id='sprintEdit' class='hidden'><i class="icon-common-edit icon-edit muted"></i></a>
|
||||
</div>
|
||||
<div class="sprintRename hidden">
|
||||
<?php echo html::input("sprintRename[$sprint->id]", $sprint->name, "class='form-control'");?>
|
||||
<?php echo html::input("sprintRename_$sprint->id", $sprint->name, "class='form-control'");?>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-success name-confirm"><i class='icon icon-check'></i></button>
|
||||
<button type="button" class="btn btn-gray name-cancel"><i class='icon icon-close'></i></button>
|
||||
|
||||
Reference in New Issue
Block a user