* Finish task #63692.
This commit is contained in:
@@ -90,14 +90,6 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
<td>
|
||||
<div class='input-group' id='bugTypeInputGroup'>
|
||||
<?php echo html::select('type', $lang->bug->typeList, $type, "class='form-control'");?>
|
||||
<?php if($showOS):?>
|
||||
<span class='input-group-addon fix-border'><?php echo $lang->bug->os?></span>
|
||||
<?php echo html::select('os', $lang->bug->osList, $os, "class='form-control'");?>
|
||||
<?php endif;?>
|
||||
<?php if($showBrowser):?>
|
||||
<span class='input-group-addon fix-border'><?php echo $lang->bug->browser?></span>
|
||||
<?php echo html::select('browser', $lang->bug->browserList, $browser, "class='form-control'");?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
@@ -173,8 +165,6 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($showExecution):?>
|
||||
<?php $showOS = strpos(",$showFields,", ',os,') !== false;?>
|
||||
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->bug->type;?></th>
|
||||
<td>
|
||||
@@ -182,26 +172,39 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
<div class='table-col' id='typeBox'>
|
||||
<?php echo html::select('type', $lang->bug->typeList, $type, "class='form-control chosen'");?>
|
||||
</div>
|
||||
<?php if($showOS):?>
|
||||
<div class='table-col' id='osBox'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon fix-border'><?php echo $lang->bug->os?></span>
|
||||
<?php echo html::select('os', $lang->bug->osList, $os, "class='form-control chosen'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if($showBrowser):?>
|
||||
<div class='table-col'>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon fix-border'><?php echo $lang->bug->browser?></span>
|
||||
<?php echo html::select('browser', $lang->bug->browserList, $browser, "class='form-control chosen'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php $showOS = strpos(",$showFields,", ',os,') !== false;?>
|
||||
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
|
||||
<?php if($showOS or $showBrowser):?>
|
||||
<tr>
|
||||
<?php if($showOS):?>
|
||||
<th><?php echo $lang->bug->os;?></th>
|
||||
<td>
|
||||
<div class='table-row'>
|
||||
<div class='table-col' id='osBox'>
|
||||
<?php echo html::select('os[]', $lang->bug->osList, $os, "class='form-control chosen' multiple");?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<th></th>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<?php if($showBrowser):?>
|
||||
<td>
|
||||
<div class='table-row'>
|
||||
<div class='input-group' id='browserBox'>
|
||||
<span class='input-group-addon'><?php echo $lang->bug->browser?></span>
|
||||
<?php echo html::select('browser[]', $lang->bug->browserList, $browser, "class='form-control chosen' multiple");?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($executionType) and $executionType == 'kanban'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->region;?></th>
|
||||
|
||||
@@ -1731,11 +1731,10 @@ class story extends control
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $projectID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchToTask($executionID = 0, $projectID = 0, $extra = '')
|
||||
public function batchToTask($executionID = 0, $projectID = 0)
|
||||
{
|
||||
if(!empty($_POST['name']))
|
||||
{
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
$(function()
|
||||
{
|
||||
for(var i = 1; i <= storyCount; i ++) setPreview(i);
|
||||
});
|
||||
|
||||
$(document).on('change', "[name^='estStarted'], [name^='deadline']", function()
|
||||
{
|
||||
toggleCheck($(this));
|
||||
})
|
||||
});
|
||||
|
||||
/* Set the story module. */
|
||||
function setStoryRelated(num)
|
||||
{
|
||||
setPreview(num);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle checkbox.
|
||||
@@ -66,15 +67,17 @@ function setStories(moduleID, executionID, num)
|
||||
/* Copy story title as task title. */
|
||||
function copyStoryTitle(num)
|
||||
{
|
||||
var storyTitle = $('#story' + num).find('option:selected').text();
|
||||
var storyValue = $('#story' + num).find('option:selected').val();
|
||||
var $story = $('#story' + num);
|
||||
var storyTitle = $story.find('option:selected').text();
|
||||
var storyValue = $story.find('option:selected').val();
|
||||
var begin = parseInt($story.closest('tr').children('.c-id').text()) - 2;
|
||||
|
||||
if(storyValue === 'ditto')
|
||||
{
|
||||
for(var i = num; i <= num && i >= 1; i--)
|
||||
for(var i = begin; i <= begin && i >= 0; i--)
|
||||
{
|
||||
var selectedValue = $('select[id="story' + i +'"]').val();
|
||||
var selectedTitle = $('select[id="story' + i +'"]').find('option:selected').text();
|
||||
var selectedValue = $('#tableBody tbody > tr').eq(i).find('select[name^="story"]').val();
|
||||
var selectedTitle = $('#tableBody tbody > tr').eq(i).find('select[name^="story"]').find('option:selected').text();
|
||||
if(selectedValue !== 'ditto')
|
||||
{
|
||||
storyTitle = selectedTitle;
|
||||
@@ -102,17 +105,6 @@ function setPreview(num)
|
||||
var storyID = $('#story' + num).val();
|
||||
if(storyID != 0 && storyID != 'ditto')
|
||||
{
|
||||
var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID);
|
||||
$.getJSON(link, function(storyInfo)
|
||||
{
|
||||
$('#module' + num).val(parseInt(storyInfo.moduleID));
|
||||
$('#module' + num).trigger("chosen:updated");
|
||||
|
||||
$('#storyEstimate' + num).val(storyInfo.estimate);
|
||||
$('#storyPri' + num).val(storyInfo.pri);
|
||||
$('#storyDesc' + num).val(storyInfo.spec);
|
||||
});
|
||||
|
||||
storyLink = createLink('story', 'view', "storyID=" + storyID, '', true);
|
||||
$('#preview' + num).removeAttr('disabled');
|
||||
$('#preview' + num).modalTrigger({type:'iframe'});
|
||||
@@ -245,3 +237,54 @@ $(function()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Add row.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function addRow(obj)
|
||||
{
|
||||
var row = $('#addRow').html().replace(/%i%/g, rowIndex + 1);
|
||||
$('<tr class="addedRow">' + row + '</tr>').insertAfter($(obj).closest('tr'));
|
||||
|
||||
var $beginRow = $row = $(obj).closest('tr').next();
|
||||
|
||||
$row.find(".form-date").datepicker();
|
||||
$row.find("input[name^=color]").colorPicker();
|
||||
$row.find('div[id$=_chosen]').remove();
|
||||
$row.find('.picker').remove();
|
||||
$row.find('.chosen').chosen();
|
||||
|
||||
var begin = parseInt($(obj).parent().siblings('.c-id').text()) + 1;
|
||||
var count = $('#tableBody tbody > tr').length;
|
||||
for(var i = begin; i <= count; i++)
|
||||
{
|
||||
$beginRow.children('.c-id').text(i);
|
||||
$beginRow = $beginRow.next();
|
||||
}
|
||||
rowIndex ++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete row.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function deleteRow(obj)
|
||||
{
|
||||
var $beginRow = $(obj).closest('tr').next();
|
||||
var begin = parseInt($(obj).parent().siblings('.c-id').text());
|
||||
var count = $('#tableBody tbody > tr').length;
|
||||
for(var i = begin; i <= count; i++)
|
||||
{
|
||||
$beginRow.children('.c-id').text(i);
|
||||
$beginRow = $beginRow.next();
|
||||
}
|
||||
|
||||
$(obj).closest('tr').remove();
|
||||
}
|
||||
|
||||
@@ -80,9 +80,9 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
|
||||
</td>
|
||||
<td style='overflow: visible'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select("story[$i]", $storyPairs, $currentStory, "class='form-control chosen' onchange='setPreview($i)'");?>
|
||||
<?php echo html::select("story[$i]", $storyPairs, $currentStory, "class='form-control chosen' onchange='setStoryRelated($i)'");?>
|
||||
<span class='input-group-btn'>
|
||||
<a id='preview<?php echo $i;?>' href='#' class='btn iframe btn-link btn-icon btn-copy' style='pointer-events:none' data-width='80%' title='<?php echo $lang->preview;?>'><i class='icon-eye'></i></a>
|
||||
<a id='preview<?php echo $i;?>' href="<?php echo $this->createLink('story', 'view', "storyID=$currentStory", '', true)?>" class='btn iframe btn-link btn-icon btn-copy' data-width='80%' title='<?php echo $lang->preview;?>'><i class='icon-eye'></i></a>
|
||||
<a href='javascript:copyStoryTitle(<?php echo $i;?>)' class='btn btn-link btn-icon btn-copy' title='<?php echo $lang->task->copyStoryTitle; ?>'><i class='icon-arrow-right'></i></a>
|
||||
</span>
|
||||
</div>
|
||||
@@ -153,7 +153,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
|
||||
</td>
|
||||
<td style='overflow: visible'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select("story[$i]", $storyPairs, 'ditto', "class='form-control chosen' onchange='setPreview($i)'");?>
|
||||
<?php echo html::select("story[$i]", $storyPairs, 'ditto', "class='form-control chosen' onchange='setStoryRelated($i)'");?>
|
||||
<span class='input-group-btn'>
|
||||
<a id='preview<?php echo $i;?>' href='#' class='btn iframe btn-link btn-icon btn-copy' style='pointer-events:none' data-width='80%' disabled='disabled' title='<?php echo $lang->preview; ?>'><i class='icon-eye'></i></a>
|
||||
<a href='javascript:copyStoryTitle(<?php echo $i;?>)' class='btn btn-link btn-icon btn-copy' title='<?php echo $lang->task->copyStoryTitle; ?>'><i class='icon-arrow-right'></i></a>
|
||||
|
||||
@@ -128,7 +128,8 @@ function setStoryRelated(num)
|
||||
*/
|
||||
function setPreview(num)
|
||||
{
|
||||
var storyID = $('#story' + num).val();
|
||||
var storyID = $('#story' + num).val();
|
||||
var storyLink = '#';
|
||||
if(storyID != 0 && storyID != 'ditto')
|
||||
{
|
||||
var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID);
|
||||
@@ -136,18 +137,12 @@ function setPreview(num)
|
||||
{
|
||||
$('#module' + num).val(parseInt(storyInfo.moduleID));
|
||||
$('#module' + num).trigger("chosen:updated");
|
||||
|
||||
$('#storyEstimate' + num).val(storyInfo.estimate);
|
||||
$('#storyPri' + num).val(storyInfo.pri);
|
||||
$('#storyDesc' + num).val(storyInfo.spec);
|
||||
});
|
||||
|
||||
storyLink = createLink('story', 'view', "storyID=" + storyID);
|
||||
if(!isonlybody)
|
||||
{
|
||||
var concat = storyLink.indexOf('?') >= 0 ? '&' : '?';
|
||||
storyLink = storyLink + concat + 'onlybody=yes';
|
||||
}
|
||||
var concat = storyLink.indexOf('?') >= 0 ? '&' : '?';
|
||||
storyLink = storyLink + concat + 'onlybody=yes';
|
||||
|
||||
$('#preview' + num).removeAttr('disabled');
|
||||
$('#preview' + num).modalTrigger({type:'iframe'});
|
||||
$('#preview' + num).css('pointer-events', 'auto');
|
||||
@@ -155,7 +150,6 @@ function setPreview(num)
|
||||
}
|
||||
else
|
||||
{
|
||||
storyLink = '#';
|
||||
$('#preview' + num).attr('disabled', true);
|
||||
$('#preview' + num).css('pointer-events', 'none');
|
||||
$('#preview' + num).attr('href', storyLink);
|
||||
|
||||
Reference in New Issue
Block a user