Merge branch 'dev/gfl_fix_bug' into 'master'
Dev/gfl fix bug See merge request easycorp/zentaopms!7178
This commit is contained in:
@@ -330,7 +330,8 @@ class baseHTML
|
||||
*/
|
||||
static public function hidden($name, $value = "", $attrib = "")
|
||||
{
|
||||
return "<input type='hidden' name='$name' id='$name' value='$value' $attrib />\n";
|
||||
$id = str_replace(array('[', ']'), "", $name);
|
||||
return "<input type='hidden' name='$name' id='$id' value='$value' $attrib />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,7 +348,8 @@ class baseHTML
|
||||
static public function password($name, $value = "", $attrib = "")
|
||||
{
|
||||
if(stripos($attrib, 'autocomplete') === false) $attrib .= " autocomplete='off'";
|
||||
return "<input type='password' name='$name' id='$name' value='$value' $attrib />\n";
|
||||
$id = str_replace(array('[', ']'), "", $name);
|
||||
return "<input type='password' name='$name' id='$id' value='$value' $attrib />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,6 +366,7 @@ class baseHTML
|
||||
static public function textarea($name, $value = "", $attrib = "")
|
||||
{
|
||||
$id = "id='$name'";
|
||||
$id = str_replace(array('[', ']'), "", $id);
|
||||
if(strpos($attrib, 'id=') !== false) $id = '';
|
||||
return "<textarea name='$name' $id $attrib>$value</textarea>\n";
|
||||
}
|
||||
@@ -397,8 +400,9 @@ class baseHTML
|
||||
*/
|
||||
static public function date($name, $value = "", $options = '', $attrib = '')
|
||||
{
|
||||
$html = "<div class='input-append date date-picker' {$options}>";
|
||||
$html .= "<input type='text' name='{$name}' id='$name' value='$value' {$attrib} />\n";
|
||||
$id = str_replace(array('[', ']'), "", $name);
|
||||
$html = "<div class='input-append date date-picker' {$options}>";
|
||||
$html .= "<input type='text' name='{$name}' id='$id' value='$value' {$attrib} />\n";
|
||||
$html .= "<span class='add-on'><button class='btn' type='button'><i class='icon-calendar'></i></button></span></div>";
|
||||
return $html;
|
||||
}
|
||||
@@ -417,8 +421,9 @@ class baseHTML
|
||||
*/
|
||||
static public function dateTime($name, $value = "", $options = '', $attrib = '')
|
||||
{
|
||||
$html = "<div class='input-append date time-picker' {$options}>";
|
||||
$html .= "<input type='text' name='{$name}' id='$name' value='$value' {$attrib} />\n";
|
||||
$id = str_replace(array('[', ']'), "", $name);
|
||||
$html = "<div class='input-append date time-picker' {$options}>";
|
||||
$html .= "<input type='text' name='{$name}' id='$id' value='$value' {$attrib} />\n";
|
||||
$html .= "<span class='add-on'><button class='btn' type='button'><i class='icon-calendar'></i></button></span></div>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ class html extends baseHTML
|
||||
static public function input($name, $value = "", $attrib = "", $autocomplete = false)
|
||||
{
|
||||
$id = "id='$name'";
|
||||
$id = str_replace(array('[', ']'), "", $id);
|
||||
if(strpos($attrib, 'id=') !== false) $id = '';
|
||||
if(is_null($value)) $value = '';
|
||||
$value = str_replace("'", ''', $value);
|
||||
@@ -207,6 +208,7 @@ class html extends baseHTML
|
||||
static public function number($name, $value = '', $attrib = '')
|
||||
{
|
||||
$id = "id='$name'";
|
||||
$id = str_replace(array('[', ']'), "", $id);
|
||||
if(strpos($attrib, 'id=') !== false) $id = '';
|
||||
$value = str_replace("'", ''', $value);
|
||||
return "<input type='number' name='$name' {$id} value='$value' $attrib />\n";
|
||||
|
||||
@@ -165,8 +165,8 @@ $lang->my->common = 'My';
|
||||
$lang->todo->common = 'Todo';
|
||||
$lang->block->common = 'InfoBlock';
|
||||
$lang->program->common = 'Program';
|
||||
$lang->product->common = 'Product';
|
||||
$lang->project->common = 'Project';
|
||||
$lang->product->common = $lang->productCommon;
|
||||
$lang->project->common = $lang->projectCommon;
|
||||
$lang->execution->common = 'Execution';
|
||||
$lang->kanban->common = 'Kanban';
|
||||
$lang->qa->common = 'QA';
|
||||
|
||||
@@ -165,8 +165,8 @@ $lang->my->common = 'My';
|
||||
$lang->todo->common = 'Todo';
|
||||
$lang->block->common = 'Block';
|
||||
$lang->program->common = 'Program';
|
||||
$lang->product->common = 'Product';
|
||||
$lang->project->common = 'Project';
|
||||
$lang->product->common = $lang->productCommon;
|
||||
$lang->project->common = $lang->projectCommon;
|
||||
$lang->execution->common = 'Execution';
|
||||
$lang->kanban->common = 'Kanban';
|
||||
$lang->qa->common = 'QA';
|
||||
|
||||
@@ -165,8 +165,8 @@ $lang->my->common = 'My';
|
||||
$lang->todo->common = 'Agenda';
|
||||
$lang->block->common = 'Bloc';
|
||||
$lang->program->common = 'Program';
|
||||
$lang->product->common = 'Product';
|
||||
$lang->project->common = 'Project';
|
||||
$lang->product->common = $lang->productCommon;
|
||||
$lang->project->common = $lang->projectCommon;
|
||||
$lang->execution->common = 'Execution';
|
||||
$lang->kanban->common = 'Kanban';
|
||||
$lang->qa->common = 'QA';
|
||||
|
||||
@@ -165,8 +165,8 @@ $lang->my->common = '地盘';
|
||||
$lang->todo->common = '待办';
|
||||
$lang->block->common = '区块';
|
||||
$lang->program->common = '项目集';
|
||||
$lang->product->common = '产品';
|
||||
$lang->project->common = '项目';
|
||||
$lang->product->common = $lang->productCommon;
|
||||
$lang->project->common = $lang->projectCommon;
|
||||
$lang->execution->common = '执行';
|
||||
$lang->kanban->common = '看板';
|
||||
$lang->qa->common = '测试';
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
.form-item-content {padding-left: 44px;}
|
||||
.form-item-content > .form-item {gap: 64px; height: 56px; align-items: center; position: relative; width: 500px;}
|
||||
.form-item-content > .form-item.w-expand {width: 700px;}
|
||||
.form-item-content > .form-item > .label {flex: 0 0 160px; padding-left: 40px; background: #F8F8F8; display: flex; align-items: center; color: currentColor; font-size: 13px;}
|
||||
.form-item-content > .form-item > .label {flex: 0 0 160px; padding-left: 40px; background: #F8F8F8; display: flex; align-items: center; color: currentColor; font-size: 13px; overflow: hidden;}
|
||||
.form-item-content > .form-item > .input-group {margin-left: 20px; width:180px; height:32px;}
|
||||
.form-item-content > .form-item > .input-group > .input-group-addon {flex: 1 1 30%;}
|
||||
.form-item-content > .form-item > .input-control > input {margin-left: 40px;}
|
||||
|
||||
@@ -69,9 +69,9 @@
|
||||
?>
|
||||
<div data-id="<?php echo $itemKey?>" class="form-item flex <?php if(!$isCurrentLang):?>w-expand<?php endif;?>">
|
||||
<?php if(!$isCurrentLang):?>
|
||||
<div data-id="<?php echo $itemKey?>" class="label h-full"><?php echo $currentLangs[$langKey]?></div>
|
||||
<div data-id="<?php echo $itemKey?>" class="label h-full" title="<?php echo $currentLangs[$langKey]?>"><?php echo $currentLangs[$langKey]?></div>
|
||||
<?php endif;?>
|
||||
<div data-id="<?php echo $itemKey?>" class="label h-full"><?php echo $originalLang?></div>
|
||||
<div data-id="<?php echo $itemKey?>" class="label h-full" title="<?php echo $originalLang?>"><?php echo $originalLang?></div>
|
||||
<div class="input-group flex">
|
||||
<i class="icon icon-angle-right text-primary"></i>
|
||||
<?php $originalLangChanged = $this->dev->isOriginalLangChanged($defaultValue, $customedLang);?>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<?php echo html::select('type', $lang->execution->cfdTypeList, $type, "class='form-control chosen'");?>
|
||||
</div>
|
||||
<div id="cfdDateSelect">
|
||||
<form method='post' class='form-ajax not-watch'>
|
||||
<form method='post' class='form-ajax not-watch no-stash'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('begin', $begin, "class='form-control form-date' onchange='$(\"#datePreview\").removeClass(\"hidden\")' placeholder='" . $lang->execution->charts->cfd->begin . "'");?>
|
||||
<span class='input-group-addon'><?php echo $lang->project->to;?></span>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"story\")", '<i class="icon-link"></i> ' . $lang->release->linkStory, '', "class='btn btn-primary'");?></div>
|
||||
<div class='linkBox cell hidden'></div>
|
||||
<?php endif;?>
|
||||
<form class='main-table table-story<?php if($link === 'true' and $type == 'story') echo " hidden";?>' method='post' id='linkedStoriesForm' data-ride="table">
|
||||
<form class='main-table table-story no-stash<?php if($link === 'true' and $type == 'story') echo " hidden";?>' method='post' id='linkedStoriesForm' data-ride="table">
|
||||
<table class='table has-sort-head' id='storyList'>
|
||||
<?php
|
||||
$canBatchUnlink = common::hasPriv('release', 'batchUnlinkStory');
|
||||
|
||||
+36
-23
@@ -1,5 +1,18 @@
|
||||
(function($)
|
||||
{
|
||||
/**
|
||||
* Save form Arr to $.zui.store.
|
||||
*
|
||||
* @access public
|
||||
* @param {string} formID
|
||||
* @param {array} formData
|
||||
* @return void
|
||||
*/
|
||||
function storeFormData(formID, formData)
|
||||
{
|
||||
$.zui.store.set(formID, formData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the logic save form draft.
|
||||
*
|
||||
@@ -15,14 +28,12 @@
|
||||
if(form.length)
|
||||
{
|
||||
if($(form).hasClass('no-stash')) return;
|
||||
if($(form).attr('target') == 'hiddenwin' && config.currentModule.indexOf('program') != -1 && config.currentModule.indexOf('project') != -1) return;
|
||||
function storeFormArr()
|
||||
{
|
||||
$.zui.store.set(formDataID, $(form).serializeArray());
|
||||
var arr = $(form).serializeArray();
|
||||
}
|
||||
var formDataID = config.currentMethod + '-' + config.currentModule + '-' + $(form).attr("id");
|
||||
var formDataStored = $.zui.store.get(formDataID);
|
||||
if($(form).attr('target') == 'hiddenwin' && config.currentModule.indexOf('program') != -1 && config.currentModule.indexOf('project') != -1 && config.currentModule.indexOf('testcase') != -1) return;
|
||||
var formID = config.currentMethod + '-' + config.currentModule + '-' + $(form).attr("id");
|
||||
var formDataStored = $.zui.store.get(formID);
|
||||
setTimeout(function() {
|
||||
$.zui.store.remove(formID);
|
||||
}, 100)
|
||||
if(formDataStored && formDataStored.length)
|
||||
{
|
||||
var message = lang.confirmDraft.replace('%name%', lang[config.currentModule] ? lang[config.currentModule] : '');
|
||||
@@ -86,7 +97,16 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(tagName === 'INPUT')
|
||||
else if(tagName === 'TEXTAREA' && $(formItem).hasClass('kindeditor'))
|
||||
{
|
||||
KindEditor.remove('#' + item.name);
|
||||
formItem.val(item.value);
|
||||
$(formItem).kindeditor({
|
||||
/* Conetnt change event. */
|
||||
afterChange: storeFormData(formID, $(form).serializeArray())
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if($(formItem).attr('type') === 'checkbox')
|
||||
{
|
||||
@@ -101,34 +121,27 @@
|
||||
formItem.val(item.value);
|
||||
}
|
||||
}
|
||||
else if(tagName === 'TEXTAREA' && $(formItem).hasClass('kindeditor'))
|
||||
{
|
||||
KindEditor.remove('#' + item.name);
|
||||
formItem.val(item.value);
|
||||
$(formItem).kindeditor({
|
||||
/* Conetnt change event. */
|
||||
afterChange: storeFormArr()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
onAction: function(name, action, messager)
|
||||
{
|
||||
$.zui.store.remove(formDataID);
|
||||
setTimeout(function () {
|
||||
$.zui.store.remove(formID);
|
||||
}, 100)
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
form.on('input', function()
|
||||
{
|
||||
storeFormArr()
|
||||
{
|
||||
storeFormData(formID, $(form).serializeArray())
|
||||
}).on('change', function()
|
||||
{
|
||||
storeFormArr()
|
||||
storeFormData(formID, $(form).serializeArray())
|
||||
}).on('success.form.zui', function(event, res)
|
||||
{
|
||||
if(res.result === 'success' || res.status === 'success') $.zui.store.remove(formDataID);
|
||||
if(res.result === 'success' || res.status === 'success') $.zui.store.remove(formID);
|
||||
})
|
||||
}
|
||||
}, 500);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user