Merge branch 'sprint/wangzemei/28234' into 'master'

* fix bug 28234 & 28215

See merge request easycorp/zentaopms!5635
This commit is contained in:
李玉春
2022-09-30 01:29:10 +00:00
8 changed files with 56 additions and 46 deletions
+1 -10
View File
@@ -2,14 +2,5 @@ $(function()
{
var heightType = $("[name='heightType']:checked").val();
setCardCount(heightType);
$('#colWidth, #minColWidth, #maxColWidth').attr('onkeyup', 'value=value.match(/^\\d+$/) ? value : ""');
$('#colWidth, #minColWidth, #maxColWidth').attr('maxlength', '3');
var fluidBoard = $("#mainContent input[name='fluidBoard'][checked='checked']").val() || 0;
$('#colWidth').attr('disabled', fluidBoard == 1);
$('#minColWidth, #maxColWidth').attr('disabled', fluidBoard == 0);
$(document).on('change', "#mainContent input[name='fluidBoard']", function(e)
{
$('#colWidth').attr('disabled', e.target.value == 1);
$('#minColWidth, #maxColWidth').attr('disabled', e.target.value == 0);
})
handleKanbanWidthAttr();
});
+5 -5
View File
@@ -23,15 +23,15 @@
<tr>
<th><?php echo $lang->kanban->columnWidth;?></th>
<td colspan='2'>
<div class="radio-col">
<div class="width-radio-row">
<?php echo html::radio('fluidBoard', array(0 => $lang->kanbancolumn->fluidBoardList['0']), "class='inline-block'", $execution->fluidBoard);?>
<?php echo html::input('colWidth', !empty($execution->colWidth) ? $execution->colWidth : $this->config->colWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->colWidth}' autocomplete='off'");?>px
<?php echo html::input('colWidth', !empty($execution->colWidth) ? $execution->colWidth : $this->config->colWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->colWidth}' autocomplete='off'");?>px
</div>
<div class="radio-col mt10">
<div class="width-radio-row mt10">
<?php echo html::radio('fluidBoard', array(1 => $lang->kanbancolumn->fluidBoardList['1']), "class='inline-block'", $execution->fluidBoard);?>
<?php echo html::input('minColWidth', !empty($execution->minColWidth) ? $execution->minColWidth: $this->config->minColWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->minColWidth}' autocomplete='off'");?>px
<?php echo html::input('minColWidth', !empty($execution->minColWidth) ? $execution->minColWidth: $this->config->minColWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->minColWidth}' autocomplete='off'");?>px
<span class="input-divider">~</span>
<?php echo html::input('maxColWidth', !empty($execution->maxColWidth) ? $execution->maxColWidth: $this->config->maxColWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->maxColWidth}' autocomplete='off'");?>px
<?php echo html::input('maxColWidth', !empty($execution->maxColWidth) ? $execution->maxColWidth: $this->config->maxColWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->maxColWidth}' autocomplete='off'");?>px
</div>
</td>
</tr>
+1 -10
View File
@@ -49,16 +49,7 @@ $(function()
{
setCopyKanban($(this).data('id')); $('#copyKanbanModal').modal('hide');
});
$('#colWidth, #minColWidth, #maxColWidth').attr('onkeyup', 'value=value.match(/^\\d+$/) ? value : ""');
$('#colWidth, #minColWidth, #maxColWidth').attr('maxlength', '3');
var fluidBoard = $("#mainContent input[name='fluidBoard'][checked='checked']").val() || 0;
$('#colWidth').attr('disabled', fluidBoard == 1);
$('#minColWidth, #maxColWidth').attr('disabled', fluidBoard == 0);
$(document).on('change', "#mainContent input[name='fluidBoard']", function(e)
{
$('#colWidth').attr('disabled', e.target.value == 1);
$('#minColWidth, #maxColWidth').attr('disabled', e.target.value == 0);
})
handleKanbanWidthAttr();
})
/**
+1 -10
View File
@@ -39,16 +39,7 @@ $(function()
return false;
}
})
$('#colWidth, #minColWidth, #maxColWidth').attr('onkeyup', 'value=value.match(/^\\d+$/) ? value : ""');
$('#colWidth, #minColWidth, #maxColWidth').attr('maxlength', '3');
var fluidBoard = $("#mainContent input[name='fluidBoard'][checked='checked']").val() || 0;
$('#colWidth').attr('disabled', fluidBoard == 1);
$('#minColWidth, #maxColWidth').attr('disabled', fluidBoard == 0);
$(document).on('change', "#mainContent input[name='fluidBoard']", function(e)
{
$('#colWidth').attr('disabled', e.target.value == 1);
$('#minColWidth, #maxColWidth').attr('disabled', e.target.value == 0);
})
handleKanbanWidthAttr();
})
/**
+5 -5
View File
@@ -67,15 +67,15 @@
<tr>
<th class='columnWidth'><?php echo $lang->kanban->columnWidth;?></th>
<td colspan='2'>
<div class="radio-col">
<div class="width-radio-row">
<?php echo html::radio('fluidBoard', array(0 => $lang->kanbancolumn->fluidBoardList['0']), isset($copyKanban->fluidBoard) ? $copyKanban->fluidBoard : 0);?>
<?php echo html::input('colWidth', !empty($copyKanban->colWidth) ? $copyKanban->colWidth : $this->config->colWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->colWidth}' autocomplete='off'");?>px
<?php echo html::input('colWidth', !empty($copyKanban->colWidth) ? $copyKanban->colWidth : $this->config->colWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->colWidth}' autocomplete='off'");?>px
</div>
<div class="radio-col mt10">
<div class="width-radio-row mt10">
<?php echo html::radio('fluidBoard', array(1 => $lang->kanbancolumn->fluidBoardList['1']), isset($copyKanban->fluidBoard) ? $copyKanban->fluidBoard : 0);?>
<?php echo html::input('minColWidth', !empty($copyKanban->minColWidth) ? $copyKanban->minColWidth: $this->config->minColWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->minColWidth}' autocomplete='off'");?>px
<?php echo html::input('minColWidth', !empty($copyKanban->minColWidth) ? $copyKanban->minColWidth: $this->config->minColWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->minColWidth}' autocomplete='off'");?>px
<span class="input-divider">~</span>
<?php echo html::input('maxColWidth', !empty($copyKanban->maxColWidth) ? $copyKanban->maxColWidth: $this->config->maxColWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->maxColWidth}' autocomplete='off'");?>px
<?php echo html::input('maxColWidth', !empty($copyKanban->maxColWidth) ? $copyKanban->maxColWidth: $this->config->maxColWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->maxColWidth}' autocomplete='off'");?>px
</div>
</td>
</tr>
+5 -5
View File
@@ -28,15 +28,15 @@
<tr>
<th class='columnWidth'><?php echo $lang->kanban->columnWidth;?></th>
<td colspan='2'>
<div class="radio-col">
<div class="width-radio-row">
<?php echo html::radio('fluidBoard', array(0 => $lang->kanbancolumn->fluidBoardList['0']), $kanban->fluidBoard);?>
<?php echo html::input('colWidth', !empty($kanban->colWidth) ? $kanban->colWidth : $this->config->colWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->colWidth}' autocomplete='off'");?>px
<?php echo html::input('colWidth', !empty($kanban->colWidth) ? $kanban->colWidth : $this->config->colWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->colWidth}' autocomplete='off'");?>px
</div>
<div class="radio-col mt10">
<div class="width-radio-row mt10">
<?php echo html::radio('fluidBoard', array(1 => $lang->kanbancolumn->fluidBoardList['1']), $kanban->fluidBoard);?>
<?php echo html::input('minColWidth', !empty($kanban->minColWidth) ? $kanban->minColWidth : $this->config->minColWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->minColWidth}' autocomplete='off'");?>px
<?php echo html::input('minColWidth', !empty($kanban->minColWidth) ? $kanban->minColWidth : $this->config->minColWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->minColWidth}' autocomplete='off'");?>px
<span class="input-divider">~</span>
<?php echo html::input('maxColWidth', !empty($kanban->maxColWidth) ? $kanban->maxColWidth : $this->config->maxColWidth, "class='form-control inline-block setting-input' required placeholder='{$this->config->maxColWidth}' autocomplete='off'");?>px
<?php echo html::input('maxColWidth', !empty($kanban->maxColWidth) ? $kanban->maxColWidth : $this->config->maxColWidth, "class='form-control inline-block setting-input' placeholder='{$this->config->maxColWidth}' autocomplete='off'");?>px
</div>
</td>
</tr>
+36
View File
@@ -1329,3 +1329,39 @@ function refreshBudgetUnit(data)
$('#future').prop('checked', false);
}
}
/**
* Handle radio logic of Kanban column width setting.
*
* @access public
* @return void
*/
function handleKanbanWidthAttr ()
{
$('#colWidth, #minColWidth, #maxColWidth').attr('onkeyup', 'value=value.match(/^\\d+$/) ? value : ""');
$('#colWidth, #minColWidth, #maxColWidth').attr('maxlength', '3');
var fluidBoard = $("#mainContent input[name='fluidBoard'][checked='checked']").val() || 0;
var addAttrEle = fluidBoard == 0 ? '#colWidth' : '#minColWidth, #maxColWidth';
$(addAttrEle).closest('.width-radio-row').addClass('required');
$('#colWidth').attr('disabled',fluidBoard == 1);
$('#minColWidth, #maxColWidth').attr('disabled',fluidBoard == 0);
$(document).on('change', "#mainContent input[name='fluidBoard']", function(e)
{
$('#colWidth').attr('disabled', e.target.value == 1);
$('#minColWidth, #maxColWidth').attr('disabled', e.target.value == 0);
if(e.target.value == 0 && $('#minColWidthLabel, #maxColWidthLabel'))
{
$('#colWidth').closest('.width-radio-row').addClass('required');
$('#minColWidth, #maxColWidth').closest('.width-radio-row').removeClass('required');
$('#minColWidthLabel, #maxColWidthLabel').remove();
$('#minColWidth, #maxColWidth').removeClass('has-error');
}
else if(e.target.value == 1 && $('#colWidthLabel'))
{
$('#minColWidth, #maxColWidth').closest('.width-radio-row').addClass('required');
$('#colWidth').closest('.width-radio-row').removeClass('required');
$('#colWidthLabel').remove();
$('#colWidth').removeClass('has-error');
}
})
}
+2 -1
View File
@@ -122,7 +122,8 @@ body.xxc-embed.m-productplan-view,body.xxc-embed.m-bug-browse,body.xxc-embed.m-p
.input-divider {margin: 0 4px;}
.setting-input {width: 64px; height: 20px; margin: 0 4px; text-align: center;}
.setting-input.disabled,.setting-input[disabled="disabled"] {color: #C4C4C4;}
.radio-col {display: flex;}
.width-radio-row {display: flex;}
#dataform .width-radio-row.required:after {top: 1px; left: 360px;}
.mt10 {margin-top: 10px;}