From 621e382cb6d2712d2340ebd0221aaa07a7f8a09e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 15:35:49 +0800 Subject: [PATCH 0001/1178] * Finish task #58554. --- module/custom/control.php | 4 +- module/task/js/batchcreate.js | 25 ++++++++ module/task/js/common.js | 60 +++++++++++++++++++ module/task/js/create.js | 28 +++++++++ module/task/view/batchcreate.html.php | 85 ++++++++++++++------------- module/task/view/create.html.php | 60 ++++++++----------- 6 files changed, 186 insertions(+), 76 deletions(-) diff --git a/module/custom/control.php b/module/custom/control.php index 88af46aca5..64f9469391 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -675,14 +675,16 @@ class custom extends control $account = $this->app->user->account; if($this->server->request_method == 'POST') { - $fields = $this->post->fields; + $fields = $this->post->fields; if(is_array($fields)) $fields = join(',', $fields); $this->loadModel('setting')->setItem("$account.$module.$section.$key", $fields); + if(in_array($module, array('task', 'bug', 'testcase', 'story')) and $section == 'custom' and in_array($key, array('createFields', 'batchCreateFields'))) return; } else { $this->loadModel('setting')->deleteItems("owner=$account&module=$module§ion=$section&key=$key"); } + return print(js::reload('parent')); } diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index b98330264c..9d68a3483c 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -5,6 +5,31 @@ $(function() if($('th.c-name').width() < 200) $('th.c-name').width(200); if(taskConsumed > 0) bootbox.alert(addChildTask); $('#customField').on('click', function(){$('#tableBody .chosen-with-drop').removeClass('chosen-with-drop chosen-container-active')}); + + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=batchCreateFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); }); $(document).on('change', "[name^='estStarted'], [name^='deadline']", function() diff --git a/module/task/js/common.js b/module/task/js/common.js index cad7f13d6f..8556c357e9 100644 --- a/module/task/js/common.js +++ b/module/task/js/common.js @@ -20,3 +20,63 @@ function setStoryModule() } } +/** + * Checked show fields. + * + * @param string fields + * @access public + * @return void + */ +function checkedShowFields(fields) +{ + var fieldList = ',' + fields + ','; + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0) + { + + $(this).attr('checked', true); + $fieldBox.removeClass('hidden'); + } + else + { + if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + } + }); + + if(config.currentMethod == 'create'); + { + if(fieldList.indexOf(',estStarted,') >= 0 && fieldList.indexOf(',deadline,') >= 0) + { + $('.borderBox').removeClass('hidden'); + } + else if(fieldList.indexOf(',estStarted,') >= 0 || fieldList.indexOf(',deadline,') >= 0) + { + $('.datePlanBox').removeClass('hidden'); + if(!$('.borderBox').hasClass('hidden')) $('.borderBox').addClass('hidden'); + } + else + { + if(!$('.borderBox').hasClass('hidden')) $('.borderBox').addClass('hidden'); + if(!$('.datePlanBox').hasClass('hidden')) $('.datePlanBox').addClass('hidden'); + } + } +} + +/** + * Disabled require field. + * + * @access public + * @return void + */ +function disabledRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + }); +} diff --git a/module/task/js/create.js b/module/task/js/create.js index 3c3c133f7b..c187786901 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -1,3 +1,31 @@ +$(function() +{ + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=task§ion=custom&key=createFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); +}) + /** * Load module, stories and members. * diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 363d589017..26c152c7b4 100755 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -15,6 +15,26 @@ task->addChildTask);?> +task->create->requiredFields);?> +task->create->requiredFields) as $field) +{ + if($field) + { + $requiredFields[$field] = ''; + if(strpos(",{$config->task->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; + } +} +$colspan = count($visibleFields) + 3; +?> +

@@ -40,32 +60,15 @@

- task->create->requiredFields) as $field) - { - if($field) - { - $requiredFields[$field] = ''; - if(strpos(",{$config->task->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; - } - } - $colspan = count($visibleFields) + 3; - ?>
- + type != 'ops'):?> - + type == 'kanban'):?> @@ -73,12 +76,12 @@ - - - - - - + + + + + + task->getFlowExtendFields(); foreach($extendFields as $extendField) @@ -113,12 +116,12 @@ - type != 'ops'):?> - - - - + + - - - + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . ""; @@ -189,11 +192,11 @@ - - - - - + + - - + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[%s]") . ""; diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index e9a1510f9a..0f6c3bf5a1 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -17,9 +17,17 @@ task->error->teamMember);?> vision);?> +task->create->requiredFields);?> +task->create->requiredFields) as $field) +{ + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; +} +?> +
@@ -29,12 +37,6 @@
- task->create->requiredFields) as $field) - { - if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; - } - ?>
idAB;?>'>task->module?> moduleBox'>task->module?> '>task->story;?> storyBox'>task->story;?> task->name;?> kanbancard->lane;?> typeAB;?>'>task->assignedTo;?>'>task->estimateAB;?>'>task->estStarted;?>'>task->deadline;?>'>task->desc;?>'>task->pri;?> assignedToBox'>task->assignedTo;?> estimateBox'>task->estimateAB;?> estStartedBox'>task->estStarted;?> deadlineBox'>task->deadline;?> descBox'>task->desc;?> priBox'>task->pri;?>
style='overflow:visible'> + style='overflow: visible'> +
@@ -146,9 +149,9 @@
task->typeList, $type, 'class=form-control');?> style='overflow:visible'>>> +
> +
>>task->priList, $pri, 'class=form-control');?>task->priList, $pri, 'class=form-control');?>
%s style='overflow:visible'> + id, \"%s\")'")?> style='overflow: visible'> +
@@ -216,9 +219,9 @@
task->typeList, $type, 'class="form-control"');?> style='overflow:visible'>>> +
> +
{$lang->task->ditto}"; ?>
-
>>task->priList, $pri, 'class=form-control');?>task->priList, $pri, 'class=form-control');?>
type != 'kanban' or $this->config->vision == 'lite'):?> @@ -97,8 +99,8 @@ printExtendFields('', 'table', 'columns=3');?> - lifetime != 'ops'):?> - + lifetime != 'ops') ? '' : 'hidden'?> + - type != 'ops'):?> @@ -174,8 +175,8 @@ task->copyStoryTitle;?> - - task->pri;?> + + task->pri;?>task->priList as $priKey => $priValue) @@ -195,9 +196,9 @@ } ?> - pri, "class='form-control'");?> + pri, "class='form-control $hiddenPri'");?> -
+
@@ -206,15 +207,13 @@
- - -
+ +
task->estimateAB;?>
-
@@ -231,29 +230,23 @@ - - + - - - + + - From b33c6529534f4af0697e5a689c97ed851a8e8937 Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 28 Jun 2022 16:01:28 +0800 Subject: [PATCH 0002/1178] * Add some code. --- module/story/control.php | 23 ++++++++++++++++++++ module/story/js/create.js | 36 +++++++++++++++++++++++++++++-- module/story/model.php | 1 + module/story/view/create.html.php | 8 ++++++- 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index a97bad0cb6..ef6da62ed6 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -2591,4 +2591,27 @@ class story extends control } echo $status; } + + /** + * Ajax get story assignee. + * + * @param $type create|review|change + * + * @access public + * @return void + */ + public function ajaxGetAssignedTo($type = '', $assignees = '') + { + $users = $this->loadModel('user')->getPairs('noletter|noclosed'); + + if($type = 'create') + { + $selectUser = is_array($assignees) ? current($assignees) : ''; + + return print(html::select('assignedTo', $users, $selectUser, "class='from-control picker-select'")); + } + + return false; + + } } diff --git a/module/story/js/create.js b/module/story/js/create.js index 938aa71652..6ba0258b5f 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -16,6 +16,12 @@ $(function() }); $('#needNotReview').change(); + $('#reviewer').on('change', function() + { + loadAssignedTo(); + }); + $('#reviewer').change(); + // init pri selector $('#pri').on('change', function() { @@ -33,16 +39,42 @@ $(function() if($.inArray(source, feedbackSource) != -1) { $('#feedbackBox').removeClass('hidden'); - $('#reviewerBox').attr('colspan', 2); + $('#reviewerBox').attr('colspan', 1); + $('#assignedToBox').attr('colspan', 1); } else { $('#feedbackBox').addClass('hidden'); - $('#reviewerBox').attr('colspan', 4); + $('#reviewerBox').attr('colspan', 2); + $('#assignedToBox').attr('colspan', 2); } }); }); +function loadAssignedTo() +{ + var assignees = $('#reviewer').val(); + var link = createLink('story', 'ajaxGetAssignedTo', 'type=create&assignees=' + assignees); + $.post(link, function(data) + { + $('#assignedTo').replaceWith(data); + $('#assignedToBox .picker').remove(); + $('#assignedTo').picker(); + }); + + var colspan = $('#assignedToBox').attr('colspan'); + if(assignees && assignees.length == 1) + { + $('#assignedToBox').addClass('hidden'); + $('#reviewerBox').attr('colspan', colspan * 2); + } + else + { + $('#assignedToBox').removeClass('hidden'); + $('#reviewerBox').attr('colspan', colspan); + } +} + function refreshPlan() { loadProductPlans($('#product').val(), $('#branch').val()); diff --git a/module/story/model.php b/module/story/model.php index a667e0c34f..73373cf96f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -219,6 +219,7 @@ class storyModel extends model ->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'notifyEmail', '') ->setIF($executionID > 0, 'stage', 'projected') ->setIF($bugID > 0, 'fromBug', $bugID) + ->join('assignedTo', '') ->join('mailto', ',') ->stripTags($this->config->story->editor->create['id'], $this->config->allowedTags) ->remove('files,labels,reviewer,needNotReview,newStory,uid,contactListMenu,URS,region,lane') diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 65afdf1cae..d86cb8df14 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -103,7 +103,7 @@ - + testcase->typeList['unit']);?> - - - - - + -
task->story;?> task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?> @@ -110,7 +112,6 @@
task->datePlan;?>
- - estStarted, "class='form-control form-date' placeholder='{$lang->task->estStarted}'");?> - - - ~ - - - deadline, "class='form-control form-date' placeholder='{$lang->task->deadline}'");?> - + estStarted, "class='form-control form-date $hiddenEstStarted estStartedBox' placeholder='{$lang->task->estStarted}'");?> + + ~ + deadline, "class='form-control form-date $hiddenDeadline deadlineBox' placeholder='{$lang->task->deadline}'");?>
story->mailto;?>
@@ -262,7 +255,6 @@
task->afterSubmit;?>
story->reviewedBy;?>' id='reviewerBox'> + ' id='reviewerBox'>
story->checkForceReview()):?>
@@ -124,6 +124,12 @@
' id='assignedToBox'> +
+
story->assignedTo;?>
+ +
+
From 6fb8d56c65ad7b781c6df233d21f7c08e01bf2f1 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 17:09:04 +0800 Subject: [PATCH 0003/1178] * Finish task #58556. --- module/custom/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/custom/control.php b/module/custom/control.php index 64f9469391..7c7216bbf2 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -678,7 +678,8 @@ class custom extends control $fields = $this->post->fields; if(is_array($fields)) $fields = join(',', $fields); $this->loadModel('setting')->setItem("$account.$module.$section.$key", $fields); - if(in_array($module, array('task', 'bug', 'testcase', 'story')) and $section == 'custom' and in_array($key, array('createFields', 'batchCreateFields'))) return; + if(in_array($module, array('task', 'testcase', 'story')) and $section == 'custom' and in_array($key, array('createFields', 'batchCreateFields'))) return; + if($module == 'bug' and $section == 'custom' and $key == 'batchCreateFields') return; } else { From b0df9d23de401d64bab13011458acb6fe5db47f4 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 28 Jun 2022 17:50:37 +0800 Subject: [PATCH 0004/1178] * Finish task #58557. --- module/testcase/js/common.js | 43 ++++++++++++++++++++++++++++ module/testcase/js/create.js | 25 ++++++++++++++++ module/testcase/view/create.html.php | 29 ++++++++++--------- 3 files changed, 83 insertions(+), 14 deletions(-) diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index d68f4b183f..3c27543f27 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -426,3 +426,46 @@ function setModules(branchID, productID, num) $('#plan' + (num + 1)).trigger("chosen:updated"); } } + +/** + * Checked show fields. + * + * @param string fields + * @access public + * @return void + */ +function checkedShowFields(fields) +{ + var fieldList = ',' + fields + ','; + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0) + { + + $(this).attr('checked', true); + $fieldBox.removeClass('hidden'); + } + else + { + if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + } + }); +} + +/** + * Disabled require field. + * + * @access public + * @return void + */ +function disabledRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + }); +} diff --git a/module/testcase/js/create.js b/module/testcase/js/create.js index 5a525a8ba6..336e316691 100644 --- a/module/testcase/js/create.js +++ b/module/testcase/js/create.js @@ -156,4 +156,29 @@ $(function() }); $('#subNavbar li[data-id="testcase"]').addClass('active'); + + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=testcase§ion=custom&key=createFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); }); diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 54433855c8..62cd0d9170 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -21,6 +21,15 @@ app->tab);?> app->tab == 'execution') js::set('objectID', $executionID);?> app->tab == 'project') js::set('objectID', $projectID);?> +testcase->create->requiredFields);?> +testcase->custom->createFields) as $field) +{ + if(empty($field)) continue; + $fieldName = 'show' . ucfirst($field); + ${$fieldName} = strpos(",$showFields,", $field) !== false ? " {$field}Box" : "{$field}Box hidden"; +} +?>
@@ -67,17 +76,14 @@
testcase->type;?> testcase->typeList, $type, "class='form-control chosen'");?> +
testcase->stage?> testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
testcase->lblStory;?>
@@ -93,7 +99,6 @@
testcase->title;?> @@ -108,8 +113,7 @@ - - testcase->pri;?> + testcase->pri;?> testcase->priList as $priKey => $priValue) @@ -129,10 +133,10 @@ } ?> - + -
+
@@ -141,7 +145,6 @@
- testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview0'");?> @@ -220,12 +223,10 @@
- - + testcase->keywords;?> - testcase->status;?> From 12fd7102a1318694f65dcd4611502489f75c80f5 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 17:55:19 +0800 Subject: [PATCH 0005/1178] * Finish task #58556. --- module/bug/js/batchcreate.js | 89 +++++++++++++++++++++++ module/bug/view/batchcreate.html.php | 101 ++++++++++++++------------- 2 files changed, 140 insertions(+), 50 deletions(-) diff --git a/module/bug/js/batchcreate.js b/module/bug/js/batchcreate.js index ca5552b022..3f496d94de 100644 --- a/module/bug/js/batchcreate.js +++ b/module/bug/js/batchcreate.js @@ -4,8 +4,97 @@ $(function() var $titleCol = $('#batchCreateForm table thead tr th.c-title'); if($titleCol.width() < 150) $titleCol.width(150); + + $('#customField').click(function() + { + disabledRequireFields(); + }); + + $('#formSettingForm .btn-primary').click(function() + { + $('#formSettingForm > .checkboxes > .checkbox-primary > input').removeAttr('disabled'); + var fields = ''; + $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').each(function() + { + fields += ',' + $(this).val(); + }); + + var link = createLink('custom', 'ajaxSaveCustomFields', 'module=bug§ion=custom&key=batchCreateFields'); + $.post(link, {'fields' : fields}, function() + { + checkedShowFields(fields); + disabledRequireFields(); + var $titleCol = $('#batchCreateForm table thead tr th.c-title'); + if($titleCol.width() < 150) $titleCol.width(150); + $('#formSetting').parent().removeClass('open'); + }); + + return false; + }); }) +/** + * Checked show fields. + * + * @param string fields + * @access public + * @return void + */ +function checkedShowFields(fields) +{ + var fieldList = ',' + fields + ','; + var checkedCount = $('#formSettingForm > .checkboxes > .checkbox-primary > input:checked').length; + if(checkedCount > 5) + { + $('.table-responsive').removeClass('scroll-none'); + $('.table-responsive').css('overflow', 'auto'); + } + else + { + $('.table-responsive').addClass('scroll-none'); + $('.table-responsive').css('overflow', 'visible'); + } + + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + var $fieldBox = $('.' + $(this).val() + 'Box' ); + if(fieldList.indexOf(field) >= 0 || required.indexOf(field) >= 0) + { + + if(fieldList.indexOf(field) >= 0) $(this).attr('checked', true); + $fieldBox.removeClass('hidden'); + } + else + { + if(!$fieldBox.hasClass('hidden')) $fieldBox.addClass('hidden'); + } + + var fieldCount = $('#batchCreateForm .table thead>tr>th:visible').length; + if(fieldCount < 4) + { + $('#batchCreateForm table thead tr th.c-title').css('width', 'auto'); + } + }); +} + +/** + * Disabled require field. + * + * @access public + * @return void + */ +function disabledRequireFields() +{ + $('#formSettingForm > .checkboxes > .checkbox-primary > input').each(function() + { + var field = ',' + $(this).val() + ','; + var required = ',' + requiredFields + ','; + if(required.indexOf(field) >= 0) $(this).attr('disabled', 'disabled'); + }); +} + /** * Set opened builds. * diff --git a/module/bug/view/batchcreate.html.php b/module/bug/view/batchcreate.html.php index 91c02ab591..41770dfd40 100755 --- a/module/bug/view/batchcreate.html.php +++ b/module/bug/view/batchcreate.html.php @@ -14,6 +14,24 @@ include '../../common/view/header.html.php'; js::set('requiredFields', $config->bug->create->requiredFields); ?> +bug->create->requiredFields) as $field) +{ + if($field) + { + $requiredFields[$field] = ''; + if(strpos(",{$config->bug->list->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; + } +} +?> +

@@ -30,49 +48,32 @@ js::set('requiredFields', $config->bug->create->requiredFields);

- - bug->create->requiredFields) as $field) - { - if($field) - { - $requiredFields[$field] = ''; - if(strpos(",{$config->bug->list->customBatchCreateFields},", ",{$field},") !== false) $visibleFields[$field] = ''; - } - } - ?>
- + systemMode == 'new'):?> - + - + - - - - - - - - + + + + + + + + bug->getFlowExtendFields(); foreach($extendFields as $extendField) @@ -107,12 +108,12 @@ js::set('requiredFields', $config->bug->create->requiredFields); ?> - + systemMode == 'new'):?> - + - + - - - - - - - - + + + + + + + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . ""; @@ -161,12 +162,12 @@ js::set('requiredFields', $config->bug->create->requiredFields); ?> - + systemMode == 'new'):?> - + - + - - - - - - - - + + + + + + + + loadModel('flow'); foreach($extendFields as $extendField) echo "control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->flow->getFieldControl($extendField, '', $extendField->field . "[$i]") . ""; From be78c78c4b9b0bdbf94baa3b958b09f650fab113 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 28 Jun 2022 18:08:59 +0800 Subject: [PATCH 0006/1178] * Restore code. --- module/testcase/view/create.html.php | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 62cd0d9170..54433855c8 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -21,15 +21,6 @@ app->tab);?> app->tab == 'execution') js::set('objectID', $executionID);?> app->tab == 'project') js::set('objectID', $projectID);?> -testcase->create->requiredFields);?> -testcase->custom->createFields) as $field) -{ - if(empty($field)) continue; - $fieldName = 'show' . ucfirst($field); - ${$fieldName} = strpos(",$showFields,", $field) !== false ? " {$field}Box" : "{$field}Box hidden"; -} -?>
@@ -76,14 +67,17 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
testcase->typeList['unit']);?> - + - + + +
idAB;?>'> product->branch;?> branchBox'> product->branch;?> '> bug->module;?> '>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?> projectBox'>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?> '>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> executionBox'>model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> bug->openedBuild;?> bug->title;?> kanbancard->region;?> kanbancard->lane;?> '>bug->deadline;?>'>bug->steps;?>'>typeAB;?>'>bug->pri;?>'>bug->severity;?>'>bug->os;?>'>bug->browser;?>'>bug->keywords;?> deadlineBox'>bug->deadline;?> stepsBox'>bug->steps;?> typeBox'>typeAB;?> priBox'>bug->pri;?> severityBox'>bug->severity;?> osBox'>bug->os;?> browserBox'>bug->browser;?> keywordsBox'>bug->keywords;?>
' style='overflow:visible'> branchBox' style='overflow:visible'> ' style='overflow:visible'> projectBox' style='overflow:visible'> ' style='overflow:visible'> executionBox' style='overflow:visible'>
@@ -132,14 +133,14 @@ js::set('requiredFields', $config->bug->create->requiredFields);
'>'>' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?>' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?>' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?>' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?>' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?>'> deadlineBox'> stepsBox'> typeBox' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?> priBox' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?> severityBox' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?> osBox' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> browserBox' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> keywordsBox'>
' style='overflow:visible'> branchBox' style='overflow:visible'> ' style='overflow:visible'> projectBox' style='overflow:visible'> ' style='overflow:visible'> executionBox' style='overflow:visible'>
@@ -186,14 +187,14 @@ js::set('requiredFields', $config->bug->create->requiredFields);
'>'>' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?>' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?>' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?>' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?>' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?>'> deadlineBox'> stepsBox'> typeBox' style='overflow:visible'> bug->typeList, $type, "class='form-control chosen'");?> priBox' style='overflow:visible'> bug->priList, $pri, "class='form-control'");?> severityBox' style='overflow:visible'>bug->severityList, '3', "class='form-control'");?> osBox' style='overflow:visible'> bug->osList, $os, "class='form-control chosen'");?> browserBox' style='overflow:visible'> bug->browserList, $browser, "class='form-control chosen'");?> keywordsBox'> testcase->type;?> testcase->typeList, $type, "class='form-control chosen'");?> + +
testcase->stage?> testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
testcase->lblStory;?>
@@ -99,6 +93,7 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
testcase->title;?> @@ -113,7 +108,8 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field) - testcase->pri;?> + + testcase->pri;?> testcase->priList as $priKey => $priValue) @@ -133,10 +129,10 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field) } ?> - + -
+
@@ -145,6 +141,7 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
+ testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview0'");?> @@ -223,10 +220,12 @@ foreach(explode(',', $config->testcase->custom->createFields) as $field)
- + + testcase->keywords;?> + testcase->status;?> From 1e4a9b750bc810df7d5d08d48c703c1471e4d18a Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 29 Jun 2022 10:50:38 +0800 Subject: [PATCH 0007/1178] * Restore code. --- module/execution/js/kanban.js | 2 +- module/execution/js/taskkanban.js | 2 +- module/kanban/control.php | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index bfe4282281..ada070e212 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1274,7 +1274,7 @@ function handleSortCards(event) orders.splice(orders.indexOf(fromID), 1); orders.splice(orders.indexOf(toID) + (event.insert === 'before' ? 0 : 1), 0, fromID); - var url = createLink('kanban', 'sortCard', 'kanbanID=' + executionID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(',') + '&cardID=' + toID); + var url = createLink('kanban', 'sortCard', 'kanbanID=' + executionID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(',')); $.getJSON(url, function(response) { if(response.result === 'fail') diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index c7c48cf4ff..6b6db71515 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -1109,7 +1109,7 @@ function handleSortCards(event) orders.splice(orders.indexOf(fromID), 1); orders.splice(orders.indexOf(toID) + (event.insert === 'before' ? 0 : 1), 0, fromID); - var url = createLink('kanban', 'sortCard', 'kanbanID=' + executionID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(',') + '&cardID=' + toID); + var url = createLink('kanban', 'sortCard', 'kanbanID=' + executionID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(',')); $.getJSON(url, function(response) { if(response.result === 'fail') diff --git a/module/kanban/control.php b/module/kanban/control.php index 6eb6747023..3425d473e2 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -1299,20 +1299,13 @@ class kanban extends control * @param int $laneID * @param int $columnID * @param string $cards - * @param int $cardID * @access public * @return void */ - public function sortCard($kanbanID, $laneID, $columnID, $cards = '', $cardID = 0) + public function sortCard($kanbanID, $laneID, $columnID, $cards = '') { if(empty($cards)) return; - if($cardID) - { - $fromCell = $this->dao->select('cards, lane, column')->from(TABLE_KANBANCELL)->where('cards')->like("%,$cardID,%")->fetch(); - if($fromCell->lane != $laneID or $fromCell->column != $columnID) return; - } - $this->dao->update(TABLE_KANBANCELL)->set('cards')->eq(",$cards,")->where('kanban')->eq($kanbanID)->andWhere('lane')->eq($laneID)->andWhere('`column`')->eq($columnID)->exec(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); From 6f4e6390cba6163faf3aedf098b9fe18dfd919fb Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 29 Jun 2022 06:02:23 +0000 Subject: [PATCH 0008/1178] * It is judged that the project name cannot be empty. --- module/execution/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index bcfe9f25f4..4226b06b88 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -305,7 +305,7 @@ class executionModel extends model return false; } - if($this->config->systemMode == 'new') $this->checkBeginAndEndDate($_POST['project'], $_POST['begin'], $_POST['end'], $_POST['name']); + if($this->config->systemMode == 'new' and !empty($_POST['name'])) $this->checkBeginAndEndDate($_POST['project'], $_POST['begin'], $_POST['end'], $_POST['name']); if(dao::isError()) return false; /* Determine whether to add a sprint or a stage according to the model of the execution. */ @@ -500,7 +500,7 @@ class executionModel extends model if(in_array($execution->status, array('closed', 'suspended'))) $this->computeBurn($executionID); - if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end, $execution->name); + if($this->config->systemMode == 'new' and (empty($execution->project) or $execution->project == $oldExecution->project) and !empty($execution->name)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end, $execution->name); if(dao::isError()) return false; /* Child stage inherits parent stage permissions. */ @@ -869,7 +869,7 @@ class executionModel extends model ->remove('comment') ->get(); - if($this->config->systemMode == 'new') $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end, $oldExecution->name); + if($this->config->systemMode == 'new' and !empty($oldExecution->name)) $this->checkBeginAndEndDate($oldExecution->project, $execution->begin, $execution->end, $oldExecution->name); if(dao::isError()) return false; $execution = $this->loadModel('file')->processImgURL($execution, $this->config->execution->editor->putoff['id'], $this->post->uid); From 600ac72829ca93eabfbcacb1997857045cc86394 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 29 Jun 2022 14:10:00 +0800 Subject: [PATCH 0009/1178] * modify notify style, task #58690 --- .../xuan/im/ext/model/class/xuanxuan.class.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php index f134a049b4..de1634d86f 100644 --- a/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php @@ -225,25 +225,24 @@ class xuanxuanIm extends imModel $notificationContent = json_decode($notification->content); $notificationInnerContent = json_decode($notificationContent->content); - /* Inner content: array($parentID => array($content1, $content2)) */ - $objectGroups = array($notificationInnerContent->parent => array($notificationInnerContent)); + /* Inner content: array($id => array($content1, $content2)) */ + $objectGroups = array($notificationInnerContent->id => array($notificationInnerContent)); foreach($messages as $message) { $messageContent = json_decode($message->content); $messageInnerContent = json_decode($messageContent->content); - $objectGroups[$messageInnerContent->parent][] = $messageInnerContent; + $objectGroups[$messageInnerContent->id][] = $messageInnerContent; } - $objectTotal = 0; - foreach($objectGroups as $parent => $objectGroup) + foreach($objectGroups as $id => $objectGroup) { $object = current($objectGroup); $object->count = count($objectGroup); $object->url = $object->parentURL; unset($object->title); - $objectGroups[$parent] = $object; - $objectTotal += $object->count; + $objectGroups[$id] = $object; } + $objectTotal = count($objectGroups); $notificationContent->content = json_encode(array_values($objectGroups)); /* Hack alert: title count replacement currently assumes that default count is 1. */ $notification->title = substr_replace($notification->title, "$objectTotal", strrpos($notification->title, '1'), 1); From 9f25fc251b50d108a25ed8fb6e1ee33b60d4af98 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 29 Jun 2022 14:39:19 +0800 Subject: [PATCH 0010/1178] * Fix bug #24090. --- extension/lite/product/ext/view/browse.html.php | 3 ++- module/product/view/browse.html.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/extension/lite/product/ext/view/browse.html.php b/extension/lite/product/ext/view/browse.html.php index 8f2c6f2f93..4b5b79ac3e 100644 --- a/extension/lite/product/ext/view/browse.html.php +++ b/extension/lite/product/ext/view/browse.html.php @@ -17,6 +17,7 @@ body {margin-bottom: 25px;} #mainMenu .btn-toolbar .btn-group .dropdown-menu .btn-active-text:hover .text {color: #fff;} #mainMenu .btn-toolbar .btn-group .dropdown-menu .btn-active-text:hover .text:after {border-bottom: unset;} .body-modal #mainMenu>.btn-toolbar {width: auto;} +.assignedTo{border-radius: 4px !important;} @@ -411,7 +412,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
- + 10; $actionLink = $this->createLink('story', 'batchAssignTo', "productID=$productID"); diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 5b5d49809f..249c0bacac 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -17,6 +17,7 @@ body {margin-bottom: 25px;} #mainMenu .btn-toolbar .btn-group .dropdown-menu .btn-active-text:hover .text {color: #fff;} #mainMenu .btn-toolbar .btn-group .dropdown-menu .btn-active-text:hover .text:after {border-bottom: unset;} .body-modal #mainMenu>.btn-toolbar {width: auto;} +.assignedTo{border-radius: 4px !important;} @@ -550,7 +551,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
- + 10; $actionLink = $this->createLink('story', 'batchAssignTo', "productID=$productID"); From 5fa46a77fe3e2556d05cbfe382f0e94c38da5fb6 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 29 Jun 2022 15:32:19 +0800 Subject: [PATCH 0011/1178] * Fix bug #24132. --- .../workflowdatasource/ext/config/litevip.php | 2 ++ .../workflowdatasource/ext/model/getlist.php | 19 +++++++++++++++++++ .../ext/view/browse.flow.html.hook.php | 1 - .../ext/view/create.flow.html.hook.php | 1 - .../ext/view/edit.flow.html.hook.php | 1 - 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 extension/lite/workflowdatasource/ext/config/litevip.php create mode 100644 extension/lite/workflowdatasource/ext/model/getlist.php diff --git a/extension/lite/workflowdatasource/ext/config/litevip.php b/extension/lite/workflowdatasource/ext/config/litevip.php new file mode 100644 index 0000000000..1026608ae5 --- /dev/null +++ b/extension/lite/workflowdatasource/ext/config/litevip.php @@ -0,0 +1,2 @@ +config->workflowdatasource->excludeDatasource = 'litefeedbackStatus,litefeedbackModules,litefeedbackType,litefeedbackSolution,litefeedbackclosedReason'; diff --git a/extension/lite/workflowdatasource/ext/model/getlist.php b/extension/lite/workflowdatasource/ext/model/getlist.php new file mode 100644 index 0000000000..e352913fb7 --- /dev/null +++ b/extension/lite/workflowdatasource/ext/model/getlist.php @@ -0,0 +1,19 @@ +dao->select('*')->from(TABLE_WORKFLOWDATASOURCE) + ->where(1) + ->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi() + ->beginIF($this->config->visions == ',lite,')->andWhere('code')->notin($this->config->workflowdatasource->excludeDatasource)->fi() + ->orderBy($orderBy) + ->page($pager) + ->fetchAll(); +} diff --git a/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php b/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php index e029265b5e..e69de29bb2 100644 --- a/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php +++ b/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowdatasource/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php b/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php index 55d057a936..fefcab51f4 100644 --- a/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php +++ b/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php @@ -3,4 +3,3 @@ $('#submit').after(' -app->getExtensionRoot() . 'biz/workflowdatasource/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php b/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php index e029265b5e..e69de29bb2 100644 --- a/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php +++ b/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowdatasource/ext/view/' . basename(__FILE__);?> From 834245e103c7dad143a8c64be280323ca1e5674e Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 29 Jun 2022 16:06:54 +0800 Subject: [PATCH 0012/1178] * Fix bug #24437. --- module/block/view/waterfallissueblock.html.php | 6 ++++-- module/block/view/waterfallriskblock.html.php | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/module/block/view/waterfallissueblock.html.php b/module/block/view/waterfallissueblock.html.php index 3cd26cb27d..7f4ca97119 100644 --- a/module/block/view/waterfallissueblock.html.php +++ b/module/block/view/waterfallissueblock.html.php @@ -5,6 +5,8 @@ .block-issues .c-id {width: 55px;} .block-issues .c-status {width: 80px;} .block-issues.block-sm .c-status {text-align: center;} +.c-assignedTo {width: 100px; padding:0px !important;text-align:center;} +.c-severity, .c-pri {text-align:center;}
'> @@ -17,7 +19,7 @@ - + @@ -35,7 +37,7 @@ - + From 8fbf4148c4d49350c0e1fb7b66610bfc11b74501 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 30 Jun 2022 10:55:05 +0800 Subject: [PATCH 0056/1178] * Fix bug #24573. --- module/task/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index c4a4d4f31b..e2f4091aa7 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -166,7 +166,7 @@
- + ' . $lang->goback, '', "class='btn btn-secondary'");?>
";?> executionList = $execution;?> task->buildOperateMenu($task, 'view');?> From 933694703e6b176e67c8128de1b402001efb088a Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 30 Jun 2022 11:00:28 +0800 Subject: [PATCH 0057/1178] * Fix bug #24580. --- module/doc/js/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 432a790f3e..be9b87367f 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -50,7 +50,7 @@ function toggleAcl(acl, type) var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : ''; $('#noticeAcl').html(notice); - if((libType == 'custom' || libType == 'api') && acl == 'private') $('#whiteListBox').addClass('hidden'); + if((libType == 'custom' || libType == 'api' || libType == 'book') && acl == 'private') $('#whiteListBox').addClass('hidden'); if(libType == 'project' && typeof(doclibID) != 'undefined') { From 8d43bd7bdcf488715514d8b29eb3249449def247 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Thu, 30 Jun 2022 11:08:16 +0800 Subject: [PATCH 0058/1178] * Hide open approval for lite workflow. --- extension/lite/workflow/ext/view/create.flow.html.hook.php | 1 + 1 file changed, 1 insertion(+) diff --git a/extension/lite/workflow/ext/view/create.flow.html.hook.php b/extension/lite/workflow/ext/view/create.flow.html.hook.php index 79974026e4..a11083617b 100644 --- a/extension/lite/workflow/ext/view/create.flow.html.hook.php +++ b/extension/lite/workflow/ext/view/create.flow.html.hook.php @@ -1,3 +1,4 @@ From 3d92afa1ae1a7e00916df1271a66e8e6d9e8658f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 30 Jun 2022 11:20:41 +0800 Subject: [PATCH 0059/1178] * Fix bug. --- module/project/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index ae90e96cb2..88f4eee237 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1097,7 +1097,7 @@ class projectModel extends model if(!empty($project->name) and $project->begin < $program->begin) dao::$errors['begin'] = sprintf($this->lang->project->beginGreateChild, $program->begin); /* When parent set end then child project end cannot greater than parent. */ - if(!empty($project->name) and $$program->end != '0000-00-00' and $project->end > $program->end) dao::$errors['end'] = sprintf($this->lang->project->endLetterChild, $program->end); + if(!empty($project->name) and $program->end != '0000-00-00' and $project->end > $program->end) dao::$errors['end'] = sprintf($this->lang->project->endLetterChild, $program->end); if(dao::isError()) return false; } From fe4aa6c00f54b05efc1c6cf7c04b3fcca0d2b6b0 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 30 Jun 2022 11:21:38 +0800 Subject: [PATCH 0060/1178] * Fix bug #24288. --- module/testtask/js/edit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/testtask/js/edit.js b/module/testtask/js/edit.js index c60cf07c54..7c93eff175 100755 --- a/module/testtask/js/edit.js +++ b/module/testtask/js/edit.js @@ -1,4 +1,8 @@ $(function() { adjustPriBoxWidth(); + if(config.onlybody) + { + $('#ownerAndPriBox .picker-selection').css('width', '123px'); + } }) From 39267472e23465140c2c304060009f5e54043911 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 30 Jun 2022 03:22:36 +0000 Subject: [PATCH 0061/1178] * Fix bug. --- module/project/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index ae90e96cb2..88f4eee237 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1097,7 +1097,7 @@ class projectModel extends model if(!empty($project->name) and $project->begin < $program->begin) dao::$errors['begin'] = sprintf($this->lang->project->beginGreateChild, $program->begin); /* When parent set end then child project end cannot greater than parent. */ - if(!empty($project->name) and $$program->end != '0000-00-00' and $project->end > $program->end) dao::$errors['end'] = sprintf($this->lang->project->endLetterChild, $program->end); + if(!empty($project->name) and $program->end != '0000-00-00' and $project->end > $program->end) dao::$errors['end'] = sprintf($this->lang->project->endLetterChild, $program->end); if(dao::isError()) return false; } From c896e5ac6fe99d26ecba388601513ed86c84551b Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 30 Jun 2022 11:22:53 +0800 Subject: [PATCH 0062/1178] * Code for lite html hook. --- .../attend/ext/view/stat.oa.html.hook.php | 3 --- .../flow/ext/view/browse.flow.html.hook.php | 1 - .../flow/ext/view/create.flow.html.hook.php | 1 - .../ext/view/browsedb.flow.html.hook.php | 1 - .../ext/view/browseflow.flow.html.hook.php | 1 - .../workflow/ext/view/copy.flow.html.hook.php | 1 - .../workflow/ext/view/edit.flow.html.hook.php | 1 - .../ext/view/flowchart.flow.html.hook.php | 1 - .../ext/view/release.flow.html.hook.php | 1 - .../ext/view/setcss.flow.html.hook.php | 1 - .../ext/view/setjs.flow.html.hook.php | 1 - .../workflow/ext/view/ui.flow.html.hook.php | 1 - .../ext/view/browse.flow.html.hook.php | 1 - .../ext/view/create.flow.html.hook.php | 1 - .../ext/view/edit.flow.html.hook.php | 1 - .../ext/view/setnotice.flow.html.hook.php | 1 - .../ext/view/browse.flow.html.hook.php | 1 - .../ext/view/create.flow.html.hook.php | 1 - .../ext/view/edit.flow.html.hook.php | 1 - .../ext/view/browse.flow.html.hook.php | 1 - .../ext/view/edit.flow.html.hook.php | 1 - .../ext/view/create.flow.html.hook.php | 1 - .../ext/view/edit.flow.html.hook.php | 1 - .../ext/view/browse.flow.html.hook.php | 1 - .../ext/view/admin.flow.html.hook.php | 1 - .../ext/view/admin.flow.html.hook.php | 1 - .../ext/view/browse.flow.html.hook.php | 1 - .../ext/view/view.flow.html.hook.php | 1 - module/upgrade/config.php | 24 +++++++++++++++++++ 29 files changed, 24 insertions(+), 30 deletions(-) delete mode 100644 extension/lite/attend/ext/view/stat.oa.html.hook.php delete mode 100644 extension/lite/flow/ext/view/browse.flow.html.hook.php delete mode 100644 extension/lite/flow/ext/view/create.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/browsedb.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/browseflow.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/edit.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/flowchart.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/release.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/setcss.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/setjs.flow.html.hook.php delete mode 100644 extension/lite/workflow/ext/view/ui.flow.html.hook.php delete mode 100644 extension/lite/workflowaction/ext/view/browse.flow.html.hook.php delete mode 100644 extension/lite/workflowaction/ext/view/edit.flow.html.hook.php delete mode 100644 extension/lite/workflowaction/ext/view/setnotice.flow.html.hook.php delete mode 100644 extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php delete mode 100644 extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php delete mode 100644 extension/lite/workflowfield/ext/view/browse.flow.html.hook.php delete mode 100644 extension/lite/workflowhook/ext/view/create.flow.html.hook.php delete mode 100644 extension/lite/workflowhook/ext/view/edit.flow.html.hook.php delete mode 100644 extension/lite/workflowlabel/ext/view/browse.flow.html.hook.php delete mode 100644 extension/lite/workflowlayout/ext/view/admin.flow.html.hook.php delete mode 100644 extension/lite/workflowrelation/ext/view/admin.flow.html.hook.php delete mode 100644 extension/lite/workflowrule/ext/view/browse.flow.html.hook.php delete mode 100644 extension/lite/workflowrule/ext/view/view.flow.html.hook.php diff --git a/extension/lite/attend/ext/view/stat.oa.html.hook.php b/extension/lite/attend/ext/view/stat.oa.html.hook.php deleted file mode 100644 index c5c67c3735..0000000000 --- a/extension/lite/attend/ext/view/stat.oa.html.hook.php +++ /dev/null @@ -1,3 +0,0 @@ -getExtensionRoot() . '/biz/attend/ext/view/stat.oa.html.hook.php'; -?> \ No newline at end of file diff --git a/extension/lite/flow/ext/view/browse.flow.html.hook.php b/extension/lite/flow/ext/view/browse.flow.html.hook.php deleted file mode 100644 index c66dc67377..0000000000 --- a/extension/lite/flow/ext/view/browse.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/flow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/flow/ext/view/create.flow.html.hook.php b/extension/lite/flow/ext/view/create.flow.html.hook.php deleted file mode 100644 index c66dc67377..0000000000 --- a/extension/lite/flow/ext/view/create.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/flow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/browsedb.flow.html.hook.php b/extension/lite/workflow/ext/view/browsedb.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/browsedb.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/browseflow.flow.html.hook.php b/extension/lite/workflow/ext/view/browseflow.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/browseflow.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/copy.flow.html.hook.php b/extension/lite/workflow/ext/view/copy.flow.html.hook.php index bb1ebdd750..79974026e4 100644 --- a/extension/lite/workflow/ext/view/copy.flow.html.hook.php +++ b/extension/lite/workflow/ext/view/copy.flow.html.hook.php @@ -1,4 +1,3 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/edit.flow.html.hook.php b/extension/lite/workflow/ext/view/edit.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/edit.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/flowchart.flow.html.hook.php b/extension/lite/workflow/ext/view/flowchart.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/flowchart.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/release.flow.html.hook.php b/extension/lite/workflow/ext/view/release.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/release.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/setcss.flow.html.hook.php b/extension/lite/workflow/ext/view/setcss.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/setcss.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/setjs.flow.html.hook.php b/extension/lite/workflow/ext/view/setjs.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/setjs.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflow/ext/view/ui.flow.html.hook.php b/extension/lite/workflow/ext/view/ui.flow.html.hook.php deleted file mode 100644 index 2dbe26bf06..0000000000 --- a/extension/lite/workflow/ext/view/ui.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflow/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowaction/ext/view/browse.flow.html.hook.php b/extension/lite/workflowaction/ext/view/browse.flow.html.hook.php deleted file mode 100644 index 9a25285d22..0000000000 --- a/extension/lite/workflowaction/ext/view/browse.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowaction/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowaction/ext/view/create.flow.html.hook.php b/extension/lite/workflowaction/ext/view/create.flow.html.hook.php index 6c51eeb21c..b0f336e568 100644 --- a/extension/lite/workflowaction/ext/view/create.flow.html.hook.php +++ b/extension/lite/workflowaction/ext/view/create.flow.html.hook.php @@ -1,4 +1,3 @@ -app->getExtensionRoot() . 'biz/workflowaction/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowaction/ext/view/edit.flow.html.hook.php b/extension/lite/workflowaction/ext/view/edit.flow.html.hook.php deleted file mode 100644 index 9a25285d22..0000000000 --- a/extension/lite/workflowaction/ext/view/edit.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowaction/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowaction/ext/view/setnotice.flow.html.hook.php b/extension/lite/workflowaction/ext/view/setnotice.flow.html.hook.php deleted file mode 100644 index 9a25285d22..0000000000 --- a/extension/lite/workflowaction/ext/view/setnotice.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowaction/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php b/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php deleted file mode 100644 index e029265b5e..0000000000 --- a/extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowdatasource/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php b/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php index 55d057a936..fefcab51f4 100644 --- a/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php +++ b/extension/lite/workflowdatasource/ext/view/create.flow.html.hook.php @@ -3,4 +3,3 @@ $('#submit').after(' -app->getExtensionRoot() . 'biz/workflowdatasource/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php b/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php deleted file mode 100644 index e029265b5e..0000000000 --- a/extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowdatasource/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowfield/ext/view/browse.flow.html.hook.php b/extension/lite/workflowfield/ext/view/browse.flow.html.hook.php deleted file mode 100644 index 11369cc5af..0000000000 --- a/extension/lite/workflowfield/ext/view/browse.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowfield/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowfield/ext/view/edit.flow.html.hook.php b/extension/lite/workflowfield/ext/view/edit.flow.html.hook.php index 122e39595d..50342ecd4b 100644 --- a/extension/lite/workflowfield/ext/view/edit.flow.html.hook.php +++ b/extension/lite/workflowfield/ext/view/edit.flow.html.hook.php @@ -1,4 +1,3 @@ -app->getExtensionRoot() . 'biz/workflowfield/ext/view/' . basename(__FILE__);?> visions == ',lite,'):?> dao->select('id')->from(TABLE_WORKFLOWDATASOURCE)->where('code')->like('litefeedback%')->andWhere('vision')->eq('lite')->fetchPairs('id', 'id');?> diff --git a/extension/lite/workflowhook/ext/view/create.flow.html.hook.php b/extension/lite/workflowhook/ext/view/create.flow.html.hook.php deleted file mode 100644 index abebb6d16b..0000000000 --- a/extension/lite/workflowhook/ext/view/create.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowhook/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowhook/ext/view/edit.flow.html.hook.php b/extension/lite/workflowhook/ext/view/edit.flow.html.hook.php deleted file mode 100644 index abebb6d16b..0000000000 --- a/extension/lite/workflowhook/ext/view/edit.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowhook/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowlabel/ext/view/browse.flow.html.hook.php b/extension/lite/workflowlabel/ext/view/browse.flow.html.hook.php deleted file mode 100644 index d32409775c..0000000000 --- a/extension/lite/workflowlabel/ext/view/browse.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowlabel/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowlayout/ext/view/admin.flow.html.hook.php b/extension/lite/workflowlayout/ext/view/admin.flow.html.hook.php deleted file mode 100644 index 038a427205..0000000000 --- a/extension/lite/workflowlayout/ext/view/admin.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowlayout/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowrelation/ext/view/admin.flow.html.hook.php b/extension/lite/workflowrelation/ext/view/admin.flow.html.hook.php deleted file mode 100644 index 09020f0aad..0000000000 --- a/extension/lite/workflowrelation/ext/view/admin.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowrelation/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowrule/ext/view/browse.flow.html.hook.php b/extension/lite/workflowrule/ext/view/browse.flow.html.hook.php deleted file mode 100644 index 06a563562d..0000000000 --- a/extension/lite/workflowrule/ext/view/browse.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowrule/ext/view/' . basename(__FILE__);?> diff --git a/extension/lite/workflowrule/ext/view/view.flow.html.hook.php b/extension/lite/workflowrule/ext/view/view.flow.html.hook.php deleted file mode 100644 index 06a563562d..0000000000 --- a/extension/lite/workflowrule/ext/view/view.flow.html.hook.php +++ /dev/null @@ -1 +0,0 @@ -app->getExtensionRoot() . 'biz/workflowrule/ext/view/' . basename(__FILE__);?> diff --git a/module/upgrade/config.php b/module/upgrade/config.php index 8d1cab9948..c33947fe1a 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -338,6 +338,30 @@ $config->delete['17_0_beta1'][] = 'extension/max/sso/ext/model/bizext.php'; $config->delete['17_2'][] = 'extension/biz/my/ext/view/todo.calendar.html.hook.php'; $config->delete['17_2'][] = 'extension/max/my/ext/view/todo.calendar.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/attend/ext/view/stat.oa.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/flow/ext/view/browse.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/flow/ext/view/create.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/browsedb.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/browseflow.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/edit.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/flowchart.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/release.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/setcss.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/setjs.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflow/ext/view/ui.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowaction/ext/view/browse.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowaction/ext/view/edit.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowaction/ext/view/setnotice.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowdatasource/ext/view/browse.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowdatasource/ext/view/edit.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowfield/ext/view/browse.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowhook/ext/view/create.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowhook/ext/view/edit.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowlabel/ext/view/browse.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowlayout/ext/view/admin.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/workflowrelation/ext/view/admin.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/extension/lite/workflowrule/ext/view/browse.flow.html.hook.php'; +$config->delete['17_2'][] = 'extension/lite/extension/lite/workflowrule/ext/view/view.flow.html.hook.php'; $config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation'); From 03b07a3b3a54a00e4088513462821b801f3947f0 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 30 Jun 2022 11:23:46 +0800 Subject: [PATCH 0063/1178] * Fix bug #24288. --- module/testtask/js/edit.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/module/testtask/js/edit.js b/module/testtask/js/edit.js index 7c93eff175..2e8300669a 100755 --- a/module/testtask/js/edit.js +++ b/module/testtask/js/edit.js @@ -1,8 +1,5 @@ $(function() { adjustPriBoxWidth(); - if(config.onlybody) - { - $('#ownerAndPriBox .picker-selection').css('width', '123px'); - } + if(config.onlybody) $('#ownerAndPriBox .picker-selection').css('width', '123px'); }) From a8358b6ba50a3488ecf56a45acd842df55765db7 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 30 Jun 2022 11:27:04 +0800 Subject: [PATCH 0064/1178] * fix bug #23954 --- extension/lite/feedback/ext/view/view.lite.html.hook.php | 3 +++ extension/lite/todo/ext/view/view.lite.html.hook.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 extension/lite/feedback/ext/view/view.lite.html.hook.php diff --git a/extension/lite/feedback/ext/view/view.lite.html.hook.php b/extension/lite/feedback/ext/view/view.lite.html.hook.php new file mode 100644 index 0000000000..8ad5595c4d --- /dev/null +++ b/extension/lite/feedback/ext/view/view.lite.html.hook.php @@ -0,0 +1,3 @@ + diff --git a/extension/lite/todo/ext/view/view.lite.html.hook.php b/extension/lite/todo/ext/view/view.lite.html.hook.php index fad3ee2b75..56bdae52d4 100644 --- a/extension/lite/todo/ext/view/view.lite.html.hook.php +++ b/extension/lite/todo/ext/view/view.lite.html.hook.php @@ -37,7 +37,7 @@ $('#toStoryLink').click(function() $('#toStoryButtonByProject').click(function() { var onlybody = config.onlybody == 'yes'; - var projectID = $('#projectToStory').val(); + var projectID = $('#projectToStory').val(); var link = createLink('story', 'create', 'productID=0&branch=0&moduleID=0&storyID=0&projectID=' + projectID + '&bugID=0&planID=0&todoID=' + todoID, config.defaultView, onlybody); if(!onlybody) window.parent.$.apps.open(link, 'project'); @@ -75,4 +75,4 @@ function createProject() config.onlybody = onlybody; parent.location.href = link; } - \ No newline at end of file + From b953f00253c2ff7b547d36b5f1f0072bf7bdef9b Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 30 Jun 2022 11:27:04 +0800 Subject: [PATCH 0065/1178] * fix bug #23954 --- extension/lite/feedback/ext/view/view.lite.html.hook.php | 3 +++ extension/lite/todo/ext/view/view.lite.html.hook.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 extension/lite/feedback/ext/view/view.lite.html.hook.php diff --git a/extension/lite/feedback/ext/view/view.lite.html.hook.php b/extension/lite/feedback/ext/view/view.lite.html.hook.php new file mode 100644 index 0000000000..8ad5595c4d --- /dev/null +++ b/extension/lite/feedback/ext/view/view.lite.html.hook.php @@ -0,0 +1,3 @@ + diff --git a/extension/lite/todo/ext/view/view.lite.html.hook.php b/extension/lite/todo/ext/view/view.lite.html.hook.php index fad3ee2b75..56bdae52d4 100644 --- a/extension/lite/todo/ext/view/view.lite.html.hook.php +++ b/extension/lite/todo/ext/view/view.lite.html.hook.php @@ -37,7 +37,7 @@ $('#toStoryLink').click(function() $('#toStoryButtonByProject').click(function() { var onlybody = config.onlybody == 'yes'; - var projectID = $('#projectToStory').val(); + var projectID = $('#projectToStory').val(); var link = createLink('story', 'create', 'productID=0&branch=0&moduleID=0&storyID=0&projectID=' + projectID + '&bugID=0&planID=0&todoID=' + todoID, config.defaultView, onlybody); if(!onlybody) window.parent.$.apps.open(link, 'project'); @@ -75,4 +75,4 @@ function createProject() config.onlybody = onlybody; parent.location.href = link; } - \ No newline at end of file + From d8d3af205cea25b38162ad37fc34d1aa7c38ced6 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 30 Jun 2022 03:29:53 +0000 Subject: [PATCH 0066/1178] * Fix bug #24472 #24581. --- module/task/js/batchcreate.js | 1 + module/task/view/batchcreate.html.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index b98330264c..70291eb881 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -136,6 +136,7 @@ function setPreview(num) storyLink = storyLink + concat + 'onlybody=yes'; } $('#preview' + num).removeAttr('disabled'); + $('#preview' + num).modalTrigger({type:'iframe'}); $('#preview' + num).attr('href', storyLink); } else diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 02d295aad4..8cf425cace 100755 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -122,7 +122,7 @@
- + From 51660084497c38f167062706aa2a07c03aee9ec8 Mon Sep 17 00:00:00 2001 From: sunjun Date: Thu, 30 Jun 2022 03:42:34 +0000 Subject: [PATCH 0067/1178] fixbug_api --- module/api/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/api/model.php b/module/api/model.php index 539132b98a..4b121cc395 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -910,7 +910,7 @@ class apiModel extends model $this->config->api->search['module'] = 'api'; $this->config->api->search['queryID'] = $queryID; $this->config->api->search['actionURL'] = $actionURL; - $this->config->api->search['params']['lib']['values'] = array($lib->id => $lib->name) + array('all' => $this->lang->api->allLibs); + $this->config->api->search['params']['lib']['values'] = (!empty($lib)) ? array($lib->id => $lib->name) + array('all' => $this->lang->api->allLibs) : array('all' => $this->lang->api->allLibs); $this->loadModel('search')->setSearchParams($this->config->api->search); } From 050750055646f83e180d3346f69258c4224776e2 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 30 Jun 2022 03:46:27 +0000 Subject: [PATCH 0068/1178] * optimize apps loading state. --- module/index/css/index.css | 2 +- module/index/js/index.js | 2 +- www/js/zui/min.js | 6 +++--- www/theme/zui/css/min.css | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/index/css/index.css b/module/index/css/index.css index 185b6fb9cc..39a1f80603 100644 --- a/module/index/css/index.css +++ b/module/index/css/index.css @@ -49,7 +49,7 @@ body.menu-hide {padding-left: 0;} .app-container {position: absolute; left: 0; bottom: 40px; right: 0; top: 0; background-color: #efefef;} .menu-hide #apps {left: 40px;} .app-container.loading:before {background-color: rgba(0,0,0,.1);} -.app-container.loading:before, .app-container.loading::after {transition-delay: 1s;} +.app-container.loading:before, .app-container.loading::after {transition-delay: 3s;} #appsBar {position: fixed; left: 96px; bottom: 0; right: 0; height: 40px; z-index: 1012; background: #fff; border-top: 1px solid #eff1f7;} .menu-hide #appsBar {left: 40px;} diff --git a/module/index/js/index.js b/module/index/js/index.js index 3ae31f534a..d924d87bf8 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -463,7 +463,7 @@ { app.$app.removeClass('loading'); app._loadTimer = null; - }, 10000); + }, 15000); } /** diff --git a/www/js/zui/min.js b/www/js/zui/min.js index da51cfd482..337836f63e 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,5 +1,5 @@ /*! - * ZUI: ZUI for Zentao - v1.10.0 - 2022-06-28 + * ZUI: ZUI for Zentao - v1.10.0 - 2022-06-30 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2022 cnezsoft.com; Licensed MIT @@ -74,7 +74,7 @@ function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"= * Original idea by: * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ */ -function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,c=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t,e,i){"use strict";var n="zui.picker",o={},a={lang:null,remote:null,remoteConverter:null,remoteOnly:!1,onRemoteError:null,disableEmptySearch:!1,textKey:"text",valueKey:"value",keysKey:"keys",multi:"auto",formItem:"auto",list:null,allowSingleDeselect:null,autoSelectFirst:!1,maxSelectedCount:0,maxListCount:100,hideEmptyTextOption:!0,searchValueKey:!0,emptyResultHint:null,hideOnScroll:!0,inheritFormItemClasses:!1,emptySearchResultHint:null,accurateSearchHint:null,remoteErrorHint:null,deleteByBackspace:!0,disableScrollOnShow:!0,maxDropHeight:250,dropDirection:"auto",dropWidth:"100%",maxAutoDropWidth:450,minAutoDropWidth:100,multiValueSplitter:",",multiSelectActions:5,searchDelay:200,autoClearDrop:6e4,fixLabelFor:!0,hotkey:!0,onSelect:null,onDeselect:null,onBeforeChange:null,onChange:null,onReady:null,onNoResults:null,onShowingDrop:null,onHidingDrop:null,onShowedDrop:null,onHiddenDrop:null,valueMustInList:!0},s={zh_cn:{emptyResultHint:"没有可选项",emptySearchResultHint:"没有找到 “{0}”",accurateSearchHint:"请提供更多关键词缩小匹配范围",remoteErrorHint:"无法从服务器获取结果 - {0}",selectAll:"全选",deselectAll:"取消选择"},zh_tw:{emptyResultHint:"沒有可選項",emptySearchResultHint:"沒有找到 “{0}”",accurateSearchHint:"請提供更多關鍵詞縮小匹配範圍",remoteErrorHint:"無法從服務器獲取結果 - {0}",selectAll:"全選",deselectAll:"取消選擇"},en:{emptyResultHint:"No options",emptySearchResultHint:'Cannot found "{0}"',accurateSearchHint:"Suggest to provide more keywords",remoteErrorHint:"Unable to get result from server: {0}",selectAll:"Select all",deselectAll:"Deselect all"}},r=function(o,a){var l=this;l.name=n,l.$=t(o),l.id="pk_"+(l.$.attr("id")||t.zui.uuid()),a=l.options=t.extend({},r.DEFAULTS,this.$.data(),a),void 0!==a.hideOnWindowScroll&&(a.hideOnScroll=a.hideOnWindowScroll);var c=t.zui.clientLang?t.zui.clientLang():"en",h=a.lang||c;l.lang=t.zui.getLangData?t.zui.getLangData(n,h,s):s[h]||s[c];var d,u,p=a.formItem,f='.form-item,input[type="hidden"],select,input[type="text"]';if(d="self"===p?l.$:"auto"!==p&&p?l.$.find(p):l.$.is(f)?l.$:l.$.find(f).first(),!d.length)return console.error&&console.error("Cannot found form item for picker.");if(d.is('input[type="hidden"]'))u="hidden";else if(d.is("select"))u="select";else{if(!d.is('input[type="text"]'))return console.error&&console.error("Unknown form type for picker.");u="text"}a.inheritFormItemClasses&&v.addClass(d.attr("class")),l.formType=u,l.$formItem=d.removeClass("picker").hide(),l.selfFormItem=d.is(l.$);var g=a.multi;g&&"auto"!==g||(g="select"===u&&"multiple"===d.attr("multiple")),g=!!g,l.multi=g,g||(l.options.checkable=!1);var m=a.list;m?l.setList("function"==typeof m?m({search:l.search,limit:a.maxListCount}):m,!0):"select"===u?l.updateFromSelect():l.setList([],!0);var v;v=!l.selfFormItem&&l.$.hasClass("picker")?l.$:t('
').insertAfter(l.$),v.addClass("picker").toggleClass("picker-multi",g).toggleClass("picker-single",!g);var y=v.children(".picker-selections");y.length?y.empty():y=t('
');var b=l.id+"-search",w=t('').appendTo(y);if(!g){var x=t('
');a.allowSingleDeselect&&x.append(''),x.appendTo(y),l.$singleSelection=x}v.toggleClass("picker-input-empty",!w.val().length).append(y),l.$container=v,l.$selections=y,l.$search=w,l.search="";var C=a.placeholder;if(void 0===C&&(C=d.attr("placeholder")),"string"==typeof C&&C.length&&y.append(t('
').text(C)),a.placeholder=C,a.fixLabelFor){var _=d.attr("id");_&&t('label[for="'+_+'"]').attr("for",b)}var k=void 0!==a.defaultValue?a.defaultValue:d.val();if(null===k&&(k=""),l.setValue(k,!0),l.setDisabled(),w.on("focus",function(){l.disabled||(l._blurTimer&&(clearTimeout(l._blurTimer),l._blurTimer=0),v.addClass("picker-focus"),l.showDropList())}).on("blur",function(){l.disabled||(l._blurTimer&&clearTimeout(l._blurTimer),l._blurTimer=setTimeout(function(){l._blurTimer=0,w.is(":focus")||v.removeClass("picker-focus")},100))}).on("input change",function(){if(!l.disabled){var t=w.val();g&&w.width(14*t.length),v.toggleClass("picker-input-empty",!t.length),l.tryUpdateList(t)}}),a.hotkey&&w.on("keydown",function(t){if(!l.disabled){var e=t.key||t.which;if(l.dropListShowed){var i=l.activeValue,n="string"==typeof i;if("Enter"===e||13===e)n&&(l.select(i,g),g?(l.$search.val(""),l.tryUpdateList("")):w.blur(),t.preventDefault(),t.stopPropagation());else if("ArrowDown"===e||40===e){var o,s=l.$activeOption;if(s&&(o=s.next(".picker-option"),g))for(;o.length&&o.hasClass("picker-option-selected");)o=o.next(".picker-option");o&&o.length||(o=l.$optionsList.children(g?".picker-option:not(.picker-option-selected)":".picker-option").first()),o.length&&l.activeOption(o),t.preventDefault(),t.stopPropagation()}else if("ArrowUp"===e||30===e){var r,s=l.$activeOption;if(s&&(r=s.prev(".picker-option"),g))for(;r.length&&r.hasClass("picker-option-selected");)r=r.prev(".picker-option");r&&r.length||(r=l.$optionsList.children(g?".picker-option:not(.picker-option-selected)":".picker-option").last()),r.length&&l.activeOption(r),t.preventDefault(),t.stopPropagation()}else"Escape"===e||27===e?l.hideDropList(!0):a.deleteByBackspace&&g&&("Backspace"===e||8===e)&&l.value&&l.value.length&&!w.val().length&&l.deselect(l.value[l.value.length-1])}}}),g){y.on("mousedown",function(t){if(!l.disabled)return l.dropListShowed&&!a.checkable?(t.preventDefault(),void t.stopPropagation()):void 0}).on("mouseup",function(e){l.disabled||y.hasClass("sortable-sorting")||t(e.target).closest(".picker-selection-remove").length||l.dropListShowed&&!a.checkable||l.focus()});var T=a.sortValuesByDnd;if(T&&t.fn.sortable){v.addClass("picker-sortable");var S={selector:".picker-selection",stopPropagation:!0,start:function(){l.hideDropList(!0)},finish:function(e){var i=[];t.each(e.list,function(t,e){i.push(e.item.data("value"))}),l.setValue(i.slice(),!1,!0)}};"object"==typeof T&&t.extend(S,T),y.sortable(S)}}if(y.on("click",".picker-selection-remove",function(e){if(!l.disabled){if(l.multi){var i=t(this).closest(".picker-selection");l.deselect(i.data("value"))}else l.deselect();e.stopPropagation()}}),d.on("chosen:updated",function(){l.updateFromSelect(!1),l.setValue(d.val(),!0),l.setDisabled(),l.updateList()}).on("chosen:activate",l.focus).on("chosen:open",l.showDropList).on("chosen:close",l.hideDropList),v.addClass("picker-ready"),t.zui.asap(function(){l.triggerEvent("ready",{picker:l},"","chosen:ready")}),!a.disableScrollOnShow){var D=a.hideOnScroll;D&&![e,i,!0].includes(D)&&t(D).on("scroll",this.handleParentScroll.bind(this))}};r.prototype.destroy=function(){var e=this,i=e.options;e.hideDropList(!0);var o=e.$search;o.off("focus blur input change"),i.hotkey&&o.off("keydown"),o.remove();var a=e.$selections;a.off("click"),e.multi&&a.off("mousedown mouseup"),a.remove();var s=e.$formItem;e.selectOptionsBackup&&(s.empty(),t.each(e.selectOptionsBackup,function(e,n){var o={value:n[i.valueKey]},a=n[i.keysKey];void 0!==a&&(o["data-"+i.keysKey]=a),s.append(t("
issue->severity;?> issue->pri;?> issue->owner;?>issue->assignedTo;?>issue->assignedTo;?> issue->status;?>
issue->severityList, $issue->severity, $issue->severity)?> issue->priList, $issue->pri, $issue->pri)?> owner, $issue->owner)?>assignedTo, $issue->assignedTo)?>assignedTo, $issue->assignedTo)?> issue->statusList, $issue->status);?> diff --git a/module/block/view/waterfallriskblock.html.php b/module/block/view/waterfallriskblock.html.php index a0c407cc07..47e4e9af30 100644 --- a/module/block/view/waterfallriskblock.html.php +++ b/module/block/view/waterfallriskblock.html.php @@ -3,9 +3,11 @@ From f13b0db32e6f335549268e7e48dc0ae04e543b3c Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 30 Jun 2022 10:44:46 +0800 Subject: [PATCH 0055/1178] * Fix bug #24585. --- module/api/view/createlib.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/api/view/createlib.html.php b/module/api/view/createlib.html.php index 1699aadaa2..4f29e96290 100644 --- a/module/api/view/createlib.html.php +++ b/module/api/view/createlib.html.php @@ -33,7 +33,8 @@
api->control;?> - api->aclList, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?> + + api->aclList, 'open', "onchange='toggleAcl(this.value, \"lib\")' $isDisabled")?> api->noticeAcl['open'];?>
').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),h){var d=c[0].getBoundingClientRect();l.css({left:d.left,width:c.width(),overflow:"hidden"}),l.find(".fixed-header-copy").css({left:o.left-d.left,position:"relative",minWidth:i.width()}),a||c.data("fixHeaderScroll")||(c.data("fixHeaderScroll",1),i.width()>c.width()&&c.on("scroll",function(){e.fixHeader()}))}else l.css({left:o.left,width:o.width});var u=l.find("th");n.find("th").each(function(e){u.eq(e).css("width",t(this).outerWidth())})}else l.remove()},r.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var a=n.find("tbody");if(!a.length)return;e=a[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r="function"==typeof s?s(e,o):e.bottom>window.innerHeight-50-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r);var l=t("body"),c=l.hasClass("body-modal");if(r){var h=n.parent(),d=h.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:d?h[0].getBoundingClientRect().left:e.left,width:d?h.width():e.width}),c&&l.css("padding-bottom",40)}else o.css({width:"",left:0,bottom:0}),c&&l.css("padding-bottom",0)},r.prototype.checkAll=function(e){var i=this,n=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},r.prototype.checkRow=function(i,n,o){var a=this,s=a.getTable();a.isDataTable&&!i.is(".datatable-row-left")&&(i=s.find('.datatable-row-left[data-index="'+i.data("index")+'"]'));var r=i.find('input[type="checkbox"]');if(r.length&&!r.is(":disabled")){n===e&&(n=!r.is(":checked")),a.isDataTable?s.find('.datatable-row[data-index="'+i.data("index")+'"]').toggleClass("checked",n):i.toggleClass("checked",n);var l=i.data("id");this.checkItems[l]=n,r.prop("checked",n).trigger("change"),o||(i.hasClass("table-parent")&&s.find((a.isDataTable?".fixed-left ":"")+"tbody>tr.parent-"+l).each(function(){a.checkRow(t(this),n,!0)}),a.updateCheckUI())}},r.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").not(".group-summary"),o=!1,a=null,s=0,r=!1,l=n.length;n.each(function(n){var c=t(this),h=c.find('input[type="checkbox"]');if(!h.length)return void l--;r=h.is(":checked");var d=e.isDataTable?i.find('.datatable-row[data-index="'+c.data("index")+'"]'):c;d.toggleClass("checked",r),d.toggleClass("row-check-begin",r&&!o),a&&a.toggleClass("row-check-end",!r&&o),r&&(s+=1),a=d,o=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange(),i.trigger("checkChange")},r.DEFAULTS={checkable:!0,checkOnClickRow:!0,ajaxForm:!1,selectable:!0,fixHeader:!a,fixFooter:!a,iframeWidth:900,replaceId:"self",nestLevelIndent:18,nested:!1,preserveNested:!0,hot:!1,iframeModalTrigger:".iframe:not(.disabled,[disabled])"},t.fn.table=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new r(this,a)),"string"==typeof e&&o[e]()})},r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()}); }(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){"string"==typeof i&&(n=i,i=null),n=n||"show",t.zui.messager?t.zui.messager[n](e,i):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});"function"==typeof r&&(r={complete:r}),r=t.extend({},n,l.data(),r);var c=r.beforeSubmit,h=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if((c&&c(n,a,s))===!1)return!1;l.removeClass("form-watched").enableForm(!1);var r={},h=a.find('[type="file"]');r.fileapi=h.length&&h[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var c=r.responser?t(r.responser):l.find(".form-responser");c.length||(c=t("#responser"));var h=i.message,p=function(){var n=i.callback;if(n)if("object"==typeof n){var o=n.target?e[n.target]:e,a=o[n.name];a.apply(l,Array.isArray(n.params)?n.params:[n.params])}else{var s=n.indexOf("("),r=(s>0?n.substr(0,s):n).split("."),c=e,h=r[0];r.length>1&&(h=r[1],"top"===r[0]?c=e.top:"parent"===r[0]&&(c=e.parent));var a=c[h];if("function"==typeof a){var d=[];return s>0&&")"==n[n.length-1]&&(d=t.parseJSON("["+n.substring(s+1,n.length-1)+"]")),d.push(i),a.apply(l,d)}}};if("success"===i.result){var f=r.locate||i.locate,g=r.closeModal||i.closeModal,m=r.ajaxReload||i.ajaxReload;if(l.enableForm(!0,!!(f||g||m)),h){var v=l.find('[type="submit"]').first(),y=!1;v.length&&(v.popover({container:"body",trigger:"manual",content:h,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||v.data("placement")||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){v.popover("destroy")},r.popoverTime||2e3),y=!0),c.length&&(c.html(''+h+"").show().delay(3e3).fadeOut(100),y=!0),y||a(h,"success")}if(u)return u(i,!0,l);if(g&&setTimeout(t.zui.closeModal,"number"==typeof g?g:r.closeModalTime||2e3),p()===!1)return;if(f)if("loadInModal"==f){var b=t(".modal");setTimeout(function(){b.load(b.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else"parent"===f||"top"===f?e[f]&&setTimeout(function(){e[f].location.reload()},1200):"reload"===f?setTimeout(function(){e.location.href=e.location.href},1200):setTimeout(function(){t.apps?t.apps.open(f):e.location.href=f},1200);if(m){var w=t(m);w.length&&w.load(e.location.href+" "+m,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof h)c.length?c.html(''+h+"").show().delay(3e3).fadeOut(100):a(h,"danger");else if("object"==typeof h){var x=!1,C=[];t.each(h,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var c=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",c);var h=t("#"+e+"_chosen");if(h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){c()===!0&&t(this).removeClass("has-error")}),!x){var d=o[0];if(o.hasClass("chosen"))o.trigger("chosen:activate").trigger("chosen:open"),d=o.parent().find(".chosen-container")[0];else if(o.is("textarea")&&o.data("keditor")){var u=o.data("keditor");u.focus(),u.edit.doc.body.focus(),d=o.parent().find(".ke-container")[0]}else o.focus();d.scrollIntoView&&d.scrollIntoView(),x=!0}}),C.length&&a(C.join(";"),"danger")}if(u)return u(i,!1,l);if(p()===!1)return}}},error:function(t,i,n){if((h&&h(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{finish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
'+(n.errorText||window.lang&&window.lang.timeout)+"
"),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=e.trim().split(" ");a.each(function(){var e=t(this),n=(e.text()+" "+(e.data("key")||e.data("filter")||"")).trim();e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active")),n.$.trigger("onSearchComplete",e)},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=(""===o.value||"0"===o.value)&&!o.label,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(c.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(e,n,o,a,s,r,l){if("object"==typeof e)return t.createLink(e.moduleName,e.methodName,e.vars,e.viewType,e.isOnlyBody,e.hash,e.tid);if(t.tabSession&&!l&&(l=t.tabSession.getTid()),a||(a=config.defaultView),s||(s=!1),o)for("string"==typeof o&&(o=o.split("&")),i=0;i'+d+"")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),c=s.find('[name="end"],.control-time-end'),h=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);c.find('option[value="'+i+'"]').length&&c.val(i),r.onChange&&r.onChange(c,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");c.find('option[value="'+u+'"]').length&&c.val(u),r.onChange&&r.onChange(c,u)}}else l.on("change",h),a(l,r.begin),a(c,r.end),s.data("timeSpanControlInit",!0);r.end||h()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,"")){var n=e.split("-");e=n[0];var o=n.length>1?n[1]:"testsuite"===e?"library":"view",a=t.createLink(e,o,"id="+i);t.apps?t.apps.open(a):window.location.href=a}else{var s={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||s[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(t){t?window.top.location.reload():window.location.reload()},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage(1)},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage(1)},t.zui.Picker&&(t.extend(t.zui.Picker.DEFAULTS,{optionRender:function(e,i,n){if("user"===n.options.type){var o=n.options.users;if(!o)return;var a=o[i.value];if(!a)return;if(e.find(".picker-option-text").text(a.realname||a.account),e.hasClass("picker-user-option"))return;return e.prepend(t('
').avatar({user:a})),a.deptName&&e.append(t('').text(a.deptName)),a.roleName&&e.append(t('').text(a.roleName)),e.addClass("picker-user-option")}},checkable:!0,maxListCount:500,disableScrollOnShow:!1}),t.zui.setUserPickerInfos=function(e){t.zui.Picker.DEFAULTS.users=t.extend({},t.zui.Picker.DEFAULTS.users,e)},t(function(){t(".picker-select[data-pickertype!='remote']").picker({chosenMode:!0}),t("[data-pickertype='remote']").each(function(){var e=t(this).attr("data-pickerremote");t(this).picker({chosenMode:!0,remote:e})}),window.pickerUsers&&t.zui.setUserPickerInfos(window.pickerUsers),t(".user-picker").picker({type:"user"})})),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;e.css("position","relative");var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+31+a>e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t.fn.chosen.Constructor=t.fn._chosen.Constructor,t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
{page}/{totalPage}
',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,c=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(c,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var h=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;c="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(c,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,h=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var d,u,p,f,g,m=function(){d||(d=t("#subNavbar"),u=t("#pageNav"),p=t("#pageActions"),f=d.children(".nav"),g=f.outerWidth());var e=d.outerWidth(),i=u.outerWidth()||0,n=p.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void f.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,g),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),x()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])}),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var C=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto"; -var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(C)},t(function(){t("textarea.autosize").each(C),t(document).on("input paste change","textarea.autosize",C)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var _="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=_,t("html").toggleClass("is-firefox",_).toggleClass("not-firefox",!_),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){var r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}).on("loaded.zui.modal",function(e){t("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var i=270,n=e.getBoundingClientRect();n.top<0&&(i=Math.min(270,n.height)+n.top),e.style.maxHeight=Math.min(270,i,t(window).height()-28)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),function(t){function e(){if(!config.skipRedirect&&!window.skipRedirect){var e=window.parent,i=config.currentModule,n=config.currentMethod,o="index"===i&&"index"===n,a="#_single"===location.hash||/(\?|\&)_single/.test(location.search)||o||!t("#mainHeader,#editorNav").length||"tutorial"===i||"install"===i||"upgrade"===i||"user"===i&&("login"===n||"deny"===n)||"my"===i&&"changepassword"===n||t("body").hasClass("allow-self-open"),s=location.href;if(e===window&&!a){var r=location.pathname+location.search+location.hash;return void(location.href=t.createLink("index","index","")+"#app="+encodeURIComponent(r))}if(e!==window&&e.$.apps){o&&e.location.reload();var l=window.name;if(0===l.indexOf("app-")){t.apps=window.apps=e.$.apps;var c=l.substring(4);t.appCode=c,t(document).on("click",function(t){var i=e.document.getElementById(window.name);if(i){var n=e.document.getElementById(i.name)||i;if(n){var o;"function"==typeof Event?o=new Event(t.type,{bubbles:!0}):(o=document.createEvent("Event"),o.initEvent(t.type,!0,!0)),n.dispatchEvent(o)}}}).on("click","a,.open-in-app,.show-in-app",function(e){var i=t(this);if(!i.is("[data-modal],[data-toggle],[data-ride],[data-tab],.iframe,.not-in-app,[target]")&&!i.data("zui.modaltrigger")){var n=i.hasClass("show-in-app")?"":i.attr("href")||(i.is("a")?"":i.data("url")),o=i.data("app")||i.data("group");if(n){if(0===n.indexOf("javascript:")||"#"===n[0])return;var a=t.parseLink(n);if(a.external)return;if("index"===a.moduleName&&"index"===a.methodName)return window.location.reload(),void e.preventDefault()}else if(!o)return;o||(o=t.apps.getAppCode(n)),o&&("help"===o&&(t.apps.appsMap.help.text=i.text(),t.apps.appsMap.help.url||(t.apps.appsMap.help.url=n)),t.apps.open(n,o)&&e.preventDefault())}}),t.apps.updateUrl(c,s,document.title)}}}}function i(){var e=t("#navbar>.nav");if(e.length){var i=t("#heading"),n=+i.css("left").replace("px",""),o=i.outerWidth(),a=e.width(),s=t("#mainHeader>.container").width()-2*n,r=Math.floor((s-a)/2);e.css("marginLeft",r>>0;if(0===o)return!1;for(var a=0|e,s=Math.max(a>=0?a:o-Math.abs(a),0);s1&&("?"===e[0]&&(e=e.substr(1)),e.split("&").forEach(function(t){var e=t.split("=",2);if(e.length>1)try{i[e[0]]=decodeURIComponent(e[1])}catch(n){i[e[0]]=""}else i[e[0]]=""})),t?i[t]:i},t.parseLink=function(e){if(!e)return{};var i=0===e.indexOf("http:")||0===e.indexOf("https:");if(i){var n=window.location.origin;if(e.indexOf(n)<0)return{external:!0,url:e};e=e.substr((n+config.webRoot).length)}var o=e.split("#"),a=o[0].split("?"),s=a[1],r=s?t.getSearchParam("",s):{},l=a[0],c={url:e,isOnlyBody:"yes"===r.onlybody,vars:[],hash:o[1]||"",params:r,tid:r.tid||""};if("GET"===config.requestType){c.moduleName=r[config.moduleVar]||"index",c.methodName=r[config.methodVar]||"index",c.viewType=r[config.viewVar]||config.defaultView;for(var h in r)h!==config.moduleVar&&h!==config.methodVar&&h!==config.viewVar&&"onlybody"!==h&&"tid"!==h&&c.vars.push([h,r[h]])}else{var d=l.lastIndexOf("/");d===l.length-1&&(l=l.substr(0,d),d=l.lastIndexOf("/")),d>=0&&(l=l.substr(d+1));var u=l.lastIndexOf(".");u>=0?(c.viewType=l.substr(u+1),l=l.substr(0,u)):c.viewType=config.defaultView;var p=l.split(config.requestFix);if(c.moduleName=p[0]||"index",c.methodName=p[1]||"index",p.length>2)for(var f=2;f.nav>li").length>10&&(i(),t(window).on("resize",i)),setTimeout(n,1e3)})}(jQuery),function(t){"use strict";function e(e,i){"object"!=typeof i&&(i={user:i});var n=t(e);i=t.extend({},n.data(),i);var o=i.user;"string"==typeof o&&(o={account:o});var a={},s=i.size;s&&(a.width=s,a.height=s,a.lineHeight=s,Number.isNaN(+s)||n.addClass("size-"+s));var r=!!o.avatar;if(n.toggleClass("has-image",r).toggleClass("has-text",!r),n.empty(),r)n.append(t("").attr("src",o.avatar));else{var l=t.zui.strCode(o.account)*(i.hueDistance||43)%360;a.background="hsl("+l+","+(i.saturation||"40%")+","+(i.lightness||"60%")+")",Number.isNaN(+s)||(a.fontSize=Math.round(s/2)+"px");var c=o.name||o.realname||o.account;c=/^[\u4e00-\u9fa5\s]+$/.test(c)?c.length<=2?c:c.substring(c.length-2):/^[A-Za-z\d\s]+$/.test(c)?c[0].toUpperCase():c.length<=2?c:c.substring(0,2),n.append(t('').text(c))}return n.css(a)}t.fn.avatar=function(t){return this.each(function(){e(this,t)})}}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file +var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(C)},t(function(){t("textarea.autosize").each(C),t(document).on("input paste change","textarea.autosize",C)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var _="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=_,t("html").toggleClass("is-firefox",_).toggleClass("not-firefox",!_),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){var r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}).on("loaded.zui.modal",function(e){t("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var i=270,n=e.getBoundingClientRect();n.top<0&&(i=Math.min(270,n.height)+n.top),e.style.maxHeight=Math.min(270,i,t(window).height()-28)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),function(t){function e(){if(!config.skipRedirect&&!window.skipRedirect){var e=window.parent,i=config.currentModule,n=config.currentMethod;if("file"!==i||"download"!==n){var o="index"===i&&"index"===n,a="#_single"===location.hash||/(\?|\&)_single/.test(location.search)||o||!t("#mainHeader,#editorNav").length||"tutorial"===i||"install"===i||"upgrade"===i||"user"===i&&("login"===n||"deny"===n)||"my"===i&&"changepassword"===n||t("body").hasClass("allow-self-open"),s=location.href;if(e===window&&!a){var r=location.pathname+location.search+location.hash;return void(location.href=t.createLink("index","index","")+"#app="+encodeURIComponent(r))}if(e!==window&&e.$.apps){o&&e.location.reload();var l=window.name;if(0===l.indexOf("app-")){t.apps=window.apps=e.$.apps;var c=l.substring(4);t.appCode=c,t(document).on("click",function(t){var i=e.document.getElementById(window.name);if(i){var n=e.document.getElementById(i.name)||i;if(n){var o;"function"==typeof Event?o=new Event(t.type,{bubbles:!0}):(o=document.createEvent("Event"),o.initEvent(t.type,!0,!0)),n.dispatchEvent(o)}}}).on("click","a,.open-in-app,.show-in-app",function(e){var i=t(this);if(!i.is("[data-modal],[data-toggle],[data-ride],[data-tab],.iframe,.not-in-app,[target]")&&!i.data("zui.modaltrigger")){var n=i.hasClass("show-in-app")?"":i.attr("href")||(i.is("a")?"":i.data("url")),o=i.data("app")||i.data("group");if(n){if(0===n.indexOf("javascript:")||"#"===n[0])return;var a=t.parseLink(n);if(a.external||"file"===a.moduleName&&"download"===a.methodName)return;if("index"===a.moduleName&&"index"===a.methodName)return window.location.reload(),void e.preventDefault()}else if(!o)return;o||(o=t.apps.getAppCode(n)),o&&("help"===o&&(t.apps.appsMap.help.text=i.text(),t.apps.appsMap.help.url||(t.apps.appsMap.help.url=n)),t.apps.open(n,o)&&e.preventDefault())}}),t.apps.updateUrl(c,s,document.title)}}}}}function i(){var e=t("#navbar>.nav");if(e.length){var i=t("#heading"),n=+i.css("left").replace("px",""),o=i.outerWidth(),a=e.width(),s=t("#mainHeader>.container").width()-2*n,r=Math.floor((s-a)/2);e.css("marginLeft",r>>0;if(0===o)return!1;for(var a=0|e,s=Math.max(a>=0?a:o-Math.abs(a),0);s1&&("?"===e[0]&&(e=e.substr(1)),e.split("&").forEach(function(t){var e=t.split("=",2);if(e.length>1)try{i[e[0]]=decodeURIComponent(e[1])}catch(n){i[e[0]]=""}else i[e[0]]=""})),t?i[t]:i},t.parseLink=function(e){if(!e)return{};var i=0===e.indexOf("http:")||0===e.indexOf("https:");if(i){var n=window.location.origin;if(e.indexOf(n)<0)return{external:!0,url:e};e=e.substr((n+config.webRoot).length)}var o=e.split("#"),a=o[0].split("?"),s=a[1],r=s?t.getSearchParam("",s):{},l=a[0],c={url:e,isOnlyBody:"yes"===r.onlybody,vars:[],hash:o[1]||"",params:r,tid:r.tid||""};if("GET"===config.requestType){c.moduleName=r[config.moduleVar]||"index",c.methodName=r[config.methodVar]||"index",c.viewType=r[config.viewVar]||config.defaultView;for(var h in r)h!==config.moduleVar&&h!==config.methodVar&&h!==config.viewVar&&"onlybody"!==h&&"tid"!==h&&c.vars.push([h,r[h]])}else{var d=l.lastIndexOf("/");d===l.length-1&&(l=l.substr(0,d),d=l.lastIndexOf("/")),d>=0&&(l=l.substr(d+1));var u=l.lastIndexOf(".");u>=0?(c.viewType=l.substr(u+1),l=l.substr(0,u)):c.viewType=config.defaultView;var p=l.split(config.requestFix);if(c.moduleName=p[0]||"index",c.methodName=p[1]||"index",p.length>2)for(var f=2;f.nav>li").length>10&&(i(),t(window).on("resize",i)),setTimeout(n,1e3)})}(jQuery),function(t){"use strict";function e(e,i){"object"!=typeof i&&(i={user:i});var n=t(e);i=t.extend({},n.data(),i);var o=i.user;"string"==typeof o&&(o={account:o});var a={},s=i.size;s&&(a.width=s,a.height=s,a.lineHeight=s,Number.isNaN(+s)||n.addClass("size-"+s));var r=!!o.avatar;if(n.toggleClass("has-image",r).toggleClass("has-text",!r),n.empty(),r)n.append(t("").attr("src",o.avatar));else{var l=t.zui.strCode(o.account)*(i.hueDistance||43)%360;a.background="hsl("+l+","+(i.saturation||"40%")+","+(i.lightness||"60%")+")",Number.isNaN(+s)||(a.fontSize=Math.round(s/2)+"px");var c=o.name||o.realname||o.account;c=/^[\u4e00-\u9fa5\s]+$/.test(c)?c.length<=2?c:c.substring(c.length-2):/^[A-Za-z\d\s]+$/.test(c)?c[0].toUpperCase():c.length<=2?c:c.substring(0,2),n.append(t('').text(c))}return n.css(a)}t.fn.avatar=function(t){return this.each(function(){e(this,t)})}}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file diff --git a/www/theme/zui/css/min.css b/www/theme/zui/css/min.css index cdb728f284..d669612738 100644 --- a/www/theme/zui/css/min.css +++ b/www/theme/zui/css/min.css @@ -1,5 +1,5 @@ /*! - * ZUI: ZUI for Zentao - v1.10.0 - 2022-06-28 + * ZUI: ZUI for Zentao - v1.10.0 - 2022-06-30 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2022 cnezsoft.com; Licensed MIT From afa237c3acce104a3421486c3bc958f1f6a7f97a Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 30 Jun 2022 13:03:04 +0800 Subject: [PATCH 0069/1178] * Fix bug #23250. --- module/search/view/buildform.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index 0a1776aa68..9a1ecc4516 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -292,7 +292,7 @@ $(function() var $this = $(this); var $chosen = $this.next('.chosen-container').removeClass('chosen-up'); var $drop = $chosen.find('.chosen-drop'); - $chosen.toggleClass('chosen-up', $drop.height() + $drop.offset().top - $(document).scrollTop() > $(window).height()); + if($this.data('drop_direction') === 'auto') $chosen.toggleClass('chosen-up', $drop.height() + $drop.offset().top - $(document).scrollTop() > $(window).height()); }); $searchForm.find('.picker-select').each(function() From 6e107a47831a82a23f657fdf93f860f5776202d1 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 30 Jun 2022 13:15:03 +0800 Subject: [PATCH 0070/1178] * Fix bug #24288. --- module/testtask/js/common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index 98acc21e3f..26df905e98 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -36,7 +36,8 @@ function adjustPriBoxWidth() var boxWidth = $('#ownerAndPriBox').width(); var beginWidth = $("input[name='begin']").outerWidth(); var addonWidth = $('#ownerAndPriBox .input-group-addon').outerWidth(); - $('#pri,#pri_chosen .chosen-single').css('width', boxWidth - beginWidth -addonWidth); + var width = boxWidth - beginWidth - addonWidth; + $('#pri,#pri_chosen .chosen-single').css('width', width > 0 ? width : '160px'); } /** From 7528cdfdcf4b1e472658427a5dd0277fb3088c15 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 30 Jun 2022 13:16:31 +0800 Subject: [PATCH 0071/1178] * Fix bug #24554. --- lib/base/front/front.class.php | 2 -- module/product/control.php | 12 ++++++------ module/story/model.php | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 4c18838dfb..9afe2605e6 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -501,8 +501,6 @@ class baseHTML $gobackList = isset($_COOKIE['goback']) ? json_decode($_COOKIE['goback'], true) : array(); $gobackLink = isset($gobackList[$tab]) ? $gobackList[$tab] : ''; - if(strpos($misc, 'data-app') === false) $misc .= " data-app='" . $tab . "'"; - /* If the link of the referer is not the link of the current page or the link of the index, the cookie and gobackLink will be updated. */ if(!preg_match("/(m=|\/)(index|search|$currentModule)(&f=|-)(index|buildquery|$currentMethod)(&|-|\.)?/", strtolower($refererLink))) { diff --git a/module/product/control.php b/module/product/control.php index 4f724735e9..1108ea3e27 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -148,18 +148,18 @@ class product extends control } /* Set menu. */ - if($this->app->tab == 'product') + if($this->app->tab == 'project') + { + $this->session->set('storyList', $this->app->getURI(true), 'project'); + $this->loadModel('project')->setMenu($projectID); + } + else { $this->session->set('storyList', $this->app->getURI(true), 'product'); $this->session->set('productList', $this->app->getURI(true), 'product'); $this->product->setMenu($productID, $branch, 0, '', "storyType=$storyType"); } - if($this->app->tab == 'project') - { - $this->session->set('storyList', $this->app->getURI(true), 'project'); - $this->loadModel('project')->setMenu($projectID); - } /* Lower browse type. */ $browseType = strtolower($browseType); diff --git a/module/story/model.php b/module/story/model.php index d531c354e5..7ffad37ed8 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3892,7 +3892,8 @@ class storyModel extends model $menu .= $this->buildMenu('story', 'close', $params, $story, $type, '', '', 'iframe', true); $menu .= $this->buildMenu('story', 'edit', $params . "&from=$story->from", $story, $type); - if($story->type != 'requirement' and $this->config->vision != 'lite') $menu .= $this->buildMenu('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$params", $story, $type, 'sitemap', '', '', false, "data-app='qa'"); + $tab = $this->app->tab == 'project' ? 'project' : 'qa'; + if($story->type != 'requirement' and $this->config->vision != 'lite') $menu .= $this->buildMenu('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$params", $story, $type, 'sitemap', '', '', false, "data-app='$tab'"); if($this->app->rawModule != 'projectstory' OR $this->config->vision == 'lite') { From e4637e9ab35858fb72dab982e0064daf9fd150df Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 30 Jun 2022 05:25:31 +0000 Subject: [PATCH 0072/1178] * Fix bug #24472. --- module/task/js/batchcreate.js | 1 - module/task/view/batchcreate.html.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 70291eb881..b98330264c 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -136,7 +136,6 @@ function setPreview(num) storyLink = storyLink + concat + 'onlybody=yes'; } $('#preview' + num).removeAttr('disabled'); - $('#preview' + num).modalTrigger({type:'iframe'}); $('#preview' + num).attr('href', storyLink); } else diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index 8cf425cace..deac7a7e18 100755 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -122,7 +122,7 @@
- + From 2fe046f186eed579c1d6e95a37300ed3235f87ea Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 30 Jun 2022 13:25:33 +0800 Subject: [PATCH 0073/1178] * Fix bug #23942. --- module/api/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/api/control.php b/module/api/control.php index 88c28a5362..2601e6e871 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -251,9 +251,10 @@ class api extends control $id = $this->api->createStruct($data); + if(dao::isError()) return $this->sendError(dao::getError()); + $this->action->create('apistruct', $id, 'Created'); - if(dao::isError()) return $this->sendError(dao::getError()); return $this->sendSuccess(array('locate' => helper::createLink('api', 'struct', "libID=$libID"))); } From 0f18bca723a08137e09e35945c233c13f7ce5b8b Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 30 Jun 2022 05:27:00 +0000 Subject: [PATCH 0074/1178] * Fix bug #24472. --- module/task/view/batchcreate.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/view/batchcreate.html.php b/module/task/view/batchcreate.html.php index deac7a7e18..02d295aad4 100755 --- a/module/task/view/batchcreate.html.php +++ b/module/task/view/batchcreate.html.php @@ -122,7 +122,7 @@
- + From 5a7778acbe1fb6fcf8c4d813f2a9d17f901dbdc9 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 30 Jun 2022 13:37:34 +0800 Subject: [PATCH 0075/1178] * Fixed TAB return error. --- module/common/model.php | 4 ++-- module/testtask/view/linkcase.html.php | 2 +- module/testtask/view/report.html.php | 2 +- module/testtask/view/view.html.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 880ebdf6e6..a80b4b904a 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1800,14 +1800,14 @@ EOD; * @access public * @return void */ - static public function printBack($backLink, $class = '') + static public function printBack($backLink, $class = '', $misc = '') { global $lang, $app; if(isonlybody()) return false; if(empty($class)) $class = 'btn'; $title = $lang->goback . $lang->backShortcutKey; - echo html::a($backLink, ' ' . $lang->goback, '', "id='back' class='{$class}' title={$title} data-app='{$app->tab}'"); + echo html::a($backLink, ' ' . $lang->goback, '', "id='back' class='{$class}' title={$title} $misc"); } /** diff --git a/module/testtask/view/linkcase.html.php b/module/testtask/view/linkcase.html.php index 07ad73eac5..821c398f65 100644 --- a/module/testtask/view/linkcase.html.php +++ b/module/testtask/view/linkcase.html.php @@ -14,7 +14,7 @@ diff --git a/module/file/view/printfiles.html.php b/module/file/view/printfiles.html.php index b82e3022f7..ee78a6ecc0 100644 --- a/module/file/view/printfiles.html.php +++ b/module/file/view/printfiles.html.php @@ -7,8 +7,7 @@ diff --git a/module/story/model.php b/module/story/model.php index e514fcb1da..854cde440e 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3927,7 +3927,7 @@ class storyModel extends model if($story->stage == 'projected') $title = $this->lang->story->subDivideTip['projected']; } } - $menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID={$this->session->project}", $story, $type, 'split', '', 'showinonlybody', '', '', $title); + $menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params", $story, $type, 'split', '', 'showinonlybody', '', '', $title); } if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite') $menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody'); diff --git a/module/task/control.php b/module/task/control.php index 6359ec1bf2..b611d67ee0 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -1758,22 +1758,29 @@ class task extends control echo html::select('task', empty($tasks) ? array('' => '') : $tasks, $taskID, "class='form-control'"); } - public function ajaxGetTasksByExecution($executionID, $maxTaskID = 0) + /** + * Ajax get tasks for execution list. + * + * @param int $executionID + * @param int $maxTaskID + * @access public + * @return void + */ + public function ajaxGetTasks($executionID, $maxTaskID = 0) { $this->loadModel('task'); + $this->loadModel('execution'); + $execution = $this->dao->findById($executionID)->from(TABLE_EXECUTION)->fetch(); - //总数、更多、最后一条ID, $tasks = $this->dao->select('*')->from(TABLE_TASK) ->where('deleted')->eq(0) ->andWhere('status')->ne('closed') ->andWhere('execution')->eq($executionID) ->andWhere('id')->gt($maxTaskID) ->orderBy('id_asc') - ->limit(50) ->fetchAll('id'); $users = $this->loadModel('user')->getPairs('noletter|nodeleted'); - $html = ''; foreach($tasks as $task) { if($task->parent > 0) @@ -1784,47 +1791,57 @@ class task extends control unset($tasks[$task->id]); } } - - //$parentClass = $task->parent == '-1' ? 'table-nest-child-hide' : ''; - //$parentID = $task->parent > 0 ? $task->parent : $executionID; - - $html .= "id data-nest-path='$executionID,$task->id' data-nest-parent=$executionID class='is-nest-child'>"; - $html .= ''; - $html .= html::a($this->createLink('task', 'view', "id=$task->id"), $task->name); - $html .= ''; - $html .= ''; - $html .= zget($users, $task->assignedTo, ''); - $html .= ''; - $html .= ''; - $html .= zget($this->lang->task->statusList, $task->status, ''); - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= $task->estStarted; - $html .= ''; - $html .= ''; - $html .= $task->deadline; - $html .= ''; - $html .= ''; - $html .= $task->estimate; - $html .= ''; - $html .= ''; - $html .= $task->consumed; - $html .= ''; - $html .= ''; - $html .= $task->left; - $html .= ''; - $html .= ''; - $html .= '燃尽图'; - $html .= ''; - $html .= ''; - $html .= '操作'; - $html .= ''; - $html .= ''; } - die(json_encode(array('body' => $html, 'count' => count($tasks), 'maxTaskID' => $task->id))); + $body = ''; + $tasks = array_chunk($tasks, 50, true); + $tasks = $tasks[0]; + $count = count($tasks); + foreach($tasks as $task) + { + $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$task->id," : ",$execution->id,$task->id,"; + $showmore = ($count == 50 and $task == end($tasks)) ? 'showmore' : ''; + + $body .= "id data-nest-path='$path' data-nest-parent=$executionID class='is-nest-child $showmore'>"; + $body .= '' . html::a($this->createLink('task', 'view', "id=$task->id"), $task->name) . ''; + $body .= '' . zget($users, $task->assignedTo, '') . ''; + $body .= '' . zget($this->lang->task->statusList, $task->status, '') . ''; + $body .= ''; + $body .= '' . $task->estStarted . ''; + $body .= '' . $task->deadline . ''; + $body .= '' . $task->estimate . $this->lang->execution->workHourUnit . ''; + $body .= '' . $task->consumed . $this->lang->execution->workHourUnit . ''; + $body .= '' . $task->left . $this->lang->execution->workHourUnit . ''; + $body .= ''; + $body .= ''; + $body .= $this->task->buildOperateMenu($task, 'browse'); + $body .= ''; + + if(!empty($task->children)) + { + foreach($task->children as $childTask) + { + $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$childTask->parent,$childTask->id," : ",$execution->id,$childTask->parent,$childTask->id,"; + + $body .= "id data-nest-path='$path' data-nest-parent=$executionID class='is-nest-child $showmore'>"; + $body .= '' . html::a($this->createLink('task', 'view', "id=$childTask->id"), $childTask->name) . ''; + $body .= '' . zget($users, $childTask->assignedTo, '') . ''; + $body .= '' . zget($this->lang->task->statusList, $childTask->status, '') . ''; + $body .= ''; + $body .= '' . $childTask->estStarted . ''; + $body .= '' . $childTask->deadline . ''; + $body .= '' . $childTask->estimate . $this->lang->execution->workHourUnit . ''; + $body .= '' . $childTask->consumed . $this->lang->execution->workHourUnit . ''; + $body .= '' . $childTask->left . $this->lang->execution->workHourUnit . ''; + $body .= ''; + $body .= ''; + $body .= $this->task->buildOperateMenu($childTask, 'browse'); + $body .= ''; + } + } + } + + die($body); } /** From 658a187e47e1627da5c465a26a872315ebe48fd3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 12 Jul 2022 14:05:40 +0800 Subject: [PATCH 0500/1178] * Fix bug of story and bug action in execution. --- module/bug/control.php | 203 ++++++++++++++---------------- module/execution/control.php | 40 +++--- module/execution/js/taskkanban.js | 14 +-- module/execution/model.php | 2 +- module/kanban/model.php | 10 +- module/story/control.php | 76 ++++++----- 6 files changed, 162 insertions(+), 183 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index b69ba372bb..594872a371 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1390,11 +1390,12 @@ class bug extends control * Update assign of bug. * * @param int $bugID - * @parm string $kanbanGroup + * @param string $kanbanGroup + * @param string $from taskkanban * @access public * @return void */ - public function assignTo($bugID, $kanbanGroup = 'default') + public function assignTo($bugID, $kanbanGroup = 'default', $from = '') { $bug = $this->bug->getById($bugID); $this->bug->checkBugExecutionPriv($bug); @@ -1414,28 +1415,24 @@ class bug extends control if(isonlybody()) { - $bug = $this->bug->getById($bugID); - $execution = $this->loadModel('execution')->getByID($bug->execution); - if($this->app->tab == 'execution') + $bug = $this->bug->getById($bugID); + $execution = $this->loadModel('execution')->getByID($bug->execution); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and isset($execution->type) and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - - if(isset($execution->type) and $execution->type == 'kanban') - { - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); - } + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); } else { @@ -1627,10 +1624,11 @@ class bug extends control * * @param int $bugID * @param string $extra + * @param string $from taskkanban * @access public * @return void */ - public function confirmBug($bugID, $extra = '') + public function confirmBug($bugID, $extra = '', $from = '') { $bug = $this->bug->getById($bugID); if(!empty($_POST)) @@ -1646,28 +1644,24 @@ class bug extends control parse_str($extra, $output); if(isonlybody()) { - $execution = $this->loadModel('execution')->getByID($bug->execution); - if($this->app->tab == 'execution') + $execution = $this->loadModel('execution')->getByID($bug->execution); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and isset($execution->type) and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - - if(isset($execution->type) and $execution->type == 'kanban') - { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); - } + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); } else { @@ -1714,10 +1708,11 @@ class bug extends control * * @param int $bugID * @param string $extra + * @param string $from taskkanban * @access public * @return void */ - public function resolve($bugID, $extra = '') + public function resolve($bugID, $extra = '', $from = '') { $bug = $this->bug->getById($bugID); if($bug->execution) $execution = $this->loadModel('execution')->getByID($bug->execution); @@ -1753,27 +1748,23 @@ class bug extends control parse_str($extra, $output); if(isonlybody()) { - if($this->app->tab == 'execution') + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and isset($execution->type) and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if(isset($execution->type) and $execution->type == 'kanban') - { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); - } + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); } else { @@ -1842,10 +1833,11 @@ class bug extends control * * @param int $bugID * @param string $extra + * @param string $from taskkanban * @access public * @return void */ - public function activate($bugID, $extra = '') + public function activate($bugID, $extra = '', $from = '') { $bug = $this->bug->getById($bugID); if(!empty($_POST)) @@ -1866,27 +1858,23 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if($this->app->tab == 'execution') + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and isset($execution->type) and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - - if(isset($execution->type) and $execution->type == 'kanban') - { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); - } + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); } else { @@ -1917,10 +1905,11 @@ class bug extends control * * @param int $bugID * @param string $extra + * @param string $from taskkanban * @access public * @return void */ - public function close($bugID, $extra = '') + public function close($bugID, $extra = '', $from = '') { $bug = $this->bug->getById($bugID); if(!empty($_POST)) @@ -1937,28 +1926,24 @@ class bug extends control parse_str($extra, $output); if(isonlybody()) { - $execution = $this->loadModel('execution')->getByID($bug->execution); - if($this->app->tab == 'execution') + $execution = $this->loadModel('execution')->getByID($bug->execution); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and isset($execution->type) and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if(isset($execution->type) and $execution->type == 'kanban') - { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); - } + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($bug->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'bug' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"bug\", $kanbanData)")); } else { diff --git a/module/execution/control.php b/module/execution/control.php index 9cf79b345f..253c136057 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3221,15 +3221,16 @@ class execution extends control * @param int $executionID * @param int $storyID * @param string $confirm yes|no + * @param string $from taskkanban * @access public * @return void */ - public function unlinkStory($executionID, $storyID, $confirm = 'no') + public function unlinkStory($executionID, $storyID, $confirm = 'no', $from = '') { if($confirm == 'no') { $tip = $this->app->rawModule == 'projectstory' ? $this->lang->execution->confirmUnlinkExecutionStory : $this->lang->execution->confirmUnlinkStory; - return print(js::confirm($tip, $this->createLink('execution', 'unlinkstory', "executionID=$executionID&storyID=$storyID&confirm=yes"))); + return print(js::confirm($tip, $this->createLink('execution', 'unlinkstory', "executionID=$executionID&storyID=$storyID&confirm=yes&from=$from"))); } else { @@ -3251,26 +3252,23 @@ class execution extends control return $this->send($response); } - $execution = $this->execution->getByID($executionID); - if($this->app->tab == 'execution') + $execution = $this->execution->getByID($executionID); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($execution->type == 'kanban') - { - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($executionID, $execLaneType, $execGroupBy); - $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent', '', "parent.updateKanban(\"story\", $kanbanData)")); - } + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($executionID, $execLaneType, $execGroupBy); + $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent', '', "parent.updateKanban(\"story\", $kanbanData)")); } return print(js::reload('parent')); diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 6458b0a408..0f4c66956d 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -48,12 +48,12 @@ function renderUserAvatar(user, objectType, objectID, size, objectStatus) if(objectType == 'story') { if(!priv.canAssignStory && !user) return $noPrivAndNoAssigned; - var link = createLink('story', 'assignto', 'id=' + objectID, '', true); + var link = createLink('story', 'assignto', 'id=' + objectID + '&kanbanGroup=default&from=taskkanban', '', true); } if(objectType == 'bug') { if(!priv.canAssignBug && !user) return $noPrivAndNoAssigned; - var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); + var link = createLink('bug', 'assignto', 'id=' + objectID + '&kanbanGroup=default&from=taskkanban', '', true); } if(!user) return objectStatus == 'closed' ? '' : $(''); @@ -705,7 +705,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'unconfirmed' && priv.canConfirmBug) { - var link = createLink('bug', 'confirmBug', 'bugID=' + objectID, '', true); + var link = createLink('bug', 'confirmBug', 'bugID=' + objectID + '&extra=&from=taskkanban', '', true); showIframe = true; } } @@ -714,7 +714,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car if(fromColType == 'confirmed' || fromColType == 'unconfirmed') moveCard = true; if((fromColType == 'closed' || fromColType == 'fixed' || fromColType == 'testing' || fromColType == 'tested') && priv.canActivateBug) { - var link = createLink('bug', 'activate', 'bugID=' + objectID, '', true); + var link = createLink('bug', 'activate', 'bugID=' + objectID + '&extra=&from=taskkanban', '', true); showIframe = true; } } @@ -722,7 +722,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'fixing' || fromColType == 'confirmed' || fromColType == 'unconfirmed') { - var link = createLink('bug', 'resolve', 'bugID=' + objectID, '', true); + var link = createLink('bug', 'resolve', 'bugID=' + objectID + '&extra=&from=taskkanban', '', true); showIframe = true; } } @@ -738,7 +738,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'testing' || fromColType == 'tested') { - var link = createLink('bug', 'close', 'bugID=' + objectID, '', true); + var link = createLink('bug', 'close', 'bugID=' + objectID + '&extra=&from=taskkanban', '', true); showIframe = true; } } @@ -769,7 +769,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(toColType == 'closed' && priv.canCloseStory) { - var link = createLink('story', 'close', 'storyID=' + objectID, '', true); + var link = createLink('story', 'close', 'storyID=' + objectID + '&from=taskkanban', '', true); showIframe = true; } else diff --git a/module/execution/model.php b/module/execution/model.php index b9d90cbfa3..6d8dff648e 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -79,7 +79,7 @@ class executionModel extends model $executions = $this->getPairs(0, 'all', 'nocode'); if(!$executionID and $this->session->execution) $executionID = $this->session->execution; if(!$executionID or !in_array($executionID, array_keys($executions))) $executionID = key($executions); - $this->session->set('execution', $executionID); + $this->session->set('execution', $executionID, $this->app->tab); /* Unset story, bug, build and testtask if type is ops. */ if($execution and $execution->type == 'stage' and $this->config->systemMode == 'new') diff --git a/module/kanban/model.php b/module/kanban/model.php index 36f43289d4..0ec764aa78 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3679,7 +3679,7 @@ class kanbanModel extends model if(common::hasPriv('task', 'create') and $toTaskPriv) $menu[] = array('label' => $this->lang->execution->wbs, 'icon' => 'plus', 'url' => helper::createLink('task', 'create', "executionID=$executionID&storyID=$story->id&moduleID=$story->module", '', true), 'size' => '95%'); if(common::hasPriv('task', 'batchCreate') and $toTaskPriv) $menu[] = array('label' => $this->lang->execution->batchWBS, 'icon' => 'pluses', 'url' => helper::createLink('task', 'batchCreate', "executionID=$executionID&storyID=$story->id&moduleID=0&taskID=0&iframe=true", '', true), 'size' => '95%'); if(common::hasPriv('story', 'activate') and $this->story->isClickable($story, 'activate')) $menu[] = array('label' => $this->lang->story->activate, 'icon' => 'magic', 'url' => helper::createLink('story', 'activate', "storyID=$story->id", '', true)); - if(common::hasPriv('execution', 'unlinkStory')) $menu[] = array('label' => $this->lang->execution->unlinkStory, 'icon' => 'unlink', 'url' => helper::createLink('execution', 'unlinkStory', "executionID=$executionID&storyID=$story->story&confirm=no", '', true)); + if(common::hasPriv('execution', 'unlinkStory')) $menu[] = array('label' => $this->lang->execution->unlinkStory, 'icon' => 'unlink', 'url' => helper::createLink('execution', 'unlinkStory', "executionID=$executionID&storyID=$story->story&confirm=no&from=taskkanban", '', true)); if(common::hasPriv('story', 'delete')) $menu[] = array('label' => $this->lang->story->delete, 'icon' => 'trash', 'url' => helper::createLink('story', 'delete', "storyID=$story->id&confirm=no&from=taskkanban")); $menus[$story->id] = $menu; @@ -3693,11 +3693,11 @@ class kanbanModel extends model $menu = array(); if(common::hasPriv('bug', 'edit') and $this->bug->isClickable($bug, 'edit')) $menu[] = array('label' => $this->lang->bug->edit, 'icon' => 'edit', 'url' => helper::createLink('bug', 'edit', "bugID=$bug->id", '', true), 'size' => '95%'); - if(common::hasPriv('bug', 'confirmBug') and $this->bug->isClickable($bug, 'confirmBug')) $menu[] = array('label' => $this->lang->bug->confirmBug, 'icon' => 'ok', 'url' => helper::createLink('bug', 'confirmBug', "bugID=$bug->id", '', true)); - if(common::hasPriv('bug', 'resolve') and $this->bug->isClickable($bug, 'resolve')) $menu[] = array('label' => $this->lang->bug->resolve, 'icon' => 'checked', 'url' => helper::createLink('bug', 'resolve', "bugID=$bug->id", '', true)); - if(common::hasPriv('bug', 'close') and $this->bug->isClickable($bug, 'close')) $menu[] = array('label' => $this->lang->bug->close, 'icon' => 'off', 'url' => helper::createLink('bug', 'close', "bugID=$bug->id", '', true)); + if(common::hasPriv('bug', 'confirmBug') and $this->bug->isClickable($bug, 'confirmBug')) $menu[] = array('label' => $this->lang->bug->confirmBug, 'icon' => 'ok', 'url' => helper::createLink('bug', 'confirmBug', "bugID=$bug->id&extra=&from=taskkanban", '', true)); + if(common::hasPriv('bug', 'resolve') and $this->bug->isClickable($bug, 'resolve')) $menu[] = array('label' => $this->lang->bug->resolve, 'icon' => 'checked', 'url' => helper::createLink('bug', 'resolve', "bugID=$bug->id&extra=&from=taskkanban", '', true)); + if(common::hasPriv('bug', 'close') and $this->bug->isClickable($bug, 'close')) $menu[] = array('label' => $this->lang->bug->close, 'icon' => 'off', 'url' => helper::createLink('bug', 'close', "bugID=$bug->id&extra=&from=taskkanban", '', true)); if(common::hasPriv('bug', 'create') and $this->bug->isClickable($bug, 'create')) $menu[] = array('label' => $this->lang->bug->copy, 'icon' => 'copy', 'url' => helper::createLink('bug', 'create', "productID=$bug->product&branch=$bug->branch&extras=bugID=$bug->id", '', true), 'size' => '95%'); - if(common::hasPriv('bug', 'activate') and $this->bug->isClickable($bug, 'activate')) $menu[] = array('label' => $this->lang->bug->activate, 'icon' => 'magic', 'url' => helper::createLink('bug', 'activate', "bugID=$bug->id", '', true)); + if(common::hasPriv('bug', 'activate') and $this->bug->isClickable($bug, 'activate')) $menu[] = array('label' => $this->lang->bug->activate, 'icon' => 'magic', 'url' => helper::createLink('bug', 'activate', "bugID=$bug->id&extra=&from=taskkanban", '', true)); if(common::hasPriv('story', 'create') and $bug->status != 'closed') $menu[] = array('label' => $this->lang->bug->toStory, 'icon' => 'lightbulb', 'url' => helper::createLink('story', 'create', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", '', true), 'size' => '95%'); if(common::hasPriv('bug', 'delete')) $menu[] = array('label' => $this->lang->bug->delete, 'icon' => 'trash', 'url' => helper::createLink('bug', 'delete', "bugID=$bug->id&confirm=no&from=taskkanban")); diff --git a/module/story/control.php b/module/story/control.php index d24ca310df..82ed897f27 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1484,10 +1484,11 @@ class story extends control * Close a story. * * @param int $storyID + * @param string $from taskkanban * @access public * @return void */ - public function close($storyID) + public function close($storyID, $from = '') { if(!empty($_POST)) { @@ -1505,28 +1506,25 @@ class story extends control if(isonlybody()) { - $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution') + $execution = $this->execution->getByID($this->session->execution); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($this->app->tab == 'execution' and $execution->type == 'kanban') { $this->loadModel('kanban')->updateLane($this->session->execution, 'story', $storyID); - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($execution->type == 'kanban') - { - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($this->session->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"story\", $kanbanData)")); - } + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($this->session->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"story\", $kanbanData)")); } else { @@ -1852,10 +1850,11 @@ class story extends control * * @param int $storyID * @param string $kanbanGroup + * @param string $from taskkanban * @access public * @return void */ - public function assignTo($storyID, $kanbanGroup = 'default') + public function assignTo($storyID, $kanbanGroup = 'default', $from = '') { if(!empty($_POST)) { @@ -1871,26 +1870,23 @@ class story extends control if(isonlybody()) { - $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution') + $execution = $this->execution->getByID($this->session->execution); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + if($this->app->tab == 'execution' and $execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') - { - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($execution->id, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"story\", $kanbanData)")); - } + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $kanbanGroup, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + elseif($from == 'taskkanban') + { + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($execution->id, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'story' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"story\", $kanbanData)")); } else { From 69101c8409e76234c2fb942c5f1a632730b08d10 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 12 Jul 2022 06:06:02 +0000 Subject: [PATCH 0501/1178] * Fix bug about taskkanban. --- module/execution/js/taskkanban.js | 4 +-- module/kanban/model.php | 14 ++++---- module/task/control.php | 58 ++++++++++++++----------------- 3 files changed, 35 insertions(+), 41 deletions(-) diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 501518a84a..357a1a2304 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -43,7 +43,7 @@ function renderUserAvatar(user, objectType, objectID, size, objectStatus) if(objectType == 'task') { if(!priv.canAssignTask && !user) return $noPrivAndNoAssigned; - var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); + var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID + '&kanbanGroup=default&from=taskkanban', '', true); } if(objectType == 'story') { @@ -671,7 +671,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car } if(fromColType == 'pause' && priv.canActivateTask) { - var link = createLink('task', 'restart', 'taskID=' + objectID + '&extra=from=' + 'taskkanban', '', true); + var link = createLink('task', 'restart', 'taskID=' + objectID + '&from=' + 'taskkanban', '', true); showIframe = true; } if(fromColType == 'wait' && priv.canStartTask) diff --git a/module/kanban/model.php b/module/kanban/model.php index cd294a684d..cbcc5a2332 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3712,15 +3712,15 @@ class kanbanModel extends model { $menu = array(); - if(common::hasPriv('task', 'edit') and $this->task->isClickable($task, 'edit')) $menu[] = array('label' => $this->lang->task->edit, 'icon' => 'edit', 'url' => helper::createLink('task', 'edit', "taskID=$task->id&comment=0&kanbanGroup=default&from=$methodName", '', true), 'size' => '95%'); - if(common::hasPriv('task', 'pause') and $this->task->isClickable($task, 'pause')) $menu[] = array('label' => $this->lang->task->pause, 'icon' => 'pause', 'url' => helper::createLink('task', 'pause', "taskID=$task->id&extra=from=$methodName", '', true)); - if(common::hasPriv('task', 'restart') and $this->task->isClickable($task, 'restart')) $menu[] = array('label' => $this->lang->task->restart, 'icon' => 'play', 'url' => helper::createLink('task', 'restart', "taskID=$task->id&from=$methodName", '', true)); - if(common::hasPriv('task', 'recordEstimate') and $this->task->isClickable($task, 'recordEstimate')) $menu[] = array('label' => $this->lang->task->recordEstimate, 'icon' => 'time', 'url' => helper::createLink('task', 'recordEstimate', "taskID=$task->id&from=$methodName", '', true)); - if(common::hasPriv('task', 'activate') and $this->task->isClickable($task, 'activate')) $menu[] = array('label' => $this->lang->task->activate, 'icon' => 'magic', 'url' => helper::createLink('task', 'activate', "taskID=$task->id&extra=from=$methodName", '', true)); + if(common::hasPriv('task', 'edit') and $this->task->isClickable($task, 'edit')) $menu[] = array('label' => $this->lang->task->edit, 'icon' => 'edit', 'url' => helper::createLink('task', 'edit', "taskID=$task->id", '', true), 'size' => '95%'); + if(common::hasPriv('task', 'pause') and $this->task->isClickable($task, 'pause')) $menu[] = array('label' => $this->lang->task->pause, 'icon' => 'pause', 'url' => helper::createLink('task', 'pause', "taskID=$task->id&extra=from=taskkanban", '', true)); + if(common::hasPriv('task', 'restart') and $this->task->isClickable($task, 'restart')) $menu[] = array('label' => $this->lang->task->restart, 'icon' => 'play', 'url' => helper::createLink('task', 'restart', "taskID=$task->id&from=taskkanban", '', true)); + if(common::hasPriv('task', 'recordEstimate') and $this->task->isClickable($task, 'recordEstimate')) $menu[] = array('label' => $this->lang->task->recordEstimate, 'icon' => 'time', 'url' => helper::createLink('task', 'recordEstimate', "taskID=$task->id&from=taskkanban", '', true)); + if(common::hasPriv('task', 'activate') and $this->task->isClickable($task, 'activate')) $menu[] = array('label' => $this->lang->task->activate, 'icon' => 'magic', 'url' => helper::createLink('task', 'activate', "taskID=$task->id&extra=from=taskkanban", '', true)); if(common::hasPriv('task', 'batchCreate') and $this->task->isClickable($task, 'batchCreate')) $menu[] = array('label' => $this->lang->task->children, 'icon' => 'split', 'url' => helper::createLink('task', 'batchCreate', "execution=$task->execution&storyID=$task->story&moduleID=$task->module&taskID=$task->id", '', true), 'size' => '95%'); if(common::hasPriv('task', 'create') and $this->task->isClickable($task, 'create')) $menu[] = array('label' => $this->lang->task->copy, 'icon' => 'copy', 'url' => helper::createLink('task', 'create', "projctID=$task->execution&storyID=$task->story&moduleID=$task->module&taskID=$task->id", '', true), 'size' => '95%'); - if(common::hasPriv('task', 'cancel') and $this->task->isClickable($task, 'cancel')) $menu[] = array('label' => $this->lang->task->cancel, 'icon' => 'ban-circle', 'url' => helper::createLink('task', 'cancel', "taskID=$task->id&extra=from=$methodName", '', true)); - if(common::hasPriv('task', 'delete')) $menu[] = array('label' => $this->lang->task->delete, 'icon' => 'trash', 'url' => helper::createLink('task', 'delete', "executionID=$task->execution&taskID=$task->id&confirm=no&from=taskkanban")); + if(common::hasPriv('task', 'cancel') and $this->task->isClickable($task, 'cancel')) $menu[] = array('label' => $this->lang->task->cancel, 'icon' => 'ban-circle', 'url' => helper::createLink('task', 'cancel', "taskID=$task->id&extra=from=taskkanban", '', true)); + if(common::hasPriv('task', 'delete')) $menu[] = array('label' => $this->lang->task->delete, 'icon' => 'trash', 'url' => helper::createLink('task', 'delete', "executionID=$task->execution&taskID=$task->id&confirm=no&from=taskkanban")); $menus[$task->id] = $menu; } diff --git a/module/task/control.php b/module/task/control.php index 631d86ad06..ca3f051e44 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -546,14 +546,14 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($from == 'kanban') + if($execution->type == 'kanban') { $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } - if($from == 'taskkanban') + else { $kanbanData = $this->loadModel('kanban')->getExecutionKanban($task->execution, $execLaneType, $execGroupBy, $rdSearchValue); $kanbanType = $execLaneType == 'all' ? 'task' : key($kanbanData); @@ -781,7 +781,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($from == 'kanban') + if($execution->type == 'kanban') { $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroup, $rdSearchValue); $kanbanData = json_encode($kanbanData); @@ -1038,7 +1038,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($output['from'] == 'kanban') + if($execution->type == 'kanban') { $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); @@ -1109,7 +1109,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($from == 'kanban') + if($execution->type == 'kanban') { $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); $kanbanData = json_encode($kanbanData); @@ -1253,7 +1253,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($output['from'] == "kanban") + if($execution->type == "kanban") { $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); @@ -1350,7 +1350,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($output['from'] == 'kanban') + if($execution->type == 'kanban') { $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); @@ -1415,7 +1415,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($from == 'kanban') + if($execution->type == 'kanban') { $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); $kanbanData = json_encode($kanbanData); @@ -1492,33 +1492,27 @@ class task extends control } } - if($this->app->tab == 'execution' or $this->config->vision == 'lite') + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + if($execution->type == 'kanban') { - $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; - $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($execution->type == 'kanban') - { - $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); - $kanbanData = json_encode($kanbanData); + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); - } - else - { - $kanbanData = $this->loadModel('kanban')->getExecutionKanban($task->execution, $execLaneType, $execGroupBy, $rdSearchValue); - $kanbanType = $execLaneType == 'all' ? 'task' : key($kanbanData); - $kanbanData = $kanbanData[$kanbanType]; - $kanbanData = json_encode($kanbanData); - - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"task\", $kanbanData)")); - } + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } - else + if($output['from'] == 'taskkanban') { - return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + $kanbanData = $this->loadModel('kanban')->getExecutionKanban($task->execution, $execLaneType, $execGroupBy, $rdSearchValue); + $kanbanType = $execLaneType == 'all' ? 'task' : key($kanbanData); + $kanbanData = $kanbanData[$kanbanType]; + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban(\"task\", $kanbanData)")); } + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); } if(defined('RUN_MODE') && RUN_MODE == 'api') @@ -1673,7 +1667,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($output['from'] == 'kanban') + if($execution->type == 'kanban') { $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); @@ -1738,7 +1732,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; - if($output['from'] == "kanban") + if($execution->type == "kanban") { $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy, $rdSearchValue); From c56ec2cbe46c3d69c013674909185d151fcaa422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 12 Jul 2022 14:08:35 +0800 Subject: [PATCH 0502/1178] * Add stage name. --- module/project/view/execution.html.php | 4 ++-- module/task/control.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 9b56548bf4..0b00b71ec5 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -82,7 +82,7 @@ class=""> id;?> class="table-nest-icon icon table-nest-toggle"> - name;?> + createLink('execution', 'view', "executionID=$execution->id"), $execution->name);?> PM);?> project->statusList, $execution->status);?> @@ -189,7 +189,7 @@ ?> class=''> - name;?> + createLink('execution', 'view', "executionID=$child->id"), $child->name);?> PM);?> project->statusList, $child->status);?> diff --git a/module/task/control.php b/module/task/control.php index b611d67ee0..1eb54da1b0 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -1823,7 +1823,7 @@ class task extends control { $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$childTask->parent,$childTask->id," : ",$execution->id,$childTask->parent,$childTask->id,"; - $body .= "id data-nest-path='$path' data-nest-parent=$executionID class='is-nest-child $showmore'>"; + $body .= "id data-nest-path='$path' data-nest-parent=$executionID class='is-nest-child no-nest'>"; $body .= '' . html::a($this->createLink('task', 'view', "id=$childTask->id"), $childTask->name) . ''; $body .= '' . zget($users, $childTask->assignedTo, '') . ''; $body .= '' . zget($this->lang->task->statusList, $childTask->status, '') . ''; From 94c09e733dd1aaacace47e0a8ee6398142599748 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 12 Jul 2022 06:12:02 +0000 Subject: [PATCH 0503/1178] * Fix bug about taskkanban. --- module/task/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index ca3f051e44..676bdea286 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -497,7 +497,7 @@ class task extends control * @access public * @return void */ - public function edit($taskID, $comment = false, $kanbanGroup = 'default', $from = '') + public function edit($taskID, $comment = false, $kanbanGroup = 'default') { $this->commonAction($taskID); $task = $this->task->getById($taskID); From 1d1441f17fcdddf5e7d1163f9dcb1695bf60b5d3 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 12 Jul 2022 14:22:37 +0800 Subject: [PATCH 0504/1178] * Fix bug #25070. --- module/task/css/edit.css | 1 + module/task/js/create.js | 26 +++++++++++++++++++------- module/task/js/edit.js | 23 +++++++++++++++++++---- module/task/view/create.html.php | 5 ++++- module/task/view/edit.html.php | 13 +++++++++++-- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/module/task/css/edit.css b/module/task/css/edit.css index 479f0ca21d..7c89a401fb 100644 --- a/module/task/css/edit.css +++ b/module/task/css/edit.css @@ -1,3 +1,4 @@ .pl-10px {padding-left: 10px;} #showAllModuleBox{width:60px;} #showAllModuleBox .no-margin {padding-left:22px;} +#taskTeamEditor .sortable .input-group .input-group-addon.required:after {top: 10px; right: 2px; z-index: 3;} diff --git a/module/task/js/create.js b/module/task/js/create.js index d5a95fd922..08ad7b1547 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -530,8 +530,9 @@ $(document).on('click', '#testStory_chosen', function() $('#modalTeam .btn').click(function() { - var team = ''; - var time = 0; + var team = ''; + var time = 0; + var error = false; /* Unique team. */ $('select[name^=team]').each(function(i) @@ -548,9 +549,10 @@ $('#modalTeam .btn').click(function() $('select[name^=team]').each(function() { - if($(this).find('option:selected').text() != '') + var account = $(this).find('option:selected').text(); + if(account != '') { - team += ' ' + $(this).find('option:selected').text(); + team += ' ' + account; } estimate = parseFloat($(this).parents('td').next('td').find('[name^=teamEstimate]').val()); @@ -559,9 +561,16 @@ $('#modalTeam .btn').click(function() time += estimate; } - $('#teamMember').val(team); - $('#estimate').val(time); - }) + var requiredFieldList = ',' + requiredFields + ','; + if(account && requiredFieldList.indexOf(',estimate,') >= 0 && (estimate == 0 || isNaN(estimate))) + { + alert(estimateNotEmpty); + error = true; + return false; + } + }); + + if(error) return false; var teamList = team.split(" "); if(teamList.length <= 2) { @@ -570,6 +579,9 @@ $('#modalTeam .btn').click(function() } else { + $('#teamMember').val(team); + $('#estimate').val(time); + if(config.onlybody == 'yes' && vision == 'lite') { $('.close').parent().click(); diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 4ef575532d..97606c1f2e 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -176,6 +176,7 @@ $('#confirmButton').click(function() var totalEstimate = 0; var totalConsumed = oldConsumed; var totalLeft = 0; + var error = false; $('select[name^=team]').each(function() { if($(this).find('option:selected').text() == '') return; @@ -190,22 +191,36 @@ $('#confirmButton').click(function() left = parseFloat($(this).parents('td').next('td').find('[name^=teamLeft]').val()); if(!isNaN(left)) totalLeft += left; + + var requiredFieldList = ',' + requiredFields + ','; + if(requiredFieldList.indexOf(',estimate,') >= 0 && (estimate == 0 || isNaN(estimate))) + { + $(this).val('').trigger("chosen:updated"); + alert(estimateNotEmpty); + error = true; + return false; + } }) - $('#estimate').val(totalEstimate); - $('#consumedSpan').html(totalConsumed); - $('#left').val(totalLeft); - updateAssignedTo(); + + if(error) return false; if(memberCount < 2) { alert(teamMemberError); return false; } + if(totalLeft == 0 && (taskStatus == 'doing' || taskStatus == 'pause')) { alert(totalLeftError); return false; } + + $('#estimate').val(totalEstimate); + $('#consumedSpan').html(totalConsumed); + $('#left').val(totalLeft); + updateAssignedTo(); + $('.close').click(); }); diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 0f6c3bf5a1..bcd0feddbf 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -18,12 +18,15 @@ task->error->teamMember);?> vision);?> task->create->requiredFields);?> +error->notempty, $lang->task->estimate))?> task->create->requiredFields) as $field) { + if($field) $requiredFields[$field] = ''; if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; } ?> @@ -283,7 +286,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field) - +
task->estimateAB}'") ?> task->hour;?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 73e09a8178..b1219baecd 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -27,6 +27,15 @@ team) < 6 ? 6 - count($task->team) : 1);?> task->error->teamMember);?> lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?> +error->notempty, $lang->task->estimate))?> +task->edit->requiredFields);?> +task->edit->requiredFields) as $field) +{ + if($field) $requiredFields[$field] = ''; +} +?>
@@ -275,7 +284,7 @@ account, "class='form-control chosen'")?>
- task->estimate?> + task->estimate?> estimate, "class='form-control text-center' placeholder='{$lang->task->hour}'")?> task->consumed?> consumed, "class='form-control text-center' readonly placeholder='{$lang->task->hour}'")?> @@ -294,7 +303,7 @@
- task->estimate?> + task->estimate?> task->hour}'")?> task->consumed?> task->hour}'")?> From a21626979e8ecc6e4904092d7612db9a5f5e053f Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 12 Jul 2022 14:25:58 +0800 Subject: [PATCH 0505/1178] * Fix bug #25081. --- module/execution/css/cfd.css | 2 +- module/execution/lang/de.php | 6 +++++- module/execution/lang/en.php | 6 +++++- module/execution/lang/fr.php | 5 ++++- module/execution/lang/zh-cn.php | 5 ++++- module/execution/view/cfd.html.php | 2 +- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/module/execution/css/cfd.css b/module/execution/css/cfd.css index 7c5a4495a6..8d2ea2ab32 100644 --- a/module/execution/css/cfd.css +++ b/module/execution/css/cfd.css @@ -1,6 +1,6 @@ .main-content > h2 {font-size: 16px;} #mainContent h2 .icon-help {font-size: 16px; vertical-align: text-bottom;} -.tooltip-inner {font-size: 13px; letter-spacing: 1px; line-height: 22px; max-width: 400px !important} +.tooltip-inner {font-size: 13px; letter-spacing: 1px; line-height: 22px; max-width: 400px !important; text-align: left;} .container {max-width: 1700px !important} .pull-left .input-control {margin-right: 10px;} diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index 1da9844e81..70ccf7c086 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -431,7 +431,11 @@ $lang->execution->charts->burn->graph->actuality = 'Aktualität'; $lang->execution->charts->burn->graph->delay = 'Delay'; $lang->execution->charts->cfd = new stdclass(); -$lang->execution->charts->cfd->cfdTip = "The Cumulative Flow Diagram(CFD)reflects the trend of accumulated workload at each stage over time. The horizontal axis of CFD represents the date, and the vertical axis represents the number of work items. Through this report, you can calculate the WIP quantity, delivery rate and average lead time to understand the team's delivery."; +$lang->execution->charts->cfd->cfdTip = "

+1. The CFD(Cumulative Flow Diagram)reflects the trend of accumulated workload at each stage over time.
+2. The horizontal axis represents the date, and the vertical axis represents the number of work items.
+3. To learn about the team's delivery, you can calculate the WIP quantity, delivery rate and average lead time through the CFD. +

"; $lang->execution->charts->cfd->cycleTime = 'Average cycle time'; $lang->execution->charts->cfd->cycleTimeTip = 'Average cycle time of each card from development start to completion'; $lang->execution->charts->cfd->throughput = 'Throughput Rate'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 34a9c0d180..b558ee70c8 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -431,7 +431,11 @@ $lang->execution->charts->burn->graph->actuality = 'Actual'; $lang->execution->charts->burn->graph->delay = 'Delay'; $lang->execution->charts->cfd = new stdclass(); -$lang->execution->charts->cfd->cfdTip = "The Cumulative Flow Diagram(CFD)reflects the trend of accumulated workload at each stage over time. The horizontal axis of CFD represents the date, and the vertical axis represents the number of work items. Through this report, you can calculate the WIP quantity, delivery rate and average lead time to understand the team's delivery."; +$lang->execution->charts->cfd->cfdTip = "

+1. The CFD(Cumulative Flow Diagram)reflects the trend of accumulated workload at each stage over time.
+2. The horizontal axis represents the date, and the vertical axis represents the number of work items.
+3. To learn about the team's delivery, you can calculate the WIP quantity, delivery rate and average lead time through the CFD. +

"; $lang->execution->charts->cfd->cycleTime = 'Average cycle time'; $lang->execution->charts->cfd->cycleTimeTip = 'Average cycle time of each card from development start to completion'; $lang->execution->charts->cfd->throughput = 'Throughput Rate'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 6f290d6703..1e5fe6bf27 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -434,7 +434,10 @@ $lang->execution->charts->burn->graph->actuality = 'Actuel'; $lang->execution->charts->burn->graph->delay = 'Delay'; $lang->execution->charts->cfd = new stdclass(); -$lang->execution->charts->cfd->cfdTip = "Le Cumulative Flow Diagram(CFD)indique la tendance de la charge de travail cumulée de chaque étape au fil du temps. L'axe horizontal du CFD représente la date et l'axe vertical représente le nombre d'éléments de travail. Ce rapport vous permet de calculer les quantités de travail en cours (WIP), les taux de livraison et les délais moyens pour comprendre comment votre équipe travaille." +$lang->execution->charts->cfd->cfdTip = "

+1. Le CFD(Cumulative Flow Diagram)indique la tendance de la charge de travail cumulée de chaque étape au fil du temps.
+2. L'axe horizontal représente la date et l'axe vertical représente le nombre de travaux.
+3. Ce CFD vous permet de calculer les quantités de travail en cours (WIP), les taux de livraison et les délais moyens pour comprendre comment votre équipe travaille.

"; $lang->execution->charts->cfd->cycleTime = 'Average cycle time'; $lang->execution->charts->cfd->cycleTimeTip = 'Average cycle time of each card from development start to completion'; $lang->execution->charts->cfd->throughput = 'Throughput Rate'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index a66cac03fc..b8ab7d649f 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -431,7 +431,10 @@ $lang->execution->charts->burn->graph->actuality = '实际'; $lang->execution->charts->burn->graph->delay = '延期'; $lang->execution->charts->cfd = new stdclass(); -$lang->execution->charts->cfd->cfdTip = '累积流图反应各个阶段累积处理的工作项数量随时间的变化趋势,该报表横轴代表日期,纵轴代表工作项数量,通过此图可计算出在制品数量,交付速率以及平均前置时间,从而了解团队的交付情况。'; +$lang->execution->charts->cfd->cfdTip = "

+1.累积流图反应各个阶段累积处理的工作项数量随时间的变化趋势。
+2.横轴代表日期,纵轴代表工作项数量。
+3.通过此图可计算出在制品数量,交付速率以及平均前置时间,从而了解团队的交付情况。

"; $lang->execution->charts->cfd->cycleTime = '平均周期时间'; $lang->execution->charts->cfd->cycleTimeTip = '平均每个卡片从开发启动到完成的周期时间'; $lang->execution->charts->cfd->throughput = '吞吐率'; diff --git a/module/execution/view/cfd.html.php b/module/execution/view/cfd.html.php index 699e7fe698..a5a2aa0661 100644 --- a/module/execution/view/cfd.html.php +++ b/module/execution/view/cfd.html.php @@ -48,7 +48,7 @@
-

execution->cfdTypeList, $type) . $lang->execution->CFD;?>

+

execution->cfdTypeList, $type) . $lang->execution->CFD;?>

From 0a5cf0a831b7f4c0fd13e45b4cac996b172e1d29 Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 12 Jul 2022 14:28:17 +0800 Subject: [PATCH 0506/1178] * Optimize code. --- module/execution/view/cfd.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/cfd.html.php b/module/execution/view/cfd.html.php index a5a2aa0661..4dd3a126c1 100644 --- a/module/execution/view/cfd.html.php +++ b/module/execution/view/cfd.html.php @@ -48,7 +48,7 @@
-

execution->cfdTypeList, $type) . $lang->execution->CFD;?>

+

execution->cfdTypeList, $type) . $lang->execution->CFD;?>

From 6cef93edd9534e07d1ffae2f83be2a79cafe5555 Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Tue, 12 Jul 2022 06:30:13 +0000 Subject: [PATCH 0507/1178] * Finish task #60453. --- module/action/lang/de.php | 1 + module/action/lang/en.php | 1 + module/action/lang/fr.php | 1 + module/action/lang/vi.php | 1 + module/action/lang/zh-cn.php | 1 + module/action/lang/zh-tw.php | 1 + module/action/model.php | 4 +- module/gitea/control.php | 32 +++++ module/gitea/lang/de.php | 7 ++ module/gitea/lang/en.php | 7 ++ module/gitea/lang/fr.php | 7 ++ module/gitea/lang/vi.php | 7 ++ module/gitea/lang/zh-cn.php | 7 ++ module/gitea/lang/zh-tw.php | 7 ++ module/gitea/model.php | 184 ++++++++++++++++++++++++++++- module/gitea/view/browse.html.php | 2 + module/gitlab/control.php | 20 ++-- module/gitlab/view/browse.html.php | 4 +- module/group/lang/resource.php | 12 +- 19 files changed, 282 insertions(+), 24 deletions(-) diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 988570d7ce..3e6cb30e3f 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -133,6 +133,7 @@ $lang->action->objectTypes['gitlabbranch'] = 'GitLab Branch'; $lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab Protected Branches'; $lang->action->objectTypes['gitlabtag'] = 'GitLab Tag'; $lang->action->objectTypes['gitlabtagpriv'] = 'GitLab Tag Protected'; +$lang->action->objectTypes['giteauser'] = 'Gitea User'; $lang->action->objectTypes['kanbanspace'] = 'Kanban Space'; $lang->action->objectTypes['kanban'] = 'Kanban'; $lang->action->objectTypes['kanbanregion'] = 'Kanban Region'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index e195c73ad7..2ca3bbdd58 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -133,6 +133,7 @@ $lang->action->objectTypes['gitlabbranch'] = 'GitLab Branch'; $lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab Protected Branches'; $lang->action->objectTypes['gitlabtag'] = 'GitLab Tag'; $lang->action->objectTypes['gitlabtagpriv'] = 'GitLab Tag Protected'; +$lang->action->objectTypes['giteauser'] = 'Gitea User'; $lang->action->objectTypes['kanbanspace'] = 'Kanban Space'; $lang->action->objectTypes['kanban'] = 'Kanban'; $lang->action->objectTypes['kanbanregion'] = 'Kanban Region'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index fb1c45ebc5..75212cf95b 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -133,6 +133,7 @@ $lang->action->objectTypes['gitlabbranch'] = 'GitLab Branch'; $lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab Protected Branches'; $lang->action->objectTypes['gitlabtag'] = 'GitLab Tag'; $lang->action->objectTypes['gitlabtagpriv'] = 'GitLab Tag Protected'; +$lang->action->objectTypes['giteauser'] = 'Gitea User'; $lang->action->objectTypes['kanbanspace'] = 'Kanban Space'; $lang->action->objectTypes['kanban'] = 'Kanban'; $lang->action->objectTypes['kanbanregion'] = 'Kanban Region'; diff --git a/module/action/lang/vi.php b/module/action/lang/vi.php index 681dc1b71f..7e7aa0909a 100644 --- a/module/action/lang/vi.php +++ b/module/action/lang/vi.php @@ -111,6 +111,7 @@ $lang->action->objectTypes['gitlabbranch'] = 'GitLab Branch'; $lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab Protected Branches'; $lang->action->objectTypes['gitlabtag'] = 'GitLab Tag'; $lang->action->objectTypes['gitlabtagpriv'] = 'GitLab Tag Protected'; +$lang->action->objectTypes['giteauser'] = 'Gitea User'; $lang->action->objectTypes['kanbanspace'] = 'Kanban Space'; $lang->action->objectTypes['kanban'] = 'Kanban'; $lang->action->objectTypes['kanbanregion'] = 'Kanban Region'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 4b332524af..84a25b2372 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -133,6 +133,7 @@ $lang->action->objectTypes['gitlabbranch'] = 'GitLab分支'; $lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab保护分支'; $lang->action->objectTypes['gitlabtag'] = 'GitLab标签'; $lang->action->objectTypes['gitlabtagpriv'] = 'GitLab标签保护'; +$lang->action->objectTypes['giteauser'] = 'Gitea用户'; $lang->action->objectTypes['kanbanspace'] = '看板空间'; $lang->action->objectTypes['kanban'] = '看板'; $lang->action->objectTypes['kanbanregion'] = '看板区域'; diff --git a/module/action/lang/zh-tw.php b/module/action/lang/zh-tw.php index 9a66017d80..04ebfaedf6 100755 --- a/module/action/lang/zh-tw.php +++ b/module/action/lang/zh-tw.php @@ -127,6 +127,7 @@ $lang->action->objectTypes['gitlabgroup'] = 'GitLab群組'; $lang->action->objectTypes['gitlabbranch'] = 'GitLab分支'; $lang->action->objectTypes['gitlabbranchpriv'] = 'GitLab保護分支'; $lang->action->objectTypes['gitlabtag'] = 'GitLab標籤'; +$lang->action->objectTypes['giteauser'] = 'Gitea用戶'; $lang->action->objectTypes['kanbanspace'] = '看板空間'; $lang->action->objectTypes['kanban'] = '看板'; $lang->action->objectTypes['kanbanregion'] = '看板區域'; diff --git a/module/action/model.php b/module/action/model.php index ca7525cfd4..9512d4cbd8 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1254,8 +1254,8 @@ class actionModel extends model /* If action type is login or logout, needn't link. */ if($actionType == 'svncommited' or $actionType == 'gitcommited') $action->actor = zget($commiters, $action->actor); - /* Get gitlab objectname. */ - if(empty($action->objectName) and substr($objectType, 0, 6) == 'gitlab') $action->objectName = $action->extra; + /* Get gitlab or gitea objectname. */ + if(empty($action->objectName) and (substr($objectType, 0, 6) == 'gitlab' or substr($objectType, 0, 5) == 'gitea')) $action->objectName = $action->extra; /* Other actions, create a link. */ if(!$this->setObjectLink($action, $deptUsers)) diff --git a/module/gitea/control.php b/module/gitea/control.php index 413f2c2e52..2c6cc08a2a 100644 --- a/module/gitea/control.php +++ b/module/gitea/control.php @@ -43,6 +43,11 @@ class gitea extends control /* Admin user don't need bind. */ $giteaList = $this->gitea->getList($orderBy, $pager); + foreach($giteaList as $gitea) + { + $gitea->isBindUser = true; + if(!$this->app->user->admin and !isset($myGiteas[$gitea->id])) $gitea->isBindUser = false; + } $this->view->title = $this->lang->gitea->common . $this->lang->colon . $this->lang->gitea->browse; $this->view->giteaList = $giteaList; @@ -164,4 +169,31 @@ class gitea extends control return true; } + + /** + * Bind gitea user to zentao users. + * + * @param int $giteaID + * @access public + * @return void + */ + public function bindUser($giteaID) + { + $zentaoUsers = $this->dao->select('account,email,realname')->from(TABLE_USER)->fetchAll('account'); + $userPairs = $this->loadModel('user')->getPairs('noclosed|noletter'); + + if($_POST) + { + $this->gitea->bindUser($giteaID); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer)); + } + + $this->view->title = $this->lang->gitea->bindUser; + $this->view->userPairs = $userPairs; + $this->view->giteaUsers = $this->gitea->apiGetUsers($giteaID); + $this->view->bindedUsers = $this->gitea->getUserAccountIdPairs($giteaID); + $this->view->matchedResult = $this->gitea->getMatchedUsers($giteaID, $this->view->giteaUsers, $zentaoUsers); + $this->display(); + } } diff --git a/module/gitea/lang/de.php b/module/gitea/lang/de.php index 5d0779ba55..b4716e7bed 100644 --- a/module/gitea/lang/de.php +++ b/module/gitea/lang/de.php @@ -8,6 +8,13 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; diff --git a/module/gitea/lang/en.php b/module/gitea/lang/en.php index 5d0779ba55..b4716e7bed 100644 --- a/module/gitea/lang/en.php +++ b/module/gitea/lang/en.php @@ -8,6 +8,13 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; diff --git a/module/gitea/lang/fr.php b/module/gitea/lang/fr.php index 5d0779ba55..b4716e7bed 100644 --- a/module/gitea/lang/fr.php +++ b/module/gitea/lang/fr.php @@ -8,6 +8,13 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; diff --git a/module/gitea/lang/vi.php b/module/gitea/lang/vi.php index 5d0779ba55..b4716e7bed 100644 --- a/module/gitea/lang/vi.php +++ b/module/gitea/lang/vi.php @@ -8,6 +8,13 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; diff --git a/module/gitea/lang/zh-cn.php b/module/gitea/lang/zh-cn.php index dd8da67d29..7e273df350 100644 --- a/module/gitea/lang/zh-cn.php +++ b/module/gitea/lang/zh-cn.php @@ -8,6 +8,13 @@ $lang->gitea->edit = '编辑Gitea'; $lang->gitea->view = '查看Gitea'; $lang->gitea->delete = '删除Gitea'; $lang->gitea->confirmDelete = '确认删除该Gitea吗?'; +$lang->gitea->bindUser = '绑定用户'; +$lang->gitea->giteaAccount = 'Gitea用户'; +$lang->gitea->zentaoAccount = '禅道用户'; +$lang->gitea->bindingStatus = '绑定状态'; +$lang->gitea->notBind = '未绑定'; +$lang->gitea->binded = '已绑定'; +$lang->gitea->bindDynamic = '%s与禅道用户%s'; $lang->gitea->browseAction = 'Gitea列表'; $lang->gitea->deleteAction = '删除Gitea'; diff --git a/module/gitea/lang/zh-tw.php b/module/gitea/lang/zh-tw.php index dd8da67d29..7e273df350 100644 --- a/module/gitea/lang/zh-tw.php +++ b/module/gitea/lang/zh-tw.php @@ -8,6 +8,13 @@ $lang->gitea->edit = '编辑Gitea'; $lang->gitea->view = '查看Gitea'; $lang->gitea->delete = '删除Gitea'; $lang->gitea->confirmDelete = '确认删除该Gitea吗?'; +$lang->gitea->bindUser = '绑定用户'; +$lang->gitea->giteaAccount = 'Gitea用户'; +$lang->gitea->zentaoAccount = '禅道用户'; +$lang->gitea->bindingStatus = '绑定状态'; +$lang->gitea->notBind = '未绑定'; +$lang->gitea->binded = '已绑定'; +$lang->gitea->bindDynamic = '%s与禅道用户%s'; $lang->gitea->browseAction = 'Gitea列表'; $lang->gitea->deleteAction = '删除Gitea'; diff --git a/module/gitea/model.php b/module/gitea/model.php index f1fabf2ffe..6a9ad9ef99 100644 --- a/module/gitea/model.php +++ b/module/gitea/model.php @@ -104,6 +104,62 @@ class giteaModel extends model return $this->loadModel('pipeline')->update($id); } + /** + * Bind users. + * + * @param int $giteaID + * @access public + * @return array + */ + public function bindUser($giteaID) + { + $users = $this->post->zentaoUsers; + $giteaNames = $this->post->giteaUserNames; + $accountList = array(); + $repeatUsers = array(); + foreach($users as $openID => $user) + { + if(empty($user)) continue; + if(isset($accountList[$user])) $repeatUsers[] = zget($userPairs, $user); + $accountList[$user] = $openID; + } + + if(count($repeatUsers)) + { + dao::$errors[] = sprintf($this->lang->gitea->bindUserError, join(',', $repeatUsers)); + return false; + } + + $user = new stdclass; + $user->providerID = $giteaID; + $user->providerType = 'gitea'; + + $oldUsers = $this->dao->select('*')->from(TABLE_OAUTH)->where('providerType')->eq($user->providerType)->andWhere('providerID')->eq($user->providerID)->fetchAll('openID'); + foreach($users as $openID => $account) + { + $existAccount = isset($oldUsers[$openID]) ? $oldUsers[$openID] : ''; + + if($existAccount and $existAccount->account != $account) + { + $this->dao->delete() + ->from(TABLE_OAUTH) + ->where('openID')->eq($openID) + ->andWhere('providerType')->eq($user->providerType) + ->andWhere('providerID')->eq($user->providerID) + ->exec(); + $this->loadModel('action')->create('giteauser', $openID, 'unbind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$existAccount->account]->realname)); + } + if(!$existAccount or $existAccount->account != $account) + { + if(!$account) continue; + $user->account = $account; + $user->openID = $openID; + $this->dao->insert(TABLE_OAUTH)->data($user)->exec(); + $this->loadModel('action')->create('giteauser', $openID, 'bind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$account]->realname)); + } + } + } + /** * Api error handling. * @@ -225,6 +281,70 @@ class giteaModel extends model ->fetchPairs('providerID'); } + /** + * Get zentao account gitea user id pairs of one gitea. + * + * @param int $giteaID + * @access public + * @return array + */ + public function getUserAccountIdPairs($giteaID, $fields = 'account,openID') + { + return $this->dao->select($fields)->from(TABLE_OAUTH) + ->where('providerType')->eq('gitea') + ->andWhere('providerID')->eq($giteaID) + ->fetchPairs(); + } + + /** + * Get matched gitea users. + * + * @param int $giteaID + * @param array $giteaUsers + * @param array $zentaoUsers + * @access public + * @return array + */ + public function getMatchedUsers($giteaID, $giteaUsers, $zentaoUsers) + { + $matches = new stdclass; + foreach($giteaUsers as $giteaUser) + { + foreach($zentaoUsers as $zentaoUser) + { + if($giteaUser->account == $zentaoUser->account) $matches->accounts[$giteaUser->account][] = $zentaoUser->account; + if($giteaUser->realname == $zentaoUser->realname) $matches->names[$giteaUser->realname][] = $zentaoUser->account; + if($giteaUser->email == $zentaoUser->email) $matches->emails[$giteaUser->email][] = $zentaoUser->account; + } + } + + $bindedUsers = $this->getUserAccountIdPairs($giteaID, 'openID,account'); + $matchedUsers = array(); + foreach($giteaUsers as $giteaUser) + { + if(isset($bindedUsers[$giteaUser->id])) + { + $giteaUser->zentaoAccount = $bindedUsers[$giteaUser->id]; + $matchedUsers[] = $giteaUser; + continue; + } + + $matchedZentaoUsers = array(); + if(isset($matches->accounts[$giteaUser->account])) $matchedZentaoUsers = array_merge($matchedZentaoUsers, $matches->accounts[$giteaUser->account]); + if(isset($matches->emails[$giteaUser->email])) $matchedZentaoUsers = array_merge($matchedZentaoUsers, $matches->emails[$giteaUser->email]); + if(isset($matches->names[$giteaUser->realname])) $matchedZentaoUsers = array_merge($matchedZentaoUsers, $matches->names[$giteaUser->realname]); + + $matchedZentaoUsers = array_unique($matchedZentaoUsers); + if(count($matchedZentaoUsers) == 1) + { + $giteaUser->zentaoAccount = current($matchedZentaoUsers); + $matchedUsers[] = $giteaUser; + } + } + + return $matchedUsers; + } + /** * Get project by api. * @@ -250,14 +370,70 @@ class giteaModel extends model * @access public * @return array */ - public function apiGetProjects($giteaID, $sudo = 'true') + public function apiGetProjects($giteaID, $sudo = true) { $apiRoot = $this->getApiRoot($giteaID, $sudo); if(!$apiRoot) return array(); - $url = sprintf($apiRoot, "/repos/search"); - $results = json_decode(commonModel::http($url)); + $url = sprintf($apiRoot, "/repos/search"); + $allResults = array(); + for($page = 1; true; $page++) + { + $results = json_decode(commonModel::http($url . "&page={$page}&limit=50")); + if(!is_array($results->data)) break; + if(!empty($results->data)) $allResults = array_merge($allResults, $results->data); + if(count($results->data) < 50) break; + } - return $results->data; + return $allResults; + } + + /** + * Get gitea user list. + * + * @param int $giteaID + * @param bool $onlyLinked + * @access public + * @return array + */ + public function apiGetUsers($giteaID, $onlyLinked = false) + { + $response = array(); + $apiRoot = $this->getApiRoot($giteaID); + + for($page = 1; true; $page++) + { + $url = sprintf($apiRoot, "/users/search") . "&page={$page}&limit=50"; + $result = json_decode(commonModel::http($url)); + if(empty($result->data)) break; + + $response = array_merge($response, $result->data); + $page += 1; + } + + if(empty($response)) return array(); + + /* Get linked users. */ + $linkedUsers = array(); + if($onlyLinked) $linkedUsers = $this->getUserAccountIdPairs($giteaID, 'openID,account'); + + $users = array(); + foreach($response as $giteaUser) + { + if($onlyLinked and !isset($linkedUsers[$giteaUser->id])) continue; + + $user = new stdclass; + $user->id = $giteaUser->id; + $user->realname = $giteaUser->full_name ? $giteaUser->full_name : $giteaUser->username; + $user->account = $giteaUser->username; + $user->email = zget($giteaUser, 'email', ''); + $user->avatar = $giteaUser->avatar_url; + $user->createdAt = zget($giteaUser, 'created', ''); + $user->lastActivityOn = zget($giteaUser, 'last_login', ''); + + $users[] = $user; + } + + return $users; } } diff --git a/module/gitea/view/browse.html.php b/module/gitea/view/browse.html.php index d8a23425ac..b92dd8cab0 100644 --- a/module/gitea/view/browse.html.php +++ b/module/gitea/view/browse.html.php @@ -55,7 +55,9 @@ url, $gitea->url, '_target');?> isBindUser ? true : false; common::printIcon('gitea', 'edit', "giteaID=$id", '', 'list', 'edit'); + echo common::buildIconButton('gitea', 'bindUser', "giteaID=$id", '', 'list', 'link', '', '', false, '', '', 0, $disabled); common::printIcon('gitea', 'delete', "giteaID=$id", '', 'list', 'trash', 'hiddenwin'); ?> diff --git a/module/gitlab/control.php b/module/gitlab/control.php index 5c8074064a..42e19702c6 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -47,9 +47,7 @@ class gitlab extends control foreach($gitlabList as $gitlab) { - $token = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token); - $gitlab->isAdminToken = (isset($token->is_admin) and $token->is_admin); - $gitlab->isBindUser = true; + $gitlab->isBindUser = true; if(!$this->app->user->admin and !isset($myGitLabs[$gitlab->id])) $gitlab->isBindUser = false; } @@ -1346,7 +1344,7 @@ class gitlab extends control { $repo = $this->loadModel('repo')->getRepoByID($repoID); $productIDList = explode(',', $repo->product); - $gitlabID = $repo->gitlab; + $gitlabID = $repo->gitService; $projectID = $repo->project; $gitlab = $this->gitlab->getByID($gitlabID); @@ -1491,7 +1489,7 @@ class gitlab extends control $bindedUsers = $this->dao->select('account,openID') ->from(TABLE_OAUTH) ->where('providerType')->eq('gitlab') - ->andWhere('providerID')->eq($repo->gitlab) + ->andWhere('providerID')->eq($repo->gitService) ->fetchPairs(); if(empty($repo->acl)) @@ -1511,7 +1509,7 @@ class gitlab extends control } } - $gitlabCurrentMembers = $this->gitlab->apiGetProjectMembers($repo->gitlab, $repo->project); + $gitlabCurrentMembers = $this->gitlab->apiGetProjectMembers($repo->gitService, $repo->project); $addedMembers = $updatedMembers = $deletedMembers = array(); /* Get the updated data. */ @@ -1570,17 +1568,17 @@ class gitlab extends control foreach($addedMembers as $addedMember) { - $this->gitlab->apiCreateProjectMember($repo->gitlab, $repo->project, $addedMember); + $this->gitlab->apiCreateProjectMember($repo->gitService, $repo->project, $addedMember); } foreach($updatedMembers as $updatedMember) { - $this->gitlab->apiUpdateProjectMember($repo->gitlab, $repo->project, $updatedMember); + $this->gitlab->apiUpdateProjectMember($repo->gitService, $repo->project, $updatedMember); } foreach($deletedMembers as $deletedMemberID) { - $this->gitlab->apiDeleteProjectMember($repo->gitlab, $repo->project, $deletedMemberID); + $this->gitlab->apiDeleteProjectMember($repo->gitService, $repo->project, $deletedMemberID); } $repo->acl->users = array_values($accounts); @@ -1590,7 +1588,7 @@ class gitlab extends control $repo = $this->loadModel('repo')->getRepoByID($repoID); $users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted|noclosed'); - $projectMembers = $this->gitlab->apiGetProjectMembers($repo->gitlab, $repo->project); + $projectMembers = $this->gitlab->apiGetProjectMembers($repo->gitService, $repo->project); if(!is_array($projectMembers)) $projectMembers = array(); /* Get users accesslevel. */ @@ -1598,7 +1596,7 @@ class gitlab extends control $bindedUsers = $this->dao->select('openID,account') ->from(TABLE_OAUTH) ->where('providerType')->eq('gitlab') - ->andWhere('providerID')->eq($repo->gitlab) + ->andWhere('providerID')->eq($repo->gitService) ->fetchPairs(); foreach($projectMembers as $projectMember) diff --git a/module/gitlab/view/browse.html.php b/module/gitlab/view/browse.html.php index af931fd6d9..a83c6de4bf 100644 --- a/module/gitlab/view/browse.html.php +++ b/module/gitlab/view/browse.html.php @@ -43,7 +43,7 @@ $gitlab): ?> - + @@ -55,7 +55,7 @@ url, $gitlab->url, '_target');?> isAdminToken) or !$gitlab->isBindUser) ? false : true; + $disabled = $gitlab->isBindUser ? true : false; common::printIcon('gitlab', 'edit', "gitlabID=$id", '', 'list', 'edit'); echo common::buildIconButton('gitlab', 'bindUser', "gitlabID=$id", '', 'list', 'link', '', '', false, '', '', 0, $disabled); common::printIcon('gitlab', 'delete', "gitlabID=$id", '', 'list', 'trash', 'hiddenwin'); diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 9893779893..1e12f7a30b 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1387,17 +1387,19 @@ $lang->gitlab->methodOrder[145] = 'deleteTagPriv'; /* Gitea. */ $lang->resource->gitea = new stdclass(); -$lang->resource->gitea->browse = 'browse'; -$lang->resource->gitea->create = 'create'; -$lang->resource->gitea->edit = 'edit'; -$lang->resource->gitea->view = 'view'; -$lang->resource->gitea->delete = 'delete'; +$lang->resource->gitea->browse = 'browse'; +$lang->resource->gitea->create = 'create'; +$lang->resource->gitea->edit = 'edit'; +$lang->resource->gitea->view = 'view'; +$lang->resource->gitea->delete = 'delete'; +$lang->resource->gitea->bindUser = 'bindUser'; $lang->gitea->methodOrder[5] = 'browse'; $lang->gitea->methodOrder[10] = 'create'; $lang->gitea->methodOrder[15] = 'edit'; $lang->gitea->methodOrder[20] = 'view'; $lang->gitea->methodOrder[25] = 'delete'; +$lang->gitea->methodOrder[30] = 'bindUser'; /* SonarQube. */ $lang->resource->sonarqube = new stdclass(); From ba36ed56b55fbdeea584e2f2da1d1fa4cd7df2ce Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 12 Jul 2022 14:42:55 +0800 Subject: [PATCH 0508/1178] * Fix bug #60491. --- module/project/model.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 03147d7e1a..26a0ae905a 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1544,15 +1544,13 @@ class projectModel extends model /* Child project begin cannot less than parent. */ if(!empty($projects[$projectID]->name) and $projects[$projectID]->begin < $parentProject->begin) { - dao::$errors['begin'] = sprintf($this->lang->project->beginGreateChild, $parentProject->begin); - return false; + dao::$errors[] = "ID {$projects[$projectID]->id}" . sprintf($this->lang->project->beginGreateChild, $parentProject->begin); } /* When parent set end then child project end cannot greater than parent. */ if(!empty($projects[$projectID]->name) and $parentProject->end != '0000-00-00' and $projects[$projectID]->end > $parentProject->end) { - dao::$errors['end'] = sprintf($this->lang->project->endLetterChild, $parentProject->end); - return false; + dao::$errors[] = "ID {$projects[$projectID]->id}" . sprintf($this->lang->project->endLetterChild, $parentProject->end); } } } From f44d5659df1a63b96b0558c0794d814ef4afbd1e Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 12 Jul 2022 15:00:11 +0800 Subject: [PATCH 0509/1178] * Fix bug #24404. --- module/task/js/create.js | 2 +- module/task/view/create.html.php | 3 ++- module/tree/control.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/task/js/create.js b/module/task/js/create.js index d5a95fd922..c7bc577535 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -274,7 +274,7 @@ function setLane(regionID) } /* Get select of stories.*/ -function setStories(moduleID, executionID) +function setStories(moduleID) { link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=all&moduleID=' + moduleID + '&storyID=0&number=&type=full&status=unclosed'); $.get(link, function(stories) diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index e048a3b4c1..97adb5801a 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -13,6 +13,7 @@ +id);?> id));?> task->error->teamMember);?> @@ -56,7 +57,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field) task->module;?> - module, "class='form-control chosen' onchange='setStories(this.value, $execution->id)'");?> + module, "class='form-control chosen' onchange='setStories(this.value)'");?>
> diff --git a/module/tree/control.php b/module/tree/control.php index bad64ebd6e..148073abad 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -517,6 +517,7 @@ class tree extends control { $changeFunc = ''; if($viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'"; + if($viewType == 'task') $changeFunc = "onchange='setStories(this.value)'"; $field = $fieldID ? "modules[$fieldID]" : 'module'; $currentModule = $this->tree->getById($currentModuleID); From 6a84cd7469e8fb43330f157b395c9dc0168740e7 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 12 Jul 2022 07:15:13 +0000 Subject: [PATCH 0510/1178] * Code for task#60640 --- module/execution/control.php | 1 + module/execution/js/cfd.js | 2 +- module/execution/model.php | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 253c136057..82d5967aeb 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1389,6 +1389,7 @@ class execution extends control if(date("Y-m-d", strtotime("-3 months", strtotime($end))) > $begin) return $this->sendError($this->lang->execution->charts->cfd->errorDateRange); $this->execution->computeCFD($executionID); + $this->execution->checkCFDData($executionID, $begin); return print(js::locate($this->createLink('execution', 'cfd', "executionID=$executionID&type=$type&withWeekend=$withWeekend&begin=" . helper::safe64Encode(urlencode($begin)) . "&end=" . helper::safe64Encode(urlencode($end))), 'parent')); } diff --git a/module/execution/js/cfd.js b/module/execution/js/cfd.js index 6e660db934..a15f5c8b2a 100644 --- a/module/execution/js/cfd.js +++ b/module/execution/js/cfd.js @@ -138,5 +138,5 @@ $(function() }); $("#end, #begin").datetimepicker('setEndDate', today) - $('.datetimepicker-days table tfoot tr th').html(dateRangeTip).removeClass('today'); + $('.datetimepicker-days table tfoot').append('' + dateRangeTip + ''); }); diff --git a/module/execution/model.php b/module/execution/model.php index 6d8dff648e..c628c87878 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3072,6 +3072,42 @@ class executionModel extends model } } + /** + * Check whether there is data on the specified date of execution, and there is no data with the latest date added. + * + * @param int $executionID + * @param string $date + * @access public + * @return void + */ + public function checkCFDData($executionID, $date) + { + $today = helper::today(); + if($date >= $today) return; + + $checkData = $this->dao->select("date, `count` AS value, `name`")->from(TABLE_CFD) + ->where('execution')->eq((int)$executionID) + ->andWhere('date')->eq($date) + ->orderBy('date DESC, id asc')->fetchGroup('name', 'date'); + if(!$checkData) + { + $closetoDate = $this->dao->select("max(date) as date")->from(TABLE_CFD)->where('execution')->eq((int)$executionID)->andWhere('date')->lt($date)->fetch('date'); + if($closetoDate) + { + $copyData = $this->dao->select("*")->from(TABLE_CFD) + ->where('execution')->eq((int)$executionID) + ->andWhere('date')->eq($closetoDate) + ->fetchAll(); + foreach($copyData as $data) + { + unset($data->id); + $data->date = $date; + $this->dao->replace(TABLE_CFD)->data($data)->exec(); + } + } + } + } + /** * Fix burn for first day. * From 09eabd3b8444920d4e9bb7298ef3a2b113ad8885 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 12 Jul 2022 07:15:27 +0000 Subject: [PATCH 0511/1178] * Finish task #60393. --- module/execution/control.php | 1 - module/productplan/control.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 816618e072..26df26b251 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3686,7 +3686,6 @@ class execution extends control $parents = array(); if($parentIdList) $parents = $this->execution->getByIdList($parentIdList); - $allExecutionsNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_PROJECT) ->where('project')->eq($projectID) ->andWhere('deleted')->eq(0) diff --git a/module/productplan/control.php b/module/productplan/control.php index 66ae055a2a..4327d7b130 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -350,6 +350,7 @@ class productplan extends control $this->view->branchID = $branchID; $this->view->kanbanData = $this->loadModel('kanban')->getPlanKanban($product, $branchID, $planGroup); } + $productPlansNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_PRODUCTPLAN) ->where('product')->eq($productID) ->andWhere('deleted')->eq(0) From 49ae55568d1a507a8fb4d30a8eee5354e61b1d9e Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 12 Jul 2022 07:18:43 +0000 Subject: [PATCH 0512/1178] * Fix bug about kanban's task actions. --- module/task/control.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/task/control.php b/module/task/control.php index 676bdea286..5733aa0bf8 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -744,6 +744,7 @@ class task extends control * @param int $requestID * @param int $taskID * @param string $kanbanGroup + * @param string $from * @access public * @return void */ @@ -1073,6 +1074,7 @@ class task extends control * Record consumed and estimate. * * @param int $taskID + * @param string $from * @access public * @return void */ @@ -1384,6 +1386,7 @@ class task extends control * Restart task * * @param int $taskID + * @param string $from * @access public * @return void */ From 24aab3914599bf0835db5484f195646e24c8f909 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Tue, 12 Jul 2022 07:24:15 +0000 Subject: [PATCH 0513/1178] * Code for bug #23827 --- www/js/zui/min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/js/zui/min.js b/www/js/zui/min.js index c507213e12..a1dc5ba902 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,5 +1,5 @@ /*! - * ZUI: ZUI for Zentao - v1.10.0 - 2022-07-11 + * ZUI: ZUI for Zentao - v1.10.0 - 2022-07-12 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2022 cnezsoft.com; Licensed MIT @@ -76,5 +76,5 @@ function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"= */ function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,c=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t,e,i){"use strict";var n="zui.picker",o={},a={lang:null,remote:null,remoteConverter:null,remoteOnly:!1,onRemoteError:null,disableEmptySearch:!1,textKey:"text",valueKey:"value",keysKey:"keys",multi:"auto",formItem:"auto",list:null,allowSingleDeselect:null,autoSelectFirst:!1,maxSelectedCount:0,maxListCount:100,hideEmptyTextOption:!0,searchValueKey:!0,emptyResultHint:null,hideOnScroll:!0,inheritFormItemClasses:!1,emptySearchResultHint:null,accurateSearchHint:null,remoteErrorHint:null,deleteByBackspace:!0,disableScrollOnShow:!0,maxDropHeight:250,dropDirection:"auto",dropWidth:"100%",maxAutoDropWidth:450,minAutoDropWidth:100,multiValueSplitter:",",multiSelectActions:5,searchDelay:200,autoClearDrop:6e4,fixLabelFor:!0,hotkey:!0,onSelect:null,onDeselect:null,onBeforeChange:null,onChange:null,onReady:null,onNoResults:null,onShowingDrop:null,onHidingDrop:null,onShowedDrop:null,onHiddenDrop:null,valueMustInList:!0},s={zh_cn:{emptyResultHint:"没有可选项",emptySearchResultHint:"没有找到 “{0}”",accurateSearchHint:"请提供更多关键词缩小匹配范围",remoteErrorHint:"无法从服务器获取结果 - {0}",selectAll:"全选",deselectAll:"取消选择"},zh_tw:{emptyResultHint:"沒有可選項",emptySearchResultHint:"沒有找到 “{0}”",accurateSearchHint:"請提供更多關鍵詞縮小匹配範圍",remoteErrorHint:"無法從服務器獲取結果 - {0}",selectAll:"全選",deselectAll:"取消選擇"},en:{emptyResultHint:"No options",emptySearchResultHint:'Cannot found "{0}"',accurateSearchHint:"Suggest to provide more keywords",remoteErrorHint:"Unable to get result from server: {0}",selectAll:"Select all",deselectAll:"Deselect all"}},r=function(o,a){var l=this;l.name=n,l.$=t(o),l.id="pk_"+(l.$.attr("id")||t.zui.uuid()),a=l.options=t.extend({},r.DEFAULTS,this.$.data(),a),void 0!==a.hideOnWindowScroll&&(a.hideOnScroll=a.hideOnWindowScroll);var c=t.zui.clientLang?t.zui.clientLang():"en",h=a.lang||c;l.lang=t.zui.getLangData?t.zui.getLangData(n,h,s):s[h]||s[c];var d,u,p=a.formItem,f='.form-item,input[type="hidden"],select,input[type="text"]';if(d="self"===p?l.$:"auto"!==p&&p?l.$.find(p):l.$.is(f)?l.$:l.$.find(f).first(),!d.length)return console.error&&console.error("Cannot found form item for picker.");if(d.is('input[type="hidden"]'))u="hidden";else if(d.is("select"))u="select";else{if(!d.is('input[type="text"]'))return console.error&&console.error("Unknown form type for picker.");u="text"}a.inheritFormItemClasses&&v.addClass(d.attr("class")),l.formType=u,l.$formItem=d.removeClass("picker").hide(),l.selfFormItem=d.is(l.$);var g=a.multi;g&&"auto"!==g||(g="select"===u&&"multiple"===d.attr("multiple")),g=!!g,l.multi=g,g||(l.options.checkable=!1);var m=a.list;m?l.setList("function"==typeof m?m({search:l.search,limit:a.maxListCount}):m,!0):"select"===u?l.updateFromSelect():l.setList([],!0);var v;v=!l.selfFormItem&&l.$.hasClass("picker")?l.$:t('
').insertAfter(l.$),v.addClass("picker").toggleClass("picker-multi",g).toggleClass("picker-single",!g);var y=v.children(".picker-selections");y.length?y.empty():y=t('
');var b=l.id+"-search",w=t('').appendTo(y);if(!g){var x=t('
');a.allowSingleDeselect&&x.append(''),x.appendTo(y),l.$singleSelection=x}v.toggleClass("picker-input-empty",!w.val().length).append(y),l.$container=v,l.$selections=y,l.$search=w,l.search="";var C=a.placeholder;if(void 0===C&&(C=d.attr("placeholder")),"string"==typeof C&&C.length&&y.append(t('
').text(C)),a.placeholder=C,a.fixLabelFor){var _=d.attr("id");_&&t('label[for="'+_+'"]').attr("for",b)}var k=void 0!==a.defaultValue?a.defaultValue:d.val();if(null===k&&(k=""),l.setValue(k,!0),l.setDisabled(),w.on("focus",function(){l.disabled||(l._blurTimer&&(clearTimeout(l._blurTimer),l._blurTimer=0),v.addClass("picker-focus"),l.showDropList())}).on("blur",function(){l.disabled||(l._blurTimer&&clearTimeout(l._blurTimer),l._blurTimer=setTimeout(function(){l._blurTimer=0,w.is(":focus")||v.removeClass("picker-focus")},100))}).on("input change",function(){if(!l.disabled){var t=w.val();g&&w.width(14*t.length),v.toggleClass("picker-input-empty",!t.length),l.tryUpdateList(t)}}),a.hotkey&&w.on("keydown",function(t){if(!l.disabled){var e=t.key||t.which;if(l.dropListShowed){var i=l.activeValue,n="string"==typeof i;if("Enter"===e||13===e)n&&(l.select(i,g),g?(l.$search.val(""),l.tryUpdateList("")):w.blur(),t.preventDefault(),t.stopPropagation());else if("ArrowDown"===e||40===e){var o,s=l.$activeOption;if(s&&(o=s.next(".picker-option"),g))for(;o.length&&o.hasClass("picker-option-selected");)o=o.next(".picker-option");o&&o.length||(o=l.$optionsList.children(g?".picker-option:not(.picker-option-selected)":".picker-option").first()),o.length&&l.activeOption(o),t.preventDefault(),t.stopPropagation()}else if("ArrowUp"===e||30===e){var r,s=l.$activeOption;if(s&&(r=s.prev(".picker-option"),g))for(;r.length&&r.hasClass("picker-option-selected");)r=r.prev(".picker-option");r&&r.length||(r=l.$optionsList.children(g?".picker-option:not(.picker-option-selected)":".picker-option").last()),r.length&&l.activeOption(r),t.preventDefault(),t.stopPropagation()}else"Escape"===e||27===e?l.hideDropList(!0):a.deleteByBackspace&&g&&("Backspace"===e||8===e)&&l.value&&l.value.length&&!w.val().length&&l.deselect(l.value[l.value.length-1])}}}),g){y.on("mousedown",function(t){if(!l.disabled)return l.dropListShowed&&!a.checkable?(t.preventDefault(),void t.stopPropagation()):void 0}).on("mouseup",function(e){l.disabled||y.hasClass("sortable-sorting")||t(e.target).closest(".picker-selection-remove").length||l.dropListShowed&&!a.checkable||l.focus()});var T=a.sortValuesByDnd;if(T&&t.fn.sortable){v.addClass("picker-sortable");var S={selector:".picker-selection",stopPropagation:!0,start:function(){l.hideDropList(!0)},finish:function(e){var i=[];t.each(e.list,function(t,e){i.push(e.item.data("value"))}),l.setValue(i.slice(),!1,!0)}};"object"==typeof T&&t.extend(S,T),y.sortable(S)}}if(y.on("click",".picker-selection-remove",function(e){if(!l.disabled){if(l.multi){var i=t(this).closest(".picker-selection");l.deselect(i.data("value"))}else l.deselect();e.stopPropagation()}}),d.on("chosen:updated",function(){l.updateFromSelect(!1),l.setValue(d.val(),!0),l.setDisabled(),l.updateList()}).on("chosen:activate",l.focus).on("chosen:open",l.showDropList).on("chosen:close",l.hideDropList),v.addClass("picker-ready"),t.zui.asap(function(){l.triggerEvent("ready",{picker:l},"","chosen:ready")}),!a.disableScrollOnShow){var D=a.hideOnScroll;D&&![e,i,!0].includes(D)&&t(D).on("scroll",this.handleParentScroll.bind(this))}};r.prototype.destroy=function(){var e=this,i=e.options;e.hideDropList(!0);var o=e.$search;o.off("focus blur input change"),i.hotkey&&o.off("keydown"),o.remove();var a=e.$selections;a.off("click"),e.multi&&a.off("mousedown mouseup"),a.remove();var s=e.$formItem;e.selectOptionsBackup&&(s.empty(),t.each(e.selectOptionsBackup,function(e,n){var o={value:n[i.valueKey]},a=n[i.keysKey];void 0!==a&&(o["data-"+i.keysKey]=a),s.append(t("
");i.$.addClass("load-indicator loading"),s.load(window.location.href+" #"+o,function(r){if(a===o)i.$.empty().html(s.children().html()),i.$.find('[data-ride="pager"]').pager();else{i.$.find("#"+o).empty().html(s.children().html());try{var l=t(r),c=l.find("#"+o).closest('[data-ride="table"],#'+a);if(c.length){var h=c.find(".table-statistic");h.length&&(i.defaultStatistic=h.html());var d=i.$.find('[data-ride="pager"]').data("zui.pager"),u=c.find('[data-ride="pager"]');d&&u.length&&d.set(u.data())}}catch(p){console.error(p)}}i.$.removeClass("load-indicator loading").trigger("beforeTableReload"),delete i.defaultStatistic,i.updateStatistic(),i.initModals(),i.$.datepickerAll();var f=i.$.find("tbody>tr"),g=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(f.filter('[data-id="'+t+'"]'),!0,!0),g=!0)}),g&&i.updateCheckUI(),n.nested&&i.initNestedList(),i.$.trigger("tableReload");var m=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");if(m.length){var u=i.$.find(".pager[data-rec-total]"),v=u.length?u.attr("data-rec-total"):i.getTable().find("tbody:first>tr:not(.table-children)").length;m.text(v)}e&&e(),n.afterReload&&n.afterReload()})},r.prototype.initModals=function(){var e=this,i=e.options,n=e.$.find(i.iframeModalTrigger);if(n.length){var o={type:"iframe",onHide:i.replaceId?function(){var n=t.cookie("selfClose");(1==n||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};n.modalTrigger(o)}},r.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e.data("zui.datatable")||window.initDatatable(e),e=t.find("div.datatable")),e},r.prototype.toggleGroups=function(e){var i=this,n={};i.$.find("tbody>tr").each(function(){var o=t(this).closest("tr").data("id");n[o]||i.toggleRowGroup(o,e)})},r.prototype.toggleRowGroup=function(i,n){var o=this.$.find('tbody>tr[data-id="'+i+'"]'),a=o.filter(".group-summary"),s=n===e?!a.hasClass("hidden"):!!n;o.not(".group-summary").toggleClass("hidden",!s),a.toggleClass("hidden",s),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},r.prototype.updateStatistic=function(){var i=this,n=i.$.find(".table-statistic");if(n.length){if(i.defaultStatistic===e&&(i.defaultStatistic=n.html()),i.options.statisticCreator)return void n.html(i.options.statisticCreator(i)||i.defaultStatistic);var o=i.statisticCols;if(!o&&o!==!1){o={};var a=!1;i.getTable().find("thead th").each(function(e){var i=t(this),n=i.data("statistic");n&&(a=!0,o[e]={format:n,name:i.text()})}),i.statisticCols=!!a&&o}var s=0;o&&t.each(o,function(t){o[t].total=0,o[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var e=t(this),i=e.hasClass("checked"),n=e.children("td");i&&s++,o&&t.each(o,function(t){var e=parseFloat(n.eq(t).text());isNaN(e)&&(e=0),o[t].total+=e,i&&(o[t].checkedTotal+=e)})});var r=[];if(s)r.push(i.lang.selectedItems.format(s));else if(i.defaultStatistic)return void n.html(i.defaultStatistic);o&&t.each(o,function(t){var e=o[t],n=e[s?"checkedTotal":"total"];e.format&&(n=e.format.format(n)),r.push(i.lang.attrTotal.format(e.name,n))}),n.html(r.join(", "))}},r.prototype.updateFixUI=function(e){var i=this,n=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||n-i.lastUpdateTime
').append(t('
').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),h){var d=c[0].getBoundingClientRect();l.css({left:d.left,width:c.width(),overflow:"hidden"}),l.find(".fixed-header-copy").css({left:o.left-d.left,position:"relative",minWidth:i.width()}),a||c.data("fixHeaderScroll")||(c.data("fixHeaderScroll",1),i.width()>c.width()&&c.on("scroll",function(){e.fixHeader()}))}else l.css({left:o.left,width:o.width});var u=l.find("th");n.find("th").each(function(e){u.eq(e).css("width",t(this).outerWidth())})}else l.remove()},r.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var a=n.find("tbody");if(!a.length)return;e=a[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r="function"==typeof s?s(e,o):e.bottom>window.innerHeight-50-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r);var l=t("body"),c=l.hasClass("body-modal");if(r){var h=n.parent(),d=h.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:d?h[0].getBoundingClientRect().left:e.left,width:d?h.width():e.width}),c&&l.css("padding-bottom",40)}else o.css({width:"",left:0,bottom:0}),c&&l.css("padding-bottom",0)},r.prototype.checkAll=function(e){var i=this,n=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},r.prototype.checkRow=function(i,n,o){var a=this,s=a.getTable();a.isDataTable&&!i.is(".datatable-row-left")&&(i=s.find('.datatable-row-left[data-index="'+i.data("index")+'"]'));var r=i.find('input[type="checkbox"]');if(r.length&&!r.is(":disabled")){n===e&&(n=!r.is(":checked")),a.isDataTable?s.find('.datatable-row[data-index="'+i.data("index")+'"]').toggleClass("checked",n):i.toggleClass("checked",n);var l=i.data("id");this.checkItems[l]=n,r.prop("checked",n).trigger("change"),o||(i.hasClass("table-parent")&&s.find((a.isDataTable?".fixed-left ":"")+"tbody>tr.parent-"+l).each(function(){a.checkRow(t(this),n,!0)}),a.updateCheckUI())}},r.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").not(".group-summary"),o=!1,a=null,s=0,r=!1,l=n.length;n.each(function(n){var c=t(this),h=c.find('input[type="checkbox"]');if(!h.length)return void l--;r=h.is(":checked");var d=e.isDataTable?i.find('.datatable-row[data-index="'+c.data("index")+'"]'):c;d.toggleClass("checked",r),d.toggleClass("row-check-begin",r&&!o),a&&a.toggleClass("row-check-end",!r&&o),r&&(s+=1),a=d,o=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange(),i.trigger("checkChange")},r.DEFAULTS={checkable:!0,checkOnClickRow:!0,ajaxForm:!1,selectable:!0,fixHeader:!a,fixFooter:!a,iframeWidth:900,replaceId:"self",nestLevelIndent:18,nested:!1,preserveNested:!0,hot:!1,iframeModalTrigger:".iframe:not(.disabled,[disabled])"},t.fn.table=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new r(this,a)),"string"==typeof e&&o[e]()})}, -r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){"string"==typeof i&&(n=i,i=null),n=n||"show",t.zui.messager?t.zui.messager[n](e,i):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});"function"==typeof r&&(r={complete:r}),r=t.extend({},n,l.data(),r);var c=r.beforeSubmit,h=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if((c&&c(n,a,s))===!1)return!1;l.removeClass("form-watched").enableForm(!1);var r={},h=a.find('[type="file"]');r.fileapi=h.length&&h[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var c=r.responser?t(r.responser):l.find(".form-responser");c.length||(c=t("#responser"));var h=i.message,p=function(){var n=i.callback;if(n)if("object"==typeof n){var o=n.target?e[n.target]:e,a=o[n.name];a.apply(l,Array.isArray(n.params)?n.params:[n.params])}else{var s=n.indexOf("("),r=(s>0?n.substr(0,s):n).split("."),c=e,h=r[0];r.length>1&&(h=r[1],"top"===r[0]?c=e.top:"parent"===r[0]&&(c=e.parent));var a=c[h];if("function"==typeof a){var d=[];return s>0&&")"==n[n.length-1]&&(d=t.parseJSON("["+n.substring(s+1,n.length-1)+"]")),d.push(i),a.apply(l,d)}}};if("success"===i.result){var f=r.locate||i.locate,g=r.closeModal||i.closeModal,m=r.ajaxReload||i.ajaxReload;if(l.enableForm(!0,!!(f||g||m)),h){var v=l.find('[type="submit"]').first(),y=!1;v.length&&(v.popover({container:"body",trigger:"manual",content:h,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||v.data("placement")||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){v.popover("destroy")},r.popoverTime||2e3),y=!0),c.length&&(c.html(''+h+"").show().delay(3e3).fadeOut(100),y=!0),y||a(h,"success")}if(u)return u(i,!0,l);if(g&&setTimeout(t.zui.closeModal,"number"==typeof g?g:r.closeModalTime||2e3),p()===!1)return;if(f)if("loadInModal"==f){var b=t(".modal");setTimeout(function(){b.load(b.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else"parent"===f||"top"===f?e[f]&&setTimeout(function(){e[f].location.reload()},1200):"reload"===f?setTimeout(function(){e.location.href=e.location.href},1200):setTimeout(function(){t.apps?t.apps.open(f):e.location.href=f},1200);if(m){var w=t(m);w.length&&w.load(e.location.href+" "+m,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof h)c.length?c.html(''+h+"").show().delay(3e3).fadeOut(100):a(h,"danger");else if("object"==typeof h){var x=!1,C=[];t.each(h,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var c=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",c);var h=t("#"+e+"_chosen");if(h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){c()===!0&&t(this).removeClass("has-error")}),!x&&!o.data("datetimepicker")){var d=o[0];if(o.hasClass("chosen"))o.trigger("chosen:activate").trigger("chosen:open"),d=o.parent().find(".chosen-container")[0];else if(o.is("textarea")&&o.data("keditor")){var u=o.data("keditor");u.focus(),u.edit.doc.body.focus(),d=o.parent().find(".ke-container")[0]}else o.focus();d.scrollIntoView&&d.scrollIntoView(),x=!0}}),C.length&&a(C.join(";"),"danger")}if(u)return u(i,!1,l);if(p()===!1)return}}},error:function(t,i,n){if((h&&h(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{finish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
'+(n.errorText||window.lang&&window.lang.timeout)+"
"),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=e.trim().split(" ");a.each(function(){var e=t(this),n=(e.text()+" "+(e.data("key")||e.data("filter")||"")).trim();e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active")),n.$.trigger("onSearchComplete",e)},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=(""===o.value||"0"===o.value)&&!o.label,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(c.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(e,n,o,a,s,r,l){if("object"==typeof e)return t.createLink(e.moduleName,e.methodName,e.vars,e.viewType,e.isOnlyBody,e.hash,e.tid);if(t.tabSession&&!l&&(l=t.tabSession.getTid()),a||(a=config.defaultView),s||(s=!1),o)for("string"==typeof o&&(o=o.split("&")),i=0;i'+d+"")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),c=s.find('[name="end"],.control-time-end'),h=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);c.find('option[value="'+i+'"]').length&&c.val(i),r.onChange&&r.onChange(c,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");c.find('option[value="'+u+'"]').length&&c.val(u),r.onChange&&r.onChange(c,u)}}else l.on("change",h),a(l,r.begin),a(c,r.end),s.data("timeSpanControlInit",!0);r.end||h()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,"")){var n=e.split("-");e=n[0];var o=n.length>1?n[1]:"testsuite"===e?"library":"view",a=t.createLink(e,o,"id="+i);t.apps?t.apps.open(a):window.location.href=a}else{var s={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||s[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(t){t?window.top.location.reload():window.location.reload()},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage(1)},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage(1)},t.zui.Picker&&(t.extend(t.zui.Picker.DEFAULTS,{optionRender:function(e,i,n){if("user"===n.options.type){var o=n.options.users;if(!o)return;var a=o[i.value];if(!a)return;if(e.find(".picker-option-text").text(a.realname||a.account),e.hasClass("picker-user-option"))return;return e.prepend(t('
').avatar({user:a})),a.deptName&&e.append(t('').text(a.deptName)),a.roleName&&e.append(t('').text(a.roleName)),e.addClass("picker-user-option")}},checkable:!0,maxListCount:500,disableScrollOnShow:!1}),t.zui.setUserPickerInfos=function(e){t.zui.Picker.DEFAULTS.users=t.extend({},t.zui.Picker.DEFAULTS.users,e)},t(function(){t(".picker-select[data-pickertype!='remote']").picker({chosenMode:!0}),t("[data-pickertype='remote']").each(function(){var e=t(this).attr("data-pickerremote");t(this).picker({chosenMode:!0,remote:e})}),window.pickerUsers&&t.zui.setUserPickerInfos(window.pickerUsers),t(".user-picker").picker({type:"user"})})),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;e.css("position","relative");var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+31+a>e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t.fn.chosen.Constructor=t.fn._chosen.Constructor,t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
{page}/{totalPage}
',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,c=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(c,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var h=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;c="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(c,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,h=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.is("[disabled],.disabled")&&!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var d,u,p,f,g,m=function(){d||(d=t("#subNavbar"),u=t("#pageNav"),p=t("#pageActions"),f=d.children(".nav"),g=f.outerWidth());var e=d.outerWidth(),i=u.outerWidth()||0,n=p.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void f.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,g),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),x()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])}),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var C=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea"); -if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(C)},t(function(){t("textarea.autosize").each(C),t(document).on("input paste change","textarea.autosize",C)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var _="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=_,t("html").toggleClass("is-firefox",_).toggleClass("not-firefox",!_),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){var r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}).on("loaded.zui.modal",function(e){t("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var i=270,n=e.getBoundingClientRect();n.top<0&&(i=Math.min(270,n.height)+n.top),e.style.maxHeight=Math.min(270,i,t(window).height()-28)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),function(t){function e(){if(!config.skipRedirect&&!window.skipRedirect){var e=window.parent,i=config.currentModule,n=config.currentMethod;if("file"!==i||"download"!==n){var o="index"===i&&"index"===n,a="#_single"===location.hash||/(\?|\&)_single/.test(location.search)||o||!t("#mainHeader,#editorNav").length||"tutorial"===i||"install"===i||"upgrade"===i||"user"===i&&("login"===n||"deny"===n)||"my"===i&&"changepassword"===n||t("body").hasClass("allow-self-open"),s=location.href;if(e===window&&!a){var r=location.pathname+location.search+location.hash;return void(location.href=t.createLink("index","index","")+"#app="+encodeURIComponent(r))}if(e!==window&&e.$.apps){o&&e.location.reload();var l=window.name;if(0===l.indexOf("app-")){t.apps=window.apps=e.$.apps;var c=l.substring(4);t.appCode=c,t(document).on("click",function(t){var i=e.document.getElementById(window.name);if(i){var n=e.document.getElementById(i.name)||i;if(n){var o;"function"==typeof Event?o=new Event(t.type,{bubbles:!0}):(o=document.createEvent("Event"),o.initEvent(t.type,!0,!0)),n.dispatchEvent(o)}}}).on("click","a,.open-in-app,.show-in-app",function(e){var i=t(this);if(!i.is("[data-modal],[data-toggle],[data-ride],[data-tab],.iframe,.not-in-app,[target]")&&!i.data("zui.modaltrigger")){var n=i.hasClass("show-in-app")?"":i.attr("href")||(i.is("a")?"":i.data("url")),o=i.data("app")||i.data("group");if(n){if(0===n.indexOf("javascript:")||"#"===n[0])return;var a=t.parseLink(n);if(a.external||"file"===a.moduleName&&"download"===a.methodName)return;if("index"===a.moduleName&&"index"===a.methodName)return window.location.reload(),void e.preventDefault()}else if(!o)return;o||(o=t.apps.getAppCode(n)),o&&("help"===o&&(t.apps.appsMap.help.text=i.text(),t.apps.appsMap.help.url||(t.apps.appsMap.help.url=n)),t.apps.open(n,o)&&e.preventDefault())}}),t.apps.updateUrl(c,s,document.title)}}}}}function i(){var e=t("#navbar>.nav");if(e.length){var i=t("#heading"),n=+i.css("left").replace("px",""),o=i.outerWidth(),a=e.width(),s=t("#mainHeader>.container").width()-2*n,r=Math.floor((s-a)/2);e.css("marginLeft",r>>0;if(0===o)return!1;for(var a=0|e,s=Math.max(a>=0?a:o-Math.abs(a),0);s1&&("?"===e[0]&&(e=e.substr(1)),e.split("&").forEach(function(t){var e=t.split("=",2);if(e.length>1)try{i[e[0]]=decodeURIComponent(e[1])}catch(n){i[e[0]]=""}else i[e[0]]=""})),t?i[t]:i},t.parseLink=function(e){if(!e)return{};var i=0===e.indexOf("http:")||0===e.indexOf("https:");if(i){var n=window.location.origin;if(e.indexOf(n)<0)return{external:!0,url:e};e=e.substr((n+config.webRoot).length)}var o=e.split("#"),a=o[0].split("?"),s=a[1],r=s?t.getSearchParam("",s):{},l=a[0],c={url:e,isOnlyBody:"yes"===r.onlybody,vars:[],hash:o[1]||"",params:r,tid:r.tid||""};if("GET"===config.requestType){c.moduleName=r[config.moduleVar]||"index",c.methodName=r[config.methodVar]||"index",c.viewType=r[config.viewVar]||config.defaultView;for(var h in r)h!==config.moduleVar&&h!==config.methodVar&&h!==config.viewVar&&"onlybody"!==h&&"tid"!==h&&c.vars.push([h,r[h]])}else{var d=l.lastIndexOf("/");d===l.length-1&&(l=l.substr(0,d),d=l.lastIndexOf("/")),d>=0&&(l=l.substr(d+1));var u=l.lastIndexOf(".");u>=0?(c.viewType=l.substr(u+1),l=l.substr(0,u)):c.viewType=config.defaultView;var p=l.split(config.requestFix);if(c.moduleName=p[0]||"index",c.methodName=p[1]||"index",p.length>2)for(var f=2;f.nav>li").length>10&&(i(),t(window).on("resize",i)),setTimeout(n,1e3)})}(jQuery),function(t){"use strict";function e(e,i){"object"!=typeof i&&(i={user:i});var n=t(e);i=t.extend({},n.data(),i);var o=i.user;"string"==typeof o&&(o={account:o});var a={},s=i.size;s&&(a.width=s,a.height=s,a.lineHeight=s,Number.isNaN(+s)||n.addClass("size-"+s));var r=!!o.avatar;if(n.toggleClass("has-image",r).toggleClass("has-text",!r),n.empty(),r)n.append(t("").attr("src",o.avatar));else{var l=t.zui.strCode(o.account)*(i.hueDistance||43)%360;a.background="hsl("+l+","+(i.saturation||"40%")+","+(i.lightness||"60%")+")",Number.isNaN(+s)||(a.fontSize=Math.round(s/2)+"px");var c=o.name||o.realname||o.account;c=/^[\u4e00-\u9fa5\s]+$/.test(c)?c.length<=2?c:c.substring(c.length-2):/^[A-Za-z\d\s]+$/.test(c)?c[0].toUpperCase():c.length<=2?c:c.substring(0,2),n.append(t('').text(c))}return n.css(a)}t.fn.avatar=function(t){return this.each(function(){e(this,t)})}}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file +r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){i=i||"show",t.zui.messager?(n.html=!0,e=e.replace(/\n/g,"
"),t.zui.messager[i](e,n)):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});"function"==typeof r&&(r={complete:r}),r=t.extend({},n,l.data(),r);var c=r.beforeSubmit,h=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if((c&&c(n,a,s))===!1)return!1;l.removeClass("form-watched").enableForm(!1);var r={},h=a.find('[type="file"]');r.fileapi=h.length&&h[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var c=r.responser?t(r.responser):l.find(".form-responser");c.length||(c=t("#responser"));var h=i.message,p=function(){var n=i.callback;if(n)if("object"==typeof n){var o=n.target?e[n.target]:e,a=o[n.name];a.apply(l,Array.isArray(n.params)?n.params:[n.params])}else{var s=n.indexOf("("),r=(s>0?n.substr(0,s):n).split("."),c=e,h=r[0];r.length>1&&(h=r[1],"top"===r[0]?c=e.top:"parent"===r[0]&&(c=e.parent));var a=c[h];if("function"==typeof a){var d=[];return s>0&&")"==n[n.length-1]&&(d=t.parseJSON("["+n.substring(s+1,n.length-1)+"]")),d.push(i),a.apply(l,d)}}};if("success"===i.result){var f=r.locate||i.locate,g=r.closeModal||i.closeModal,m=r.ajaxReload||i.ajaxReload;if(l.enableForm(!0,!!(f||g||m)),h){var v=l.find('[type="submit"]').first(),y=!1;v.length&&(v.popover({container:"body",trigger:"manual",content:h,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||v.data("placement")||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){v.popover("destroy")},r.popoverTime||2e3),y=!0),c.length&&(c.html(''+h+"").show().delay(3e3).fadeOut(100),y=!0),y||a(h,"success")}if(u)return u(i,!0,l);if(g&&setTimeout(t.zui.closeModal,"number"==typeof g?g:r.closeModalTime||2e3),p()===!1)return;if(f)if("loadInModal"==f){var b=t(".modal");setTimeout(function(){b.load(b.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else"parent"===f||"top"===f?e[f]&&setTimeout(function(){e[f].location.reload()},1200):"reload"===f?setTimeout(function(){e.location.href=e.location.href},1200):setTimeout(function(){t.apps?t.apps.open(f):e.location.href=f},1200);if(m){var w=t(m);w.length&&w.load(e.location.href+" "+m,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof h)c.length?c.html(''+h+"").show().delay(3e3).fadeOut(100):a(h,"danger");else if("object"==typeof h){var x=!1,C=[];t.each(h,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var c=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",c);var h=t("#"+e+"_chosen");if(h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){c()===!0&&t(this).removeClass("has-error")}),!x&&!o.data("datetimepicker")){var d=o[0];if(o.hasClass("chosen"))o.trigger("chosen:activate").trigger("chosen:open"),d=o.parent().find(".chosen-container")[0];else if(o.is("textarea")&&o.data("keditor")){var u=o.data("keditor");u.focus(),u.edit.doc.body.focus(),d=o.parent().find(".ke-container")[0]}else o.focus();d.scrollIntoView&&d.scrollIntoView(),x=!0}}),C.length&&a(C,"danger")}if(u)return u(i,!1,l);if(p()===!1)return}}},error:function(t,i,n){if((h&&h(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{finish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
'+(n.errorText||window.lang&&window.lang.timeout)+"
"),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=e.trim().split(" ");a.each(function(){var e=t(this),n=(e.text()+" "+(e.data("key")||e.data("filter")||"")).trim();e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active")),n.$.trigger("onSearchComplete",e)},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=(""===o.value||"0"===o.value)&&!o.label,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(c.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(e,n,o,a,s,r,l){if("object"==typeof e)return t.createLink(e.moduleName,e.methodName,e.vars,e.viewType,e.isOnlyBody,e.hash,e.tid);if(t.tabSession&&!l&&(l=t.tabSession.getTid()),a||(a=config.defaultView),s||(s=!1),o)for("string"==typeof o&&(o=o.split("&")),i=0;i'+d+"")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),c=s.find('[name="end"],.control-time-end'),h=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);c.find('option[value="'+i+'"]').length&&c.val(i),r.onChange&&r.onChange(c,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");c.find('option[value="'+u+'"]').length&&c.val(u),r.onChange&&r.onChange(c,u)}}else l.on("change",h),a(l,r.begin),a(c,r.end),s.data("timeSpanControlInit",!0);r.end||h()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,"")){var n=e.split("-");e=n[0];var o=n.length>1?n[1]:"testsuite"===e?"library":"view",a=t.createLink(e,o,"id="+i);t.apps?t.apps.open(a):window.location.href=a}else{var s={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||s[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(t){t?window.top.location.reload():window.location.reload()},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage(1)},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage(1)},t.zui.Picker&&(t.extend(t.zui.Picker.DEFAULTS,{optionRender:function(e,i,n){if("user"===n.options.type){var o=n.options.users;if(!o)return;var a=o[i.value];if(!a)return;if(e.find(".picker-option-text").text(a.realname||a.account),e.hasClass("picker-user-option"))return;return e.prepend(t('
').avatar({user:a})),a.deptName&&e.append(t('').text(a.deptName)),a.roleName&&e.append(t('').text(a.roleName)),e.addClass("picker-user-option")}},checkable:!0,maxListCount:500,disableScrollOnShow:!1}),t.zui.setUserPickerInfos=function(e){t.zui.Picker.DEFAULTS.users=t.extend({},t.zui.Picker.DEFAULTS.users,e)},t(function(){t(".picker-select[data-pickertype!='remote']").picker({chosenMode:!0}),t("[data-pickertype='remote']").each(function(){var e=t(this).attr("data-pickerremote");t(this).picker({chosenMode:!0,remote:e})}),window.pickerUsers&&t.zui.setUserPickerInfos(window.pickerUsers),t(".user-picker").picker({type:"user"})})),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;e.css("position","relative");var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+31+a>e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t.fn.chosen.Constructor=t.fn._chosen.Constructor,t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
{page}/{totalPage}
',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,c=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(c,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var h=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;c="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(c,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,h=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.is("[disabled],.disabled")&&!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var d,u,p,f,g,m=function(){d||(d=t("#subNavbar"),u=t("#pageNav"),p=t("#pageActions"),f=d.children(".nav"),g=f.outerWidth());var e=d.outerWidth(),i=u.outerWidth()||0,n=p.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void f.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,g),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),x()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])}),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var C=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){ +var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(C)},t(function(){t("textarea.autosize").each(C),t(document).on("input paste change","textarea.autosize",C)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var _="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=_,t("html").toggleClass("is-firefox",_).toggleClass("not-firefox",!_),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){var r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}).on("loaded.zui.modal",function(e){t("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var i=270,n=e.getBoundingClientRect();n.top<0&&(i=Math.min(270,n.height)+n.top),e.style.maxHeight=Math.min(270,i,t(window).height()-28)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),function(t){function e(){if(!config.skipRedirect&&!window.skipRedirect){var e=window.parent,i=config.currentModule,n=config.currentMethod;if("file"!==i||"download"!==n){var o="index"===i&&"index"===n,a="#_single"===location.hash||/(\?|\&)_single/.test(location.search)||o||!t("#mainHeader,#editorNav").length||"tutorial"===i||"install"===i||"upgrade"===i||"user"===i&&("login"===n||"deny"===n)||"my"===i&&"changepassword"===n||t("body").hasClass("allow-self-open"),s=location.href;if(e===window&&!a){var r=location.pathname+location.search+location.hash;return void(location.href=t.createLink("index","index","")+"#app="+encodeURIComponent(r))}if(e!==window&&e.$.apps){o&&e.location.reload();var l=window.name;if(0===l.indexOf("app-")){t.apps=window.apps=e.$.apps;var c=l.substring(4);t.appCode=c,t(document).on("click",function(t){var i=e.document.getElementById(window.name);if(i){var n=e.document.getElementById(i.name)||i;if(n){var o;"function"==typeof Event?o=new Event(t.type,{bubbles:!0}):(o=document.createEvent("Event"),o.initEvent(t.type,!0,!0)),n.dispatchEvent(o)}}}).on("click","a,.open-in-app,.show-in-app",function(e){var i=t(this);if(!i.is("[data-modal],[data-toggle],[data-ride],[data-tab],.iframe,.not-in-app,[target]")&&!i.data("zui.modaltrigger")){var n=i.hasClass("show-in-app")?"":i.attr("href")||(i.is("a")?"":i.data("url")),o=i.data("app")||i.data("group");if(n){if(0===n.indexOf("javascript:")||"#"===n[0])return;var a=t.parseLink(n);if(a.external||"file"===a.moduleName&&"download"===a.methodName)return;if("index"===a.moduleName&&"index"===a.methodName)return window.location.reload(),void e.preventDefault()}else if(!o)return;o||(o=t.apps.getAppCode(n)),o&&("help"===o&&(t.apps.appsMap.help.text=i.text(),t.apps.appsMap.help.url||(t.apps.appsMap.help.url=n)),t.apps.open(n,o)&&e.preventDefault())}}),t.apps.updateUrl(c,s,document.title)}}}}}function i(){var e=t("#navbar>.nav");if(e.length){var i=t("#heading"),n=+i.css("left").replace("px",""),o=i.outerWidth(),a=e.width(),s=t("#mainHeader>.container").width()-2*n,r=Math.floor((s-a)/2);e.css("marginLeft",r>>0;if(0===o)return!1;for(var a=0|e,s=Math.max(a>=0?a:o-Math.abs(a),0);s1&&("?"===e[0]&&(e=e.substr(1)),e.split("&").forEach(function(t){var e=t.split("=",2);if(e.length>1)try{i[e[0]]=decodeURIComponent(e[1])}catch(n){i[e[0]]=""}else i[e[0]]=""})),t?i[t]:i},t.parseLink=function(e){if(!e)return{};var i=0===e.indexOf("http:")||0===e.indexOf("https:");if(i){var n=window.location.origin;if(e.indexOf(n)<0)return{external:!0,url:e};e=e.substr((n+config.webRoot).length)}var o=e.split("#"),a=o[0].split("?"),s=a[1],r=s?t.getSearchParam("",s):{},l=a[0],c={url:e,isOnlyBody:"yes"===r.onlybody,vars:[],hash:o[1]||"",params:r,tid:r.tid||""};if("GET"===config.requestType){c.moduleName=r[config.moduleVar]||"index",c.methodName=r[config.methodVar]||"index",c.viewType=r[config.viewVar]||config.defaultView;for(var h in r)h!==config.moduleVar&&h!==config.methodVar&&h!==config.viewVar&&"onlybody"!==h&&"tid"!==h&&c.vars.push([h,r[h]])}else{var d=l.lastIndexOf("/");d===l.length-1&&(l=l.substr(0,d),d=l.lastIndexOf("/")),d>=0&&(l=l.substr(d+1));var u=l.lastIndexOf(".");u>=0?(c.viewType=l.substr(u+1),l=l.substr(0,u)):c.viewType=config.defaultView;var p=l.split(config.requestFix);if(c.moduleName=p[0]||"index",c.methodName=p[1]||"index",p.length>2)for(var f=2;f.nav>li").length>10&&(i(),t(window).on("resize",i)),setTimeout(n,1e3)})}(jQuery),function(t){"use strict";function e(e,i){"object"!=typeof i&&(i={user:i});var n=t(e);i=t.extend({},n.data(),i);var o=i.user;"string"==typeof o&&(o={account:o});var a={},s=i.size;s&&(a.width=s,a.height=s,a.lineHeight=s,Number.isNaN(+s)||n.addClass("size-"+s));var r=!!o.avatar;if(n.toggleClass("has-image",r).toggleClass("has-text",!r),n.empty(),r)n.append(t("").attr("src",o.avatar));else{var l=t.zui.strCode(o.account)*(i.hueDistance||43)%360;a.background="hsl("+l+","+(i.saturation||"40%")+","+(i.lightness||"60%")+")",Number.isNaN(+s)||(a.fontSize=Math.round(s/2)+"px");var c=o.name||o.realname||o.account;c=/^[\u4e00-\u9fa5\s]+$/.test(c)?c.length<=2?c:c.substring(c.length-2):/^[A-Za-z\d\s]+$/.test(c)?c[0].toUpperCase():c.length<=2?c:c.substring(0,2),n.append(t('').text(c))}return n.css(a)}t.fn.avatar=function(t){return this.each(function(){e(this,t)})}}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file From 4e454da2710ef22ef67ae59fcf977242a68b804c Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 12 Jul 2022 07:30:01 +0000 Subject: [PATCH 0514/1178] * Fix bug. --- module/task/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index 5733aa0bf8..5ba9aaae47 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -748,7 +748,7 @@ class task extends control * @access public * @return void */ - public function assignTo($executionID, $taskID, $kanbanGroup = 'default', $from='') + public function assignTo($executionID, $taskID, $kanbanGroup = 'default', $from = '') { $this->commonAction($taskID); $task = $this->task->getByID($taskID); From b4ab8b5b39b7def235f8e0f977885ae8112a81f1 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 12 Jul 2022 15:31:11 +0800 Subject: [PATCH 0515/1178] * Finish task #60491. --- module/project/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 26a0ae905a..ba3103f9a5 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1544,13 +1544,13 @@ class projectModel extends model /* Child project begin cannot less than parent. */ if(!empty($projects[$projectID]->name) and $projects[$projectID]->begin < $parentProject->begin) { - dao::$errors[] = "ID {$projects[$projectID]->id}" . sprintf($this->lang->project->beginGreateChild, $parentProject->begin); + dao::$errors[] = "ID {$projects[$projectID]->id}" . sprintf($this->lang->project->beginGreateChild, $parentProject->begin) . "\n"; } /* When parent set end then child project end cannot greater than parent. */ if(!empty($projects[$projectID]->name) and $parentProject->end != '0000-00-00' and $projects[$projectID]->end > $parentProject->end) { - dao::$errors[] = "ID {$projects[$projectID]->id}" . sprintf($this->lang->project->endLetterChild, $parentProject->end); + dao::$errors[] = "ID {$projects[$projectID]->id}" . sprintf($this->lang->project->endLetterChild, $parentProject->end) . "\n"; } } } From a73cfac42cf275485fa439b191939ca6fe2c8619 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 12 Jul 2022 15:33:44 +0800 Subject: [PATCH 0516/1178] * Finish task #60475. --- module/kanban/control.php | 2 +- module/kanban/js/create.js | 1 + module/kanban/model.php | 7 +++---- module/kanban/view/create.html.php | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/kanban/control.php b/module/kanban/control.php index 76efb62169..245182b0fb 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -213,7 +213,7 @@ class kanban extends control if(!empty($_POST)) { - $kanbanID = $this->kanban->create($output); + $kanbanID = $this->kanban->create(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); diff --git a/module/kanban/js/create.js b/module/kanban/js/create.js index 9c3999686a..4c7fc63489 100644 --- a/module/kanban/js/create.js +++ b/module/kanban/js/create.js @@ -7,6 +7,7 @@ $(function() $("input[id='copyContentregion']").click(function() { copyRegion = $(this).prop('checked'); + $('#copyRegion').val(copyRegion); }); $("input[name='import']").change(function() diff --git a/module/kanban/model.php b/module/kanban/model.php index 6aafe73651..3b39059930 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -2133,11 +2133,10 @@ class kanbanModel extends model /* * Create a kanban. * - * @param array $extra * @access public * @return int */ - public function create($extra = array()) + public function create() { $account = $this->app->user->account; $kanban = fixer::input('post') @@ -2151,7 +2150,7 @@ class kanbanModel extends model ->join('whitelist', ',') ->join('team', ',') ->trim('name') - ->remove('contactListMenu,type,import,importObjectList,copyKanbanID') + ->remove('contactListMenu,type,import,importObjectList,copyKanbanID,copyRegion') ->get(); if($this->post->import == 'on') $kanban->object = implode(',', $this->post->importObjectList); @@ -2181,7 +2180,7 @@ class kanbanModel extends model $kanbanID = $this->dao->lastInsertID(); $kanban = $this->getByID($kanbanID); - if(isset($extra['copyRegion'])) + if($this->post->copyRegion) { $this->copyRegions($kanban, $this->post->copyKanbanID); } diff --git a/module/kanban/view/create.html.php b/module/kanban/view/create.html.php index 0ce407ef45..bf68bf85f9 100644 --- a/module/kanban/view/create.html.php +++ b/module/kanban/view/create.html.php @@ -97,6 +97,7 @@ + From ed24e40025202d96ea1d39e185290cd75f383400 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 12 Jul 2022 15:36:57 +0800 Subject: [PATCH 0517/1178] * Modify page error. --- module/gitlab/control.php | 4 ++++ module/gitlab/model.php | 19 ------------------- module/gitlab/view/browseproject.html.php | 4 ++-- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/module/gitlab/control.php b/module/gitlab/control.php index 0f3d774d41..4c4f74257c 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -1391,6 +1391,8 @@ class gitlab extends control { $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); + + $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); } @@ -1437,6 +1439,8 @@ class gitlab extends control { $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); + + $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); } diff --git a/module/gitlab/model.php b/module/gitlab/model.php index 6ba139764b..d5a627dfc1 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -2876,23 +2876,4 @@ class gitlabModel extends model $html .= '
'; return $html; } - - /** - * Download zip code. - * - * @param int $gitlabID - * @param int $projectID - * @param string $branch - * @param string $ext tar.gz|tar.bz2|tbz|tbz2|tb2|bz2|tar|zip - * @access public - * @return string - */ - public function downloadCode($gitlabID = 0, $projectID = 0, $branch = '', $ext = 'zip') - { - if(empty($gitlabID) or empty($projectID)) return false; - - $url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/repository/archive." . $ext); - if($branch) $url .= '&sha=' . $branch; - return $url; - } } diff --git a/module/gitlab/view/browseproject.html.php b/module/gitlab/view/browseproject.html.php index e2e9c57d1d..486412f9d7 100644 --- a/module/gitlab/view/browseproject.html.php +++ b/module/gitlab/view/browseproject.html.php @@ -60,8 +60,8 @@ last_activity_at, 0, 10);?> id", '', 'list', 'branch-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); - echo common::buildIconButton('gitlab', 'manageTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); + echo common::buildIconButton('gitlab', 'manageBranchPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'branch-lock', '', '', false, '', $this->lang->gitlab->browseBranchPriv, 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); + echo common::buildIconButton('gitlab', 'manageTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', $this->lang->gitlab->browseTagPriv, 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); echo common::buildIconButton('gitlab', 'manageProjectMembers', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'team', '', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id])); echo common::buildIconButton('gitlab', 'createWebhook', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'change', 'hiddenwin', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id])); echo common::buildIconButton('gitlab', 'importIssue', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'link', '', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id])); From 75bf140f6d02cac3c6a9d8a31658817dda69fdd5 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 12 Jul 2022 15:37:16 +0800 Subject: [PATCH 0518/1178] * Modify repo page data. --- lib/scm/gitea.class.php | 161 ++++++++++++++++----------------------- lib/scm/gitlab.class.php | 17 +++++ lib/scm/scm.class.php | 13 ++++ module/repo/config.php | 3 + module/repo/control.php | 6 +- module/repo/model.php | 2 +- 6 files changed, 102 insertions(+), 100 deletions(-) diff --git a/lib/scm/gitea.class.php b/lib/scm/gitea.class.php index 41b8285932..84b02072d3 100644 --- a/lib/scm/gitea.class.php +++ b/lib/scm/gitea.class.php @@ -34,7 +34,7 @@ class gitea public function ls($path, $revision = 'HEAD') { if(!scm::checkRevision($revision)) return array(); - $api = "tree"; + $api = "contents"; $param = new stdclass(); $param->path = ltrim($path, '/'); @@ -70,10 +70,10 @@ class gitea if(empty($commits)) continue; $commit = $commits[0]; - $info->revision = $commit->id; - $info->comment = $commit->message; - $info->account = $commit->committer_name; - $info->date = date('Y-m-d H:i:s', strtotime($commit->committed_date)); + $info->revision = $commit->sha; + $info->comment = $commit->commit->message; + $info->account = $commit->commit->committer->name; + $info->date = date('Y-m-d H:i:s', strtotime($commit->commit->committer->date)); $info->size = 0; } @@ -102,23 +102,23 @@ class gitea public function files($path, $ref = 'master') { $path = urlencode($path); - $api = "files/$path"; + $api = "contents/$path"; $param = new stdclass(); $param->ref = $ref; $file = $this->fetch($api, $param); - if(!isset($file->file_name)) return false; + if(!isset($file->name)) return false; $commits = $this->getCommitsByPath($path, '', '', 1); - $file->revision = $file->commit_id; + $file->revision = $file->sha; $file->size = $this->formatBytes($file->size); if(!empty($commits)) { $commit = $commits[0]; - $file->revision = $commit->id; - $file->committer = $commit->committer_name; - $file->comment = $commit->message; - $file->date = date('Y-m-d H:i:s', strtotime($commit->committed_date)); + $file->revision = $commit->sha; + $file->committer = $commit->commit->committer->name; + $file->comment = $commit->commit->message; + $file->date = date('Y-m-d H:i:s', strtotime($commit->commit->committer->date)); } return $file; @@ -145,7 +145,7 @@ class gitea { $params['page'] = $page; $list = $this->fetch($api, $params); - if(empty($list)) break; + if(empty($list) or $list == '[]') break; foreach($list as $tag) $tags[] = $tag->name; if(count($list) < $params['per_page']) break; @@ -177,7 +177,7 @@ class gitea foreach($branchList as $branch) { if(!isset($branch->name)) continue; - if($branch->default) + if($branch->name == 'main') { $default[$branch->name] = $branch->name; } @@ -232,7 +232,7 @@ class gitea $list = $this->getCommitsByPath($path, $fromRevision, $toRevision); foreach($list as $commit) { - if(isset($commit->id)) $commit->diffs = $this->getFilesByCommit($commit->id); + if(isset($commit->sha)) $commit->diffs = $this->getFilesByCommit($commit->sha); } return $this->parseLog($list); @@ -248,42 +248,7 @@ class gitea */ public function blame($path, $revision) { - if(!scm::checkRevision($revision)) return array(); - - $path = ltrim($path, DIRECTORY_SEPARATOR); - $path = urlencode($path); - $api = "files/$path/blame"; - $param = new stdclass; - $param->ref = ($revision and $revision != 'HEAD') ? $revision : $this->branch; - $results = $this->fetch($api, $param); - - $blames = array(); - $revLine = 0; - $revision = ''; - - $lineNumber = 1; - foreach($results as $blame) - { - $line = array(); - $line['revision'] = $blame->commit->id; - $line['committer'] = $blame->commit->committer_name; - $line['time'] = $blame->commit->committer_name; - $line['line'] = $lineNumber; - $line['lines'] = count($blame->lines); - $line['content'] = array_shift($blame->lines); - - $blames[$lineNumber] = $line; - - $lineNumber ++; - - foreach($blame->lines as $line) - { - $blames[$lineNumber] = array('line' => $lineNumber, 'content' => $line); - $lineNumber ++; - } - } - - return $blames; + return array(); } /** @@ -562,16 +527,16 @@ class gitea { $api .= '/' . $version; $commit = $this->fetch($api); - if(isset($commit->id)) + if(isset($commit->sha)) { $log = new stdclass; - $log->committer = $commit->committer_name; - $log->revision = $commit->id; - $log->comment = $commit->message; - $log->time = date('Y-m-d H:i:s', strtotime($commit->created_at)); + $log->committer = $commit->commit->committer->name; + $log->revision = $commit->sha; + $log->comment = $commit->commit->message; + $log->time = date('Y-m-d H:i:s', strtotime($commit->commit->committer->date)); - $commits[$commit->id] = $log; - $files[$commit->id] = $this->getFilesByCommit($log->revision); + $commits[$commit->sha] = $log; + $files[$commit->sha] = $this->getFilesByCommit($log->revision); return array('commits' => $commits, 'files' => $files); } @@ -608,16 +573,16 @@ class gitea foreach($list as $commit) { - if(!is_object($commit)) continue; + if(!is_object($commit->commit)) continue; $log = new stdclass; - $log->committer = $commit->committer_name; - $log->revision = $commit->id; - $log->comment = $commit->message; - $log->time = date('Y-m-d H:i:s', strtotime($commit->created_at)); + $log->committer = $commit->commit->committer->name; + $log->revision = $commit->sha; + $log->comment = $commit->commit->message; + $log->time = date('Y-m-d H:i:s', strtotime($commit->commit->committer->date)); - $commits[$commit->id] = $log; - $files[$commit->id] = $this->getFilesByCommit($log->revision); + $commits[$commit->sha] = $log; + $files[$commit->sha] = $this->getFilesByCommit($log->revision); } return array('commits' => $commits, 'files' => $files); @@ -694,33 +659,18 @@ class gitea public function getFilesByCommit($revision) { if(!scm::checkRevision($revision)) return array(); - $api = "commits/{$revision}/diff"; - $params = new stdclass; - $params->page = 1; - $params->per_page = 100; - - $allResults = array(); - while(true) - { - $results = $this->fetch($api, $params); - $params->page ++; - if(!is_array($results)) $results = array(); - $allResults = $allResults + $results; - if(count($results) < 100) break; - } + $api = "contents"; + $results = $this->fetch($api, array('ref' => $revision)); + if(empty($results)) return array(); $files = array(); - foreach($allResults as $row) + foreach($results as $row) { - $file = new stdclass(); + $file = new stdclass(); $file->revision = $revision; - $file->path = '/' . $row->new_path; - $file->type = 'file'; - - $file->action = 'M'; - if($row->new_file) $file->action = 'A'; - if($row->renamed_file) $file->action = 'R'; - if($row->deleted_file) $file->action = 'D'; + $file->action = 'A'; + $file->type = $row->type; + $file->path = '/' . trim($row->path); $files[] = $file; } @@ -737,7 +687,7 @@ class gitea */ public function tree($path, $recursive = 1) { - $api = "tree"; + $api = "contents"; $params = array(); $params['path'] = ltrim($path, '/'); @@ -756,8 +706,8 @@ class gitea public function fetch($api, $params = array(), $needToLoop = false) { $params = (array) $params; - $params['private_token'] = $this->token; - $params['per_page'] = isset($params['per_page']) ? $params['per_page'] : 100; + $params['token'] = $this->token; + $params['per_page'] = isset($params['per_page']) ? $params['per_page'] : 100; $api = ltrim($api, '/'); $api = $this->root . $api . '?' . http_build_query($params); @@ -783,7 +733,8 @@ class gitea return array(); } - return json_decode($response); + $res = json_decode($response); + return empty($res) ? trim($response) : $res; } } @@ -816,12 +767,12 @@ class gitea $i = 0; foreach($logs as $commit) { - if(!isset($commit->id)) continue; + if(!isset($commit->sha)) continue; $parsedLog = new stdclass(); - $parsedLog->revision = $commit->id; - $parsedLog->committer = $commit->committer_name; - $parsedLog->time = date('Y-m-d H:i:s', strtotime($commit->committed_date)); - $parsedLog->comment = $commit->message; + $parsedLog->revision = $commit->sha; + $parsedLog->committer = $commit->commit->committer->name; + $parsedLog->time = date('Y-m-d H:i:s', strtotime($commit->commit->committer->date)); + $parsedLog->comment = $commit->commit->message; $parsedLog->change = array(); foreach($commit->diffs as $diff) { @@ -834,4 +785,20 @@ class gitea return $parsedLogs; } + + /** + * Get download url. + * + * @param string $branch + * @param string $ext + * @access public + * @return string + */ + public function getDownloadUrl($branch = 'master', $ext = 'zip') + { + $params = (array) $params; + $params['token'] = $this->token; + + return "{$this->root}archive/{$branch}.{$ext}" . '?' . http_build_query($params); + } } diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 324d03a9cc..583b0b1475 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -834,4 +834,21 @@ class gitlab return $parsedLogs; } + + /** + * Get download url. + * + * @param string $branch + * @param string $ext + * @access public + * @return string + */ + public function getDownloadUrl($branch = 'master', $ext = 'zip') + { + $params = (array) $params; + $params['private_token'] = $this->token; + $params['sha'] = $branch; + + return "{$this->root}archive.{$ext}" . '?' . http_build_query($params); + } } diff --git a/lib/scm/scm.class.php b/lib/scm/scm.class.php index 06648998c3..9cbd9cb79a 100644 --- a/lib/scm/scm.class.php +++ b/lib/scm/scm.class.php @@ -244,6 +244,19 @@ class scm if(preg_match('/[^a-z0-9\-_\.\^\w][\x{4e00}-\x{9fa5}]/ui', $revision)) return false; return true; } + + /** + * Get download url. + * + * @param string $branch + * @param string $ext + * @access public + * @return void + */ + public function getDownloadUrl($branch = '', $ext = 'zip') + { + return $this->engine->getDownloadUrl($branch, $ext); + } } /** diff --git a/module/repo/config.php b/module/repo/config.php index af7bfa2cd0..4bd26c4601 100644 --- a/module/repo/config.php +++ b/module/repo/config.php @@ -49,6 +49,9 @@ $config->repo->gitlab = new stdclass; $config->repo->gitlab->perPage = 300; $config->repo->gitlab->apiPath = "%s/api/v4/projects/%s/repository/"; +$config->repo->gitea = new stdclass; +$config->repo->gitea->apiPath = "%s/api/v1/repos/%s/"; + $config->repo->gitServiceList = array('gitlab', 'gitea'); $config->repo->rules['module']['task'] = 'Task'; diff --git a/module/repo/control.php b/module/repo/control.php index b1bcb3be74..7d31cc353b 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -1367,9 +1367,11 @@ class repo extends control } $repo = $this->repo->getRepoByID($repoID); - if($repo->SCM == 'Gitlab') + if(in_array($repo->SCM, array('Gitlab', 'Gitea'))) { - $url = $this->loadModel('gitlab')->downloadCode($repo->gitlab, $repo->project, $branch); + $this->scm = $this->app->loadClass('scm'); + $this->scm->setEngine($repo); + $url = $this->scm->getDownloadUrl($branch); } elseif($repo->SCM == 'Git') { diff --git a/module/repo/model.php b/module/repo/model.php index bdc537385e..9a32306156 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -2032,7 +2032,7 @@ class repoModel extends model $repo->gitService = $service ? $service->id : 0; $repo->project = $service ? $repo->path : ''; // The projectID in gitlab. - $repo->path = $service ? sprintf($this->config->repo->gitlab->apiPath, $service->url, $repo->path) : ''; + $repo->path = $service ? sprintf($this->config->repo->{$service->type}->apiPath, $service->url, $repo->path) : ''; $repo->client = $service ? $service->url : ''; $repo->password = $service ? $service->token : ''; return $repo; From 8dc58ed292e733ba1906721fcfb9a3155e525600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 12 Jul 2022 15:47:29 +0800 Subject: [PATCH 0519/1178] * Code for project-task url. --- config/filter.php | 1 + module/common/lang/menu.php | 2 +- module/project/control.php | 2 +- module/project/css/execution.css | 1 + module/project/js/execution.js | 10 ++++++++++ module/project/view/execution.html.php | 11 +++++++++-- module/task/control.php | 9 +++++++-- 7 files changed, 30 insertions(+), 6 deletions(-) diff --git a/config/filter.php b/config/filter.php index c368da4405..95c366a47d 100755 --- a/config/filter.php +++ b/config/filter.php @@ -271,6 +271,7 @@ $filter->project->task->cookie['projectTaskOrder'] = 'reg::orderBy'; $filter->project->task->cookie['windowWidth'] = 'int'; $filter->project->export->cookie['checkedItem'] = 'reg::checked'; $filter->project->execution->cookie['pagerExecutionAll'] = 'int'; +$filter->project->execution->cookie['showTask'] = 'code'; $filter->projectstory->story->cookie['storyModuleParam'] = 'int'; $filter->projectstory->story->cookie['pagerProductBrowse'] = 'int'; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 5c98da0697..be1a23d37f 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -245,7 +245,7 @@ $lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang-> /* Waterfall menu. */ $lang->waterfall->menu = new stdclass(); $lang->waterfall->menu->index = array('link' => "$lang->dashboard|project|index|project=%s"); -$lang->waterfall->menu->execution = array('link' => "{$lang->stage->common}|project|execution|status=all&projectID=%s", 'subModule' => 'programplan'); +$lang->waterfall->menu->execution = array('link' => "{$lang->stage->common}|project|execution|status=all&projectID=%s", 'subModule' => 'programplan,task'); $lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|project=%s", 'subModule' => 'projectstory,tree', 'exclude' => 'projectstory-track'); $lang->waterfall->menu->design = array('link' => "{$lang->design->common}|design|browse|project=%s"); $lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); diff --git a/module/project/control.php b/module/project/control.php index 357cbf8a28..7dce65d6f1 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -975,7 +975,7 @@ class project extends control $this->view->title = $this->lang->execution->allExecutions; $this->view->position[] = $this->lang->execution->allExecutions; - $this->view->executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager, true); + $this->view->executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager, $this->cookie->showTask); $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->productID = $productID; $this->view->projectID = $projectID; diff --git a/module/project/css/execution.css b/module/project/css/execution.css index 2ffca49c7f..0853109e06 100644 --- a/module/project/css/execution.css +++ b/module/project/css/execution.css @@ -1,2 +1,3 @@ #executionList > thead > tr > th .table-nest-toggle-global {top: 6px} #executionList > thead > tr > th .table-nest-toggle-global:before {color: #a6aab8;} +#mainMenu .pull-left .checkbox-primary {margin-top: 5px;} diff --git a/module/project/js/execution.js b/module/project/js/execution.js index 88b9ac0803..1a6ea3f77d 100644 --- a/module/project/js/execution.js +++ b/module/project/js/execution.js @@ -1,3 +1,13 @@ +$(function() +{ + $('input[name^="showTask"]').click(function() + { + var show = $(this).is(':checked') ? 1 : 0; + $.cookie('showTask', show, {expires:config.cookieLife, path:config.webRoot}); + window.location.reload(); + }); +}) + window.addEventListener('scroll', this.handleScroll) function handleScroll(e) { diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 0b00b71ec5..bb10afc189 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -23,6 +23,7 @@ {$pager->recTotal}
";?> createLink('project', 'execution', "status=$key&projectID=$projectID&orderBy=$orderBy&productID=$productID"), $label, '', "class='btn btn-link' id='{$key}Tab'");?> + $lang->programplan->stageCustom->task), '', $this->cookie->showTask ? 'checked=checked' : '');?>
" . $lang->export, '', "class='btn btn-link export'")?> @@ -82,6 +83,9 @@ class=""> id;?> class="table-nest-icon icon table-nest-toggle"> + systemMode == 'new'):?> + '>execution->typeList[$execution->type]?> + createLink('execution', 'view', "executionID=$execution->id"), $execution->name);?> PM);?> @@ -139,7 +143,7 @@ if($task == end($child->tasks) and count($execution->tasks) == 50) $trClass .= ' showmore'; ?> class=''> - createLink('task', 'view', "id=$task->id"), $task->name);?> + createLink('task', 'view', "id=$task->id"), $task->name, '', "data-app={$this->app->tab}");?> assignedTo);?> task->statusList, $task->status);?> @@ -189,6 +193,9 @@ ?> class=''> + systemMode == 'new'):?> + '>execution->typeList[$child->type]?> + createLink('execution', 'view', "executionID=$child->id"), $child->name);?> PM);?> @@ -246,7 +253,7 @@ if($task == end($child->tasks) and count($child->tasks) == 50) $trClass .= ' showmore'; ?> class=''> - createLink('task', 'view', "id=$task->id"), $task->name);?> + createLink('task', 'view', "id=$task->id"), $task->name, '', "data-app={$this->app->tab}");?> assignedTo);?> task->statusList, $task->status);?> diff --git a/module/task/control.php b/module/task/control.php index 1eb54da1b0..c80ed09fc9 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -48,6 +48,7 @@ class task extends control $executions = $this->execution->getPairs(0, 'all', !common::canModify('execution', $execution) ? 'noclosed' : ''); $executionID = $this->execution->saveState($executionID, $executions); $this->execution->setMenu($executionID); + if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project); $this->execution->getLimitedExecution(); $limitedExecutions = !empty($_SESSION['limitedExecutions']) ? $_SESSION['limitedExecutions'] : ''; @@ -332,6 +333,7 @@ class task extends control /* Set menu. */ $this->execution->setMenu($execution->id); + if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project); /* When common task are child tasks, query whether common task are consumed. */ $taskConsumed = 0; @@ -540,6 +542,8 @@ class task extends control } } + if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project); + $tasks = $this->task->getParentTaskPairs($this->view->execution->id, $this->view->task->parent); if(isset($tasks[$taskID])) unset($tasks[$taskID]); @@ -855,6 +859,7 @@ class task extends control $this->session->set('executionList', $this->app->getURI(true), 'execution'); $this->commonAction($taskID); + if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project); $taskID = (int)$taskID; $task = $this->task->getById($taskID, true); @@ -1803,7 +1808,7 @@ class task extends control $showmore = ($count == 50 and $task == end($tasks)) ? 'showmore' : ''; $body .= "id data-nest-path='$path' data-nest-parent=$executionID class='is-nest-child $showmore'>"; - $body .= '' . html::a($this->createLink('task', 'view', "id=$task->id"), $task->name) . ''; + $body .= '' . html::a($this->createLink('task', 'view', "id=$task->id"), $task->name, '', "data-app='project'") . ''; $body .= '' . zget($users, $task->assignedTo, '') . ''; $body .= '' . zget($this->lang->task->statusList, $task->status, '') . ''; $body .= ''; @@ -1824,7 +1829,7 @@ class task extends control $path = $execution->grade == 2 ? "$execution->parent,$execution->id,$childTask->parent,$childTask->id," : ",$execution->id,$childTask->parent,$childTask->id,"; $body .= "id data-nest-path='$path' data-nest-parent=$executionID class='is-nest-child no-nest'>"; - $body .= '' . html::a($this->createLink('task', 'view', "id=$childTask->id"), $childTask->name) . ''; + $body .= '' . html::a($this->createLink('task', 'view', "id=$childTask->id"), $childTask->name, '', "data-app='project'") . ''; $body .= '' . zget($users, $childTask->assignedTo, '') . ''; $body .= '' . zget($this->lang->task->statusList, $childTask->status, '') . ''; $body .= ''; From 739758db0f8278000d9136ebc891625b84b7930e Mon Sep 17 00:00:00 2001 From: wangzemei Date: Tue, 12 Jul 2022 08:01:51 +0000 Subject: [PATCH 0520/1178] * Code for bug #23827 --- www/js/zui/min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/zui/min.js b/www/js/zui/min.js index a1dc5ba902..80618106bd 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -76,5 +76,5 @@ function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"= */ function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,c=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t,e,i){"use strict";var n="zui.picker",o={},a={lang:null,remote:null,remoteConverter:null,remoteOnly:!1,onRemoteError:null,disableEmptySearch:!1,textKey:"text",valueKey:"value",keysKey:"keys",multi:"auto",formItem:"auto",list:null,allowSingleDeselect:null,autoSelectFirst:!1,maxSelectedCount:0,maxListCount:100,hideEmptyTextOption:!0,searchValueKey:!0,emptyResultHint:null,hideOnScroll:!0,inheritFormItemClasses:!1,emptySearchResultHint:null,accurateSearchHint:null,remoteErrorHint:null,deleteByBackspace:!0,disableScrollOnShow:!0,maxDropHeight:250,dropDirection:"auto",dropWidth:"100%",maxAutoDropWidth:450,minAutoDropWidth:100,multiValueSplitter:",",multiSelectActions:5,searchDelay:200,autoClearDrop:6e4,fixLabelFor:!0,hotkey:!0,onSelect:null,onDeselect:null,onBeforeChange:null,onChange:null,onReady:null,onNoResults:null,onShowingDrop:null,onHidingDrop:null,onShowedDrop:null,onHiddenDrop:null,valueMustInList:!0},s={zh_cn:{emptyResultHint:"没有可选项",emptySearchResultHint:"没有找到 “{0}”",accurateSearchHint:"请提供更多关键词缩小匹配范围",remoteErrorHint:"无法从服务器获取结果 - {0}",selectAll:"全选",deselectAll:"取消选择"},zh_tw:{emptyResultHint:"沒有可選項",emptySearchResultHint:"沒有找到 “{0}”",accurateSearchHint:"請提供更多關鍵詞縮小匹配範圍",remoteErrorHint:"無法從服務器獲取結果 - {0}",selectAll:"全選",deselectAll:"取消選擇"},en:{emptyResultHint:"No options",emptySearchResultHint:'Cannot found "{0}"',accurateSearchHint:"Suggest to provide more keywords",remoteErrorHint:"Unable to get result from server: {0}",selectAll:"Select all",deselectAll:"Deselect all"}},r=function(o,a){var l=this;l.name=n,l.$=t(o),l.id="pk_"+(l.$.attr("id")||t.zui.uuid()),a=l.options=t.extend({},r.DEFAULTS,this.$.data(),a),void 0!==a.hideOnWindowScroll&&(a.hideOnScroll=a.hideOnWindowScroll);var c=t.zui.clientLang?t.zui.clientLang():"en",h=a.lang||c;l.lang=t.zui.getLangData?t.zui.getLangData(n,h,s):s[h]||s[c];var d,u,p=a.formItem,f='.form-item,input[type="hidden"],select,input[type="text"]';if(d="self"===p?l.$:"auto"!==p&&p?l.$.find(p):l.$.is(f)?l.$:l.$.find(f).first(),!d.length)return console.error&&console.error("Cannot found form item for picker.");if(d.is('input[type="hidden"]'))u="hidden";else if(d.is("select"))u="select";else{if(!d.is('input[type="text"]'))return console.error&&console.error("Unknown form type for picker.");u="text"}a.inheritFormItemClasses&&v.addClass(d.attr("class")),l.formType=u,l.$formItem=d.removeClass("picker").hide(),l.selfFormItem=d.is(l.$);var g=a.multi;g&&"auto"!==g||(g="select"===u&&"multiple"===d.attr("multiple")),g=!!g,l.multi=g,g||(l.options.checkable=!1);var m=a.list;m?l.setList("function"==typeof m?m({search:l.search,limit:a.maxListCount}):m,!0):"select"===u?l.updateFromSelect():l.setList([],!0);var v;v=!l.selfFormItem&&l.$.hasClass("picker")?l.$:t('
').insertAfter(l.$),v.addClass("picker").toggleClass("picker-multi",g).toggleClass("picker-single",!g);var y=v.children(".picker-selections");y.length?y.empty():y=t('
');var b=l.id+"-search",w=t('').appendTo(y);if(!g){var x=t('
');a.allowSingleDeselect&&x.append(''),x.appendTo(y),l.$singleSelection=x}v.toggleClass("picker-input-empty",!w.val().length).append(y),l.$container=v,l.$selections=y,l.$search=w,l.search="";var C=a.placeholder;if(void 0===C&&(C=d.attr("placeholder")),"string"==typeof C&&C.length&&y.append(t('
').text(C)),a.placeholder=C,a.fixLabelFor){var _=d.attr("id");_&&t('label[for="'+_+'"]').attr("for",b)}var k=void 0!==a.defaultValue?a.defaultValue:d.val();if(null===k&&(k=""),l.setValue(k,!0),l.setDisabled(),w.on("focus",function(){l.disabled||(l._blurTimer&&(clearTimeout(l._blurTimer),l._blurTimer=0),v.addClass("picker-focus"),l.showDropList())}).on("blur",function(){l.disabled||(l._blurTimer&&clearTimeout(l._blurTimer),l._blurTimer=setTimeout(function(){l._blurTimer=0,w.is(":focus")||v.removeClass("picker-focus")},100))}).on("input change",function(){if(!l.disabled){var t=w.val();g&&w.width(14*t.length),v.toggleClass("picker-input-empty",!t.length),l.tryUpdateList(t)}}),a.hotkey&&w.on("keydown",function(t){if(!l.disabled){var e=t.key||t.which;if(l.dropListShowed){var i=l.activeValue,n="string"==typeof i;if("Enter"===e||13===e)n&&(l.select(i,g),g?(l.$search.val(""),l.tryUpdateList("")):w.blur(),t.preventDefault(),t.stopPropagation());else if("ArrowDown"===e||40===e){var o,s=l.$activeOption;if(s&&(o=s.next(".picker-option"),g))for(;o.length&&o.hasClass("picker-option-selected");)o=o.next(".picker-option");o&&o.length||(o=l.$optionsList.children(g?".picker-option:not(.picker-option-selected)":".picker-option").first()),o.length&&l.activeOption(o),t.preventDefault(),t.stopPropagation()}else if("ArrowUp"===e||30===e){var r,s=l.$activeOption;if(s&&(r=s.prev(".picker-option"),g))for(;r.length&&r.hasClass("picker-option-selected");)r=r.prev(".picker-option");r&&r.length||(r=l.$optionsList.children(g?".picker-option:not(.picker-option-selected)":".picker-option").last()),r.length&&l.activeOption(r),t.preventDefault(),t.stopPropagation()}else"Escape"===e||27===e?l.hideDropList(!0):a.deleteByBackspace&&g&&("Backspace"===e||8===e)&&l.value&&l.value.length&&!w.val().length&&l.deselect(l.value[l.value.length-1])}}}),g){y.on("mousedown",function(t){if(!l.disabled)return l.dropListShowed&&!a.checkable?(t.preventDefault(),void t.stopPropagation()):void 0}).on("mouseup",function(e){l.disabled||y.hasClass("sortable-sorting")||t(e.target).closest(".picker-selection-remove").length||l.dropListShowed&&!a.checkable||l.focus()});var T=a.sortValuesByDnd;if(T&&t.fn.sortable){v.addClass("picker-sortable");var S={selector:".picker-selection",stopPropagation:!0,start:function(){l.hideDropList(!0)},finish:function(e){var i=[];t.each(e.list,function(t,e){i.push(e.item.data("value"))}),l.setValue(i.slice(),!1,!0)}};"object"==typeof T&&t.extend(S,T),y.sortable(S)}}if(y.on("click",".picker-selection-remove",function(e){if(!l.disabled){if(l.multi){var i=t(this).closest(".picker-selection");l.deselect(i.data("value"))}else l.deselect();e.stopPropagation()}}),d.on("chosen:updated",function(){l.updateFromSelect(!1),l.setValue(d.val(),!0),l.setDisabled(),l.updateList()}).on("chosen:activate",l.focus).on("chosen:open",l.showDropList).on("chosen:close",l.hideDropList),v.addClass("picker-ready"),t.zui.asap(function(){l.triggerEvent("ready",{picker:l},"","chosen:ready")}),!a.disableScrollOnShow){var D=a.hideOnScroll;D&&![e,i,!0].includes(D)&&t(D).on("scroll",this.handleParentScroll.bind(this))}};r.prototype.destroy=function(){var e=this,i=e.options;e.hideDropList(!0);var o=e.$search;o.off("focus blur input change"),i.hotkey&&o.off("keydown"),o.remove();var a=e.$selections;a.off("click"),e.multi&&a.off("mousedown mouseup"),a.remove();var s=e.$formItem;e.selectOptionsBackup&&(s.empty(),t.each(e.selectOptionsBackup,function(e,n){var o={value:n[i.valueKey]},a=n[i.keysKey];void 0!==a&&(o["data-"+i.keysKey]=a),s.append(t("
");i.$.addClass("load-indicator loading"),s.load(window.location.href+" #"+o,function(r){if(a===o)i.$.empty().html(s.children().html()),i.$.find('[data-ride="pager"]').pager();else{i.$.find("#"+o).empty().html(s.children().html());try{var l=t(r),c=l.find("#"+o).closest('[data-ride="table"],#'+a);if(c.length){var h=c.find(".table-statistic");h.length&&(i.defaultStatistic=h.html());var d=i.$.find('[data-ride="pager"]').data("zui.pager"),u=c.find('[data-ride="pager"]');d&&u.length&&d.set(u.data())}}catch(p){console.error(p)}}i.$.removeClass("load-indicator loading").trigger("beforeTableReload"),delete i.defaultStatistic,i.updateStatistic(),i.initModals(),i.$.datepickerAll();var f=i.$.find("tbody>tr"),g=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(f.filter('[data-id="'+t+'"]'),!0,!0),g=!0)}),g&&i.updateCheckUI(),n.nested&&i.initNestedList(),i.$.trigger("tableReload");var m=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");if(m.length){var u=i.$.find(".pager[data-rec-total]"),v=u.length?u.attr("data-rec-total"):i.getTable().find("tbody:first>tr:not(.table-children)").length;m.text(v)}e&&e(),n.afterReload&&n.afterReload()})},r.prototype.initModals=function(){var e=this,i=e.options,n=e.$.find(i.iframeModalTrigger);if(n.length){var o={type:"iframe",onHide:i.replaceId?function(){var n=t.cookie("selfClose");(1==n||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};n.modalTrigger(o)}},r.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e.data("zui.datatable")||window.initDatatable(e),e=t.find("div.datatable")),e},r.prototype.toggleGroups=function(e){var i=this,n={};i.$.find("tbody>tr").each(function(){var o=t(this).closest("tr").data("id");n[o]||i.toggleRowGroup(o,e)})},r.prototype.toggleRowGroup=function(i,n){var o=this.$.find('tbody>tr[data-id="'+i+'"]'),a=o.filter(".group-summary"),s=n===e?!a.hasClass("hidden"):!!n;o.not(".group-summary").toggleClass("hidden",!s),a.toggleClass("hidden",s),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},r.prototype.updateStatistic=function(){var i=this,n=i.$.find(".table-statistic");if(n.length){if(i.defaultStatistic===e&&(i.defaultStatistic=n.html()),i.options.statisticCreator)return void n.html(i.options.statisticCreator(i)||i.defaultStatistic);var o=i.statisticCols;if(!o&&o!==!1){o={};var a=!1;i.getTable().find("thead th").each(function(e){var i=t(this),n=i.data("statistic");n&&(a=!0,o[e]={format:n,name:i.text()})}),i.statisticCols=!!a&&o}var s=0;o&&t.each(o,function(t){o[t].total=0,o[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var e=t(this),i=e.hasClass("checked"),n=e.children("td");i&&s++,o&&t.each(o,function(t){var e=parseFloat(n.eq(t).text());isNaN(e)&&(e=0),o[t].total+=e,i&&(o[t].checkedTotal+=e)})});var r=[];if(s)r.push(i.lang.selectedItems.format(s));else if(i.defaultStatistic)return void n.html(i.defaultStatistic);o&&t.each(o,function(t){var e=o[t],n=e[s?"checkedTotal":"total"];e.format&&(n=e.format.format(n)),r.push(i.lang.attrTotal.format(e.name,n))}),n.html(r.join(", "))}},r.prototype.updateFixUI=function(e){var i=this,n=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||n-i.lastUpdateTime
').append(t('
').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),h){var d=c[0].getBoundingClientRect();l.css({left:d.left,width:c.width(),overflow:"hidden"}),l.find(".fixed-header-copy").css({left:o.left-d.left,position:"relative",minWidth:i.width()}),a||c.data("fixHeaderScroll")||(c.data("fixHeaderScroll",1),i.width()>c.width()&&c.on("scroll",function(){e.fixHeader()}))}else l.css({left:o.left,width:o.width});var u=l.find("th");n.find("th").each(function(e){u.eq(e).css("width",t(this).outerWidth())})}else l.remove()},r.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var a=n.find("tbody");if(!a.length)return;e=a[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r="function"==typeof s?s(e,o):e.bottom>window.innerHeight-50-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r);var l=t("body"),c=l.hasClass("body-modal");if(r){var h=n.parent(),d=h.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:d?h[0].getBoundingClientRect().left:e.left,width:d?h.width():e.width}),c&&l.css("padding-bottom",40)}else o.css({width:"",left:0,bottom:0}),c&&l.css("padding-bottom",0)},r.prototype.checkAll=function(e){var i=this,n=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},r.prototype.checkRow=function(i,n,o){var a=this,s=a.getTable();a.isDataTable&&!i.is(".datatable-row-left")&&(i=s.find('.datatable-row-left[data-index="'+i.data("index")+'"]'));var r=i.find('input[type="checkbox"]');if(r.length&&!r.is(":disabled")){n===e&&(n=!r.is(":checked")),a.isDataTable?s.find('.datatable-row[data-index="'+i.data("index")+'"]').toggleClass("checked",n):i.toggleClass("checked",n);var l=i.data("id");this.checkItems[l]=n,r.prop("checked",n).trigger("change"),o||(i.hasClass("table-parent")&&s.find((a.isDataTable?".fixed-left ":"")+"tbody>tr.parent-"+l).each(function(){a.checkRow(t(this),n,!0)}),a.updateCheckUI())}},r.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").not(".group-summary"),o=!1,a=null,s=0,r=!1,l=n.length;n.each(function(n){var c=t(this),h=c.find('input[type="checkbox"]');if(!h.length)return void l--;r=h.is(":checked");var d=e.isDataTable?i.find('.datatable-row[data-index="'+c.data("index")+'"]'):c;d.toggleClass("checked",r),d.toggleClass("row-check-begin",r&&!o),a&&a.toggleClass("row-check-end",!r&&o),r&&(s+=1),a=d,o=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange(),i.trigger("checkChange")},r.DEFAULTS={checkable:!0,checkOnClickRow:!0,ajaxForm:!1,selectable:!0,fixHeader:!a,fixFooter:!a,iframeWidth:900,replaceId:"self",nestLevelIndent:18,nested:!1,preserveNested:!0,hot:!1,iframeModalTrigger:".iframe:not(.disabled,[disabled])"},t.fn.table=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new r(this,a)),"string"==typeof e&&o[e]()})}, -r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){i=i||"show",t.zui.messager?(n.html=!0,e=e.replace(/\n/g,"
"),t.zui.messager[i](e,n)):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});"function"==typeof r&&(r={complete:r}),r=t.extend({},n,l.data(),r);var c=r.beforeSubmit,h=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if((c&&c(n,a,s))===!1)return!1;l.removeClass("form-watched").enableForm(!1);var r={},h=a.find('[type="file"]');r.fileapi=h.length&&h[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var c=r.responser?t(r.responser):l.find(".form-responser");c.length||(c=t("#responser"));var h=i.message,p=function(){var n=i.callback;if(n)if("object"==typeof n){var o=n.target?e[n.target]:e,a=o[n.name];a.apply(l,Array.isArray(n.params)?n.params:[n.params])}else{var s=n.indexOf("("),r=(s>0?n.substr(0,s):n).split("."),c=e,h=r[0];r.length>1&&(h=r[1],"top"===r[0]?c=e.top:"parent"===r[0]&&(c=e.parent));var a=c[h];if("function"==typeof a){var d=[];return s>0&&")"==n[n.length-1]&&(d=t.parseJSON("["+n.substring(s+1,n.length-1)+"]")),d.push(i),a.apply(l,d)}}};if("success"===i.result){var f=r.locate||i.locate,g=r.closeModal||i.closeModal,m=r.ajaxReload||i.ajaxReload;if(l.enableForm(!0,!!(f||g||m)),h){var v=l.find('[type="submit"]').first(),y=!1;v.length&&(v.popover({container:"body",trigger:"manual",content:h,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||v.data("placement")||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){v.popover("destroy")},r.popoverTime||2e3),y=!0),c.length&&(c.html(''+h+"").show().delay(3e3).fadeOut(100),y=!0),y||a(h,"success")}if(u)return u(i,!0,l);if(g&&setTimeout(t.zui.closeModal,"number"==typeof g?g:r.closeModalTime||2e3),p()===!1)return;if(f)if("loadInModal"==f){var b=t(".modal");setTimeout(function(){b.load(b.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else"parent"===f||"top"===f?e[f]&&setTimeout(function(){e[f].location.reload()},1200):"reload"===f?setTimeout(function(){e.location.href=e.location.href},1200):setTimeout(function(){t.apps?t.apps.open(f):e.location.href=f},1200);if(m){var w=t(m);w.length&&w.load(e.location.href+" "+m,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof h)c.length?c.html(''+h+"").show().delay(3e3).fadeOut(100):a(h,"danger");else if("object"==typeof h){var x=!1,C=[];t.each(h,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var c=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",c);var h=t("#"+e+"_chosen");if(h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){c()===!0&&t(this).removeClass("has-error")}),!x&&!o.data("datetimepicker")){var d=o[0];if(o.hasClass("chosen"))o.trigger("chosen:activate").trigger("chosen:open"),d=o.parent().find(".chosen-container")[0];else if(o.is("textarea")&&o.data("keditor")){var u=o.data("keditor");u.focus(),u.edit.doc.body.focus(),d=o.parent().find(".ke-container")[0]}else o.focus();d.scrollIntoView&&d.scrollIntoView(),x=!0}}),C.length&&a(C,"danger")}if(u)return u(i,!1,l);if(p()===!1)return}}},error:function(t,i,n){if((h&&h(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{finish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
'+(n.errorText||window.lang&&window.lang.timeout)+"
"),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=e.trim().split(" ");a.each(function(){var e=t(this),n=(e.text()+" "+(e.data("key")||e.data("filter")||"")).trim();e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active")),n.$.trigger("onSearchComplete",e)},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=(""===o.value||"0"===o.value)&&!o.label,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(c.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(e,n,o,a,s,r,l){if("object"==typeof e)return t.createLink(e.moduleName,e.methodName,e.vars,e.viewType,e.isOnlyBody,e.hash,e.tid);if(t.tabSession&&!l&&(l=t.tabSession.getTid()),a||(a=config.defaultView),s||(s=!1),o)for("string"==typeof o&&(o=o.split("&")),i=0;i'+d+"")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),c=s.find('[name="end"],.control-time-end'),h=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);c.find('option[value="'+i+'"]').length&&c.val(i),r.onChange&&r.onChange(c,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");c.find('option[value="'+u+'"]').length&&c.val(u),r.onChange&&r.onChange(c,u)}}else l.on("change",h),a(l,r.begin),a(c,r.end),s.data("timeSpanControlInit",!0);r.end||h()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,"")){var n=e.split("-");e=n[0];var o=n.length>1?n[1]:"testsuite"===e?"library":"view",a=t.createLink(e,o,"id="+i);t.apps?t.apps.open(a):window.location.href=a}else{var s={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||s[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(t){t?window.top.location.reload():window.location.reload()},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage(1)},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage(1)},t.zui.Picker&&(t.extend(t.zui.Picker.DEFAULTS,{optionRender:function(e,i,n){if("user"===n.options.type){var o=n.options.users;if(!o)return;var a=o[i.value];if(!a)return;if(e.find(".picker-option-text").text(a.realname||a.account),e.hasClass("picker-user-option"))return;return e.prepend(t('
').avatar({user:a})),a.deptName&&e.append(t('').text(a.deptName)),a.roleName&&e.append(t('').text(a.roleName)),e.addClass("picker-user-option")}},checkable:!0,maxListCount:500,disableScrollOnShow:!1}),t.zui.setUserPickerInfos=function(e){t.zui.Picker.DEFAULTS.users=t.extend({},t.zui.Picker.DEFAULTS.users,e)},t(function(){t(".picker-select[data-pickertype!='remote']").picker({chosenMode:!0}),t("[data-pickertype='remote']").each(function(){var e=t(this).attr("data-pickerremote");t(this).picker({chosenMode:!0,remote:e})}),window.pickerUsers&&t.zui.setUserPickerInfos(window.pickerUsers),t(".user-picker").picker({type:"user"})})),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;e.css("position","relative");var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+31+a>e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t.fn.chosen.Constructor=t.fn._chosen.Constructor,t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
{page}/{totalPage}
',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,c=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(c,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var h=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;c="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(c,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,h=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.is("[disabled],.disabled")&&!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var d,u,p,f,g,m=function(){d||(d=t("#subNavbar"),u=t("#pageNav"),p=t("#pageActions"),f=d.children(".nav"),g=f.outerWidth());var e=d.outerWidth(),i=u.outerWidth()||0,n=p.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void f.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,g),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),x()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])}),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var C=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){ -var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(C)},t(function(){t("textarea.autosize").each(C),t(document).on("input paste change","textarea.autosize",C)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var _="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=_,t("html").toggleClass("is-firefox",_).toggleClass("not-firefox",!_),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){var r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}).on("loaded.zui.modal",function(e){t("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var i=270,n=e.getBoundingClientRect();n.top<0&&(i=Math.min(270,n.height)+n.top),e.style.maxHeight=Math.min(270,i,t(window).height()-28)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),function(t){function e(){if(!config.skipRedirect&&!window.skipRedirect){var e=window.parent,i=config.currentModule,n=config.currentMethod;if("file"!==i||"download"!==n){var o="index"===i&&"index"===n,a="#_single"===location.hash||/(\?|\&)_single/.test(location.search)||o||!t("#mainHeader,#editorNav").length||"tutorial"===i||"install"===i||"upgrade"===i||"user"===i&&("login"===n||"deny"===n)||"my"===i&&"changepassword"===n||t("body").hasClass("allow-self-open"),s=location.href;if(e===window&&!a){var r=location.pathname+location.search+location.hash;return void(location.href=t.createLink("index","index","")+"#app="+encodeURIComponent(r))}if(e!==window&&e.$.apps){o&&e.location.reload();var l=window.name;if(0===l.indexOf("app-")){t.apps=window.apps=e.$.apps;var c=l.substring(4);t.appCode=c,t(document).on("click",function(t){var i=e.document.getElementById(window.name);if(i){var n=e.document.getElementById(i.name)||i;if(n){var o;"function"==typeof Event?o=new Event(t.type,{bubbles:!0}):(o=document.createEvent("Event"),o.initEvent(t.type,!0,!0)),n.dispatchEvent(o)}}}).on("click","a,.open-in-app,.show-in-app",function(e){var i=t(this);if(!i.is("[data-modal],[data-toggle],[data-ride],[data-tab],.iframe,.not-in-app,[target]")&&!i.data("zui.modaltrigger")){var n=i.hasClass("show-in-app")?"":i.attr("href")||(i.is("a")?"":i.data("url")),o=i.data("app")||i.data("group");if(n){if(0===n.indexOf("javascript:")||"#"===n[0])return;var a=t.parseLink(n);if(a.external||"file"===a.moduleName&&"download"===a.methodName)return;if("index"===a.moduleName&&"index"===a.methodName)return window.location.reload(),void e.preventDefault()}else if(!o)return;o||(o=t.apps.getAppCode(n)),o&&("help"===o&&(t.apps.appsMap.help.text=i.text(),t.apps.appsMap.help.url||(t.apps.appsMap.help.url=n)),t.apps.open(n,o)&&e.preventDefault())}}),t.apps.updateUrl(c,s,document.title)}}}}}function i(){var e=t("#navbar>.nav");if(e.length){var i=t("#heading"),n=+i.css("left").replace("px",""),o=i.outerWidth(),a=e.width(),s=t("#mainHeader>.container").width()-2*n,r=Math.floor((s-a)/2);e.css("marginLeft",r>>0;if(0===o)return!1;for(var a=0|e,s=Math.max(a>=0?a:o-Math.abs(a),0);s1&&("?"===e[0]&&(e=e.substr(1)),e.split("&").forEach(function(t){var e=t.split("=",2);if(e.length>1)try{i[e[0]]=decodeURIComponent(e[1])}catch(n){i[e[0]]=""}else i[e[0]]=""})),t?i[t]:i},t.parseLink=function(e){if(!e)return{};var i=0===e.indexOf("http:")||0===e.indexOf("https:");if(i){var n=window.location.origin;if(e.indexOf(n)<0)return{external:!0,url:e};e=e.substr((n+config.webRoot).length)}var o=e.split("#"),a=o[0].split("?"),s=a[1],r=s?t.getSearchParam("",s):{},l=a[0],c={url:e,isOnlyBody:"yes"===r.onlybody,vars:[],hash:o[1]||"",params:r,tid:r.tid||""};if("GET"===config.requestType){c.moduleName=r[config.moduleVar]||"index",c.methodName=r[config.methodVar]||"index",c.viewType=r[config.viewVar]||config.defaultView;for(var h in r)h!==config.moduleVar&&h!==config.methodVar&&h!==config.viewVar&&"onlybody"!==h&&"tid"!==h&&c.vars.push([h,r[h]])}else{var d=l.lastIndexOf("/");d===l.length-1&&(l=l.substr(0,d),d=l.lastIndexOf("/")),d>=0&&(l=l.substr(d+1));var u=l.lastIndexOf(".");u>=0?(c.viewType=l.substr(u+1),l=l.substr(0,u)):c.viewType=config.defaultView;var p=l.split(config.requestFix);if(c.moduleName=p[0]||"index",c.methodName=p[1]||"index",p.length>2)for(var f=2;f.nav>li").length>10&&(i(),t(window).on("resize",i)),setTimeout(n,1e3)})}(jQuery),function(t){"use strict";function e(e,i){"object"!=typeof i&&(i={user:i});var n=t(e);i=t.extend({},n.data(),i);var o=i.user;"string"==typeof o&&(o={account:o});var a={},s=i.size;s&&(a.width=s,a.height=s,a.lineHeight=s,Number.isNaN(+s)||n.addClass("size-"+s));var r=!!o.avatar;if(n.toggleClass("has-image",r).toggleClass("has-text",!r),n.empty(),r)n.append(t("").attr("src",o.avatar));else{var l=t.zui.strCode(o.account)*(i.hueDistance||43)%360;a.background="hsl("+l+","+(i.saturation||"40%")+","+(i.lightness||"60%")+")",Number.isNaN(+s)||(a.fontSize=Math.round(s/2)+"px");var c=o.name||o.realname||o.account;c=/^[\u4e00-\u9fa5\s]+$/.test(c)?c.length<=2?c:c.substring(c.length-2):/^[A-Za-z\d\s]+$/.test(c)?c[0].toUpperCase():c.length<=2?c:c.substring(0,2),n.append(t('').text(c))}return n.css(a)}t.fn.avatar=function(t){return this.each(function(){e(this,t)})}}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file +r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){i=i||"show",t.zui.messager?(n?n.html=!0:n={html:!0},e=e.toString().replace(/\n/g,"
"),t.zui.messager[i](e,n)):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});"function"==typeof r&&(r={complete:r}),r=t.extend({},n,l.data(),r);var c=r.beforeSubmit,h=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if((c&&c(n,a,s))===!1)return!1;l.removeClass("form-watched").enableForm(!1);var r={},h=a.find('[type="file"]');r.fileapi=h.length&&h[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var c=r.responser?t(r.responser):l.find(".form-responser");c.length||(c=t("#responser"));var h=i.message,p=function(){var n=i.callback;if(n)if("object"==typeof n){var o=n.target?e[n.target]:e,a=o[n.name];a.apply(l,Array.isArray(n.params)?n.params:[n.params])}else{var s=n.indexOf("("),r=(s>0?n.substr(0,s):n).split("."),c=e,h=r[0];r.length>1&&(h=r[1],"top"===r[0]?c=e.top:"parent"===r[0]&&(c=e.parent));var a=c[h];if("function"==typeof a){var d=[];return s>0&&")"==n[n.length-1]&&(d=t.parseJSON("["+n.substring(s+1,n.length-1)+"]")),d.push(i),a.apply(l,d)}}};if("success"===i.result){var f=r.locate||i.locate,g=r.closeModal||i.closeModal,m=r.ajaxReload||i.ajaxReload;if(l.enableForm(!0,!!(f||g||m)),h){var v=l.find('[type="submit"]').first(),y=!1;v.length&&(v.popover({container:"body",trigger:"manual",content:h,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||v.data("placement")||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){v.popover("destroy")},r.popoverTime||2e3),y=!0),c.length&&(c.html(''+h+"").show().delay(3e3).fadeOut(100),y=!0),y||a(h,"success")}if(u)return u(i,!0,l);if(g&&setTimeout(t.zui.closeModal,"number"==typeof g?g:r.closeModalTime||2e3),p()===!1)return;if(f)if("loadInModal"==f){var b=t(".modal");setTimeout(function(){b.load(b.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else"parent"===f||"top"===f?e[f]&&setTimeout(function(){e[f].location.reload()},1200):"reload"===f?setTimeout(function(){e.location.href=e.location.href},1200):setTimeout(function(){t.apps?t.apps.open(f):e.location.href=f},1200);if(m){var w=t(m);w.length&&w.load(e.location.href+" "+m,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof h)c.length?c.html(''+h+"").show().delay(3e3).fadeOut(100):a(h,"danger");else if("object"==typeof h){var x=!1,C=[];t.each(h,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var c=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",c);var h=t("#"+e+"_chosen");if(h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){c()===!0&&t(this).removeClass("has-error")}),!x&&!o.data("datetimepicker")){var d=o[0];if(o.hasClass("chosen"))o.trigger("chosen:activate").trigger("chosen:open"),d=o.parent().find(".chosen-container")[0];else if(o.is("textarea")&&o.data("keditor")){var u=o.data("keditor");u.focus(),u.edit.doc.body.focus(),d=o.parent().find(".ke-container")[0]}else o.focus();d.scrollIntoView&&d.scrollIntoView(),x=!0}}),C.length&&a(C.join(""),"danger")}if(u)return u(i,!1,l);if(p()===!1)return}}},error:function(t,i,n){if((h&&h(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{finish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
'+(n.errorText||window.lang&&window.lang.timeout)+"
"),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=e.trim().split(" ");a.each(function(){var e=t(this),n=(e.text()+" "+(e.data("key")||e.data("filter")||"")).trim();e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active")),n.$.trigger("onSearchComplete",e)},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=(""===o.value||"0"===o.value)&&!o.label,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(c.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(e,n,o,a,s,r,l){if("object"==typeof e)return t.createLink(e.moduleName,e.methodName,e.vars,e.viewType,e.isOnlyBody,e.hash,e.tid);if(t.tabSession&&!l&&(l=t.tabSession.getTid()),a||(a=config.defaultView),s||(s=!1),o)for("string"==typeof o&&(o=o.split("&")),i=0;i'+d+"")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),c=s.find('[name="end"],.control-time-end'),h=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);c.find('option[value="'+i+'"]').length&&c.val(i),r.onChange&&r.onChange(c,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");c.find('option[value="'+u+'"]').length&&c.val(u),r.onChange&&r.onChange(c,u)}}else l.on("change",h),a(l,r.begin),a(c,r.end),s.data("timeSpanControlInit",!0);r.end||h()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,"")){var n=e.split("-");e=n[0];var o=n.length>1?n[1]:"testsuite"===e?"library":"view",a=t.createLink(e,o,"id="+i);t.apps?t.apps.open(a):window.location.href=a}else{var s={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||s[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(t){t?window.top.location.reload():window.location.reload()},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage(1)},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage(1)},t.zui.Picker&&(t.extend(t.zui.Picker.DEFAULTS,{optionRender:function(e,i,n){if("user"===n.options.type){var o=n.options.users;if(!o)return;var a=o[i.value];if(!a)return;if(e.find(".picker-option-text").text(a.realname||a.account),e.hasClass("picker-user-option"))return;return e.prepend(t('
').avatar({user:a})),a.deptName&&e.append(t('').text(a.deptName)),a.roleName&&e.append(t('').text(a.roleName)),e.addClass("picker-user-option")}},checkable:!0,maxListCount:500,disableScrollOnShow:!1}),t.zui.setUserPickerInfos=function(e){t.zui.Picker.DEFAULTS.users=t.extend({},t.zui.Picker.DEFAULTS.users,e)},t(function(){t(".picker-select[data-pickertype!='remote']").picker({chosenMode:!0}),t("[data-pickertype='remote']").each(function(){var e=t(this).attr("data-pickerremote");t(this).picker({chosenMode:!0,remote:e})}),window.pickerUsers&&t.zui.setUserPickerInfos(window.pickerUsers),t(".user-picker").picker({type:"user"})})),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;e.css("position","relative");var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+31+a>e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t.fn.chosen.Constructor=t.fn._chosen.Constructor,t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
{page}/{totalPage}
',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,c=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(c,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var h=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;c="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(c,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,h=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.is("[disabled],.disabled")&&!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var d,u,p,f,g,m=function(){d||(d=t("#subNavbar"),u=t("#pageNav"),p=t("#pageActions"),f=d.children(".nav"),g=f.outerWidth());var e=d.outerWidth(),i=u.outerWidth()||0,n=p.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void f.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,g),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),x()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])}),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var C=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea"); +if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(C)},t(function(){t("textarea.autosize").each(C),t(document).on("input paste change","textarea.autosize",C)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var _="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=_,t("html").toggleClass("is-firefox",_).toggleClass("not-firefox",!_),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){var r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}).on("loaded.zui.modal",function(e){t("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var i=270,n=e.getBoundingClientRect();n.top<0&&(i=Math.min(270,n.height)+n.top),e.style.maxHeight=Math.min(270,i,t(window).height()-28)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),function(t){function e(){if(!config.skipRedirect&&!window.skipRedirect){var e=window.parent,i=config.currentModule,n=config.currentMethod;if("file"!==i||"download"!==n){var o="index"===i&&"index"===n,a="#_single"===location.hash||/(\?|\&)_single/.test(location.search)||o||!t("#mainHeader,#editorNav").length||"tutorial"===i||"install"===i||"upgrade"===i||"user"===i&&("login"===n||"deny"===n)||"my"===i&&"changepassword"===n||t("body").hasClass("allow-self-open"),s=location.href;if(e===window&&!a){var r=location.pathname+location.search+location.hash;return void(location.href=t.createLink("index","index","")+"#app="+encodeURIComponent(r))}if(e!==window&&e.$.apps){o&&e.location.reload();var l=window.name;if(0===l.indexOf("app-")){t.apps=window.apps=e.$.apps;var c=l.substring(4);t.appCode=c,t(document).on("click",function(t){var i=e.document.getElementById(window.name);if(i){var n=e.document.getElementById(i.name)||i;if(n){var o;"function"==typeof Event?o=new Event(t.type,{bubbles:!0}):(o=document.createEvent("Event"),o.initEvent(t.type,!0,!0)),n.dispatchEvent(o)}}}).on("click","a,.open-in-app,.show-in-app",function(e){var i=t(this);if(!i.is("[data-modal],[data-toggle],[data-ride],[data-tab],.iframe,.not-in-app,[target]")&&!i.data("zui.modaltrigger")){var n=i.hasClass("show-in-app")?"":i.attr("href")||(i.is("a")?"":i.data("url")),o=i.data("app")||i.data("group");if(n){if(0===n.indexOf("javascript:")||"#"===n[0])return;var a=t.parseLink(n);if(a.external||"file"===a.moduleName&&"download"===a.methodName)return;if("index"===a.moduleName&&"index"===a.methodName)return window.location.reload(),void e.preventDefault()}else if(!o)return;o||(o=t.apps.getAppCode(n)),o&&("help"===o&&(t.apps.appsMap.help.text=i.text(),t.apps.appsMap.help.url||(t.apps.appsMap.help.url=n)),t.apps.open(n,o)&&e.preventDefault())}}),t.apps.updateUrl(c,s,document.title)}}}}}function i(){var e=t("#navbar>.nav");if(e.length){var i=t("#heading"),n=+i.css("left").replace("px",""),o=i.outerWidth(),a=e.width(),s=t("#mainHeader>.container").width()-2*n,r=Math.floor((s-a)/2);e.css("marginLeft",r>>0;if(0===o)return!1;for(var a=0|e,s=Math.max(a>=0?a:o-Math.abs(a),0);s1&&("?"===e[0]&&(e=e.substr(1)),e.split("&").forEach(function(t){var e=t.split("=",2);if(e.length>1)try{i[e[0]]=decodeURIComponent(e[1])}catch(n){i[e[0]]=""}else i[e[0]]=""})),t?i[t]:i},t.parseLink=function(e){if(!e)return{};var i=0===e.indexOf("http:")||0===e.indexOf("https:");if(i){var n=window.location.origin;if(e.indexOf(n)<0)return{external:!0,url:e};e=e.substr((n+config.webRoot).length)}var o=e.split("#"),a=o[0].split("?"),s=a[1],r=s?t.getSearchParam("",s):{},l=a[0],c={url:e,isOnlyBody:"yes"===r.onlybody,vars:[],hash:o[1]||"",params:r,tid:r.tid||""};if("GET"===config.requestType){c.moduleName=r[config.moduleVar]||"index",c.methodName=r[config.methodVar]||"index",c.viewType=r[config.viewVar]||config.defaultView;for(var h in r)h!==config.moduleVar&&h!==config.methodVar&&h!==config.viewVar&&"onlybody"!==h&&"tid"!==h&&c.vars.push([h,r[h]])}else{var d=l.lastIndexOf("/");d===l.length-1&&(l=l.substr(0,d),d=l.lastIndexOf("/")),d>=0&&(l=l.substr(d+1));var u=l.lastIndexOf(".");u>=0?(c.viewType=l.substr(u+1),l=l.substr(0,u)):c.viewType=config.defaultView;var p=l.split(config.requestFix);if(c.moduleName=p[0]||"index",c.methodName=p[1]||"index",p.length>2)for(var f=2;f.nav>li").length>10&&(i(),t(window).on("resize",i)),setTimeout(n,1e3)})}(jQuery),function(t){"use strict";function e(e,i){"object"!=typeof i&&(i={user:i});var n=t(e);i=t.extend({},n.data(),i);var o=i.user;"string"==typeof o&&(o={account:o});var a={},s=i.size;s&&(a.width=s,a.height=s,a.lineHeight=s,Number.isNaN(+s)||n.addClass("size-"+s));var r=!!o.avatar;if(n.toggleClass("has-image",r).toggleClass("has-text",!r),n.empty(),r)n.append(t("").attr("src",o.avatar));else{var l=t.zui.strCode(o.account)*(i.hueDistance||43)%360;a.background="hsl("+l+","+(i.saturation||"40%")+","+(i.lightness||"60%")+")",Number.isNaN(+s)||(a.fontSize=Math.round(s/2)+"px");var c=o.name||o.realname||o.account;c=/^[\u4e00-\u9fa5\s]+$/.test(c)?c.length<=2?c:c.substring(c.length-2):/^[A-Za-z\d\s]+$/.test(c)?c[0].toUpperCase():c.length<=2?c:c.substring(0,2),n.append(t('').text(c))}return n.css(a)}t.fn.avatar=function(t){return this.each(function(){e(this,t)})}}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file From 0c420911a73a9e2cd640847945ec8e0aaeccaa6b Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Tue, 12 Jul 2022 08:02:28 +0000 Subject: [PATCH 0521/1178] * Finish task #60452. --- module/gitea/control.php | 1 + module/gitea/model.php | 21 +++++++- module/gitea/view/binduser.html.php | 83 +++++++++++++++++++++++++++++ module/gitea/view/browse.html.php | 3 +- 4 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 module/gitea/view/binduser.html.php diff --git a/module/gitea/control.php b/module/gitea/control.php index 2c6cc08a2a..56f80776f0 100644 --- a/module/gitea/control.php +++ b/module/gitea/control.php @@ -43,6 +43,7 @@ class gitea extends control /* Admin user don't need bind. */ $giteaList = $this->gitea->getList($orderBy, $pager); + $myGiteas = $this->gitea->getGiteaListByAccount(); foreach($giteaList as $gitea) { $gitea->isBindUser = true; diff --git a/module/gitea/model.php b/module/gitea/model.php index 6a9ad9ef99..216ea6d062 100644 --- a/module/gitea/model.php +++ b/module/gitea/model.php @@ -147,7 +147,7 @@ class giteaModel extends model ->andWhere('providerType')->eq($user->providerType) ->andWhere('providerID')->eq($user->providerID) ->exec(); - $this->loadModel('action')->create('giteauser', $openID, 'unbind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$existAccount->account]->realname)); + $this->loadModel('action')->create('giteauser', $giteaID, 'unbind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$existAccount->account]->realname)); } if(!$existAccount or $existAccount->account != $account) { @@ -155,7 +155,7 @@ class giteaModel extends model $user->account = $account; $user->openID = $openID; $this->dao->insert(TABLE_OAUTH)->data($user)->exec(); - $this->loadModel('action')->create('giteauser', $openID, 'bind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$account]->realname)); + $this->loadModel('action')->create('giteauser', $giteaID, 'bind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$account]->realname)); } } } @@ -296,6 +296,23 @@ class giteaModel extends model ->fetchPairs(); } + /** + * Get gitea user id by zentao account. + * + * @param int $giteaID + * @param string $zentaoAccount + * @access public + * @return array + */ + public function getUserIDByZentaoAccount($giteaID, $zentaoAccount) + { + return $this->dao->select('openID')->from(TABLE_OAUTH) + ->where('providerType')->eq('gitea') + ->andWhere('providerID')->eq($giteaID) + ->andWhere('account')->eq($zentaoAccount) + ->fetch('openID'); + } + /** * Get matched gitea users. * diff --git a/module/gitea/view/binduser.html.php b/module/gitea/view/binduser.html.php new file mode 100644 index 0000000000..83c2982d7c --- /dev/null +++ b/module/gitea/view/binduser.html.php @@ -0,0 +1,83 @@ + + * @package gitea + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+

gitea->bindUser;?>

+
+ +
+ + + + + + + + + + + zentaoAccount)) continue;?> + account]", $giteaUser->realname);?> + + + + + + + + + zentaoAccount)) continue;?> + account]", $giteaUser->realname);?> + + + + + + + + + + + + + +
gitea->giteaAccount;?>gitea->zentaoAccount;?>gitea->bindingStatus;?>
avatar, "height=40");?> + realname;?> +
+ account;?> + email) echo " <" . $giteaUser->email . ">";?> +
account]", $userPairs, '', "class='form-control select chosen'" );?>gitea->notBind;?>
avatar, "height=40");?> + realname;?> +
+ account;?> + email) echo " <" . $giteaUser->email . ">";?> +
account]", $userPairs, $giteaUser->zentaoAccount, "class='form-control select chosen'" );?> + zentaoAccount])):?> + zentaoAccount, '');?> + + gitea->binded;?> + + ' . $lang->gitea->bindedError . '';?> + + + gitea->notBind;?> + +
+ + goback, '', 'class="btn btn-wide"');?> +
+
+ +
+ diff --git a/module/gitea/view/browse.html.php b/module/gitea/view/browse.html.php index b92dd8cab0..fb02e955fc 100644 --- a/module/gitea/view/browse.html.php +++ b/module/gitea/view/browse.html.php @@ -55,9 +55,8 @@ url, $gitea->url, '_target');?> isBindUser ? true : false; common::printIcon('gitea', 'edit', "giteaID=$id", '', 'list', 'edit'); - echo common::buildIconButton('gitea', 'bindUser', "giteaID=$id", '', 'list', 'link', '', '', false, '', '', 0, $disabled); + echo common::buildIconButton('gitea', 'bindUser', "giteaID=$id", '', 'list', 'link', '', '', false, '', '', 0, $gitea->isBindUser); common::printIcon('gitea', 'delete', "giteaID=$id", '', 'list', 'trash', 'hiddenwin'); ?> From 513ef2652388d92061fa12c75394d82b17a1d0e3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 12 Jul 2022 16:08:37 +0800 Subject: [PATCH 0522/1178] * Adjust code. --- lib/scm/gitea.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scm/gitea.class.php b/lib/scm/gitea.class.php index 84b02072d3..bef1bc4748 100644 --- a/lib/scm/gitea.class.php +++ b/lib/scm/gitea.class.php @@ -34,7 +34,7 @@ class gitea public function ls($path, $revision = 'HEAD') { if(!scm::checkRevision($revision)) return array(); - $api = "contents"; + $api = "contents"; $param = new stdclass(); $param->path = ltrim($path, '/'); @@ -101,8 +101,8 @@ class gitea */ public function files($path, $ref = 'master') { - $path = urlencode($path); - $api = "contents/$path"; + $path = urlencode($path); + $api = "contents/$path"; $param = new stdclass(); $param->ref = $ref; $file = $this->fetch($api, $param); From b2b8da2e093564c59a1a90efc8b0c00312a4005f Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 12 Jul 2022 16:09:59 +0800 Subject: [PATCH 0523/1178] * Adjust code. --- lib/scm/scm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scm/scm.class.php b/lib/scm/scm.class.php index 9cbd9cb79a..4dc69b4236 100644 --- a/lib/scm/scm.class.php +++ b/lib/scm/scm.class.php @@ -251,7 +251,7 @@ class scm * @param string $branch * @param string $ext * @access public - * @return void + * @return string */ public function getDownloadUrl($branch = '', $ext = 'zip') { From 93a58b786ea66289b7f0df7e9848a444f4a3b8c2 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 12 Jul 2022 16:11:38 +0800 Subject: [PATCH 0524/1178] * Adjust code. --- module/repo/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/repo/control.php b/module/repo/control.php index 7d31cc353b..9f58f99ef2 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -1367,7 +1367,7 @@ class repo extends control } $repo = $this->repo->getRepoByID($repoID); - if(in_array($repo->SCM, array('Gitlab', 'Gitea'))) + if(in_array($repo->SCM, $this->config->repo->gitServiceList)) { $this->scm = $this->app->loadClass('scm'); $this->scm->setEngine($repo); From e8dc136b0ece007ec9ce4d5465d83f4dc886144c Mon Sep 17 00:00:00 2001 From: sunjun Date: Tue, 12 Jul 2022 08:14:48 +0000 Subject: [PATCH 0525/1178] sprint_60477 --- module/bug/control.php | 1 + module/projectrelease/view/view.html.php | 20 ++++++++++++++++---- module/release/view/view.html.php | 20 ++++++++++++++++---- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 594872a371..9dc2fb97dc 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2027,6 +2027,7 @@ class bug extends control */ public function batchClose() { + if($this->post->unlinkBugs) $this->post->bugIDList = $this->post->unlinkBugs; if($this->post->bugIDList) { $bugIDList = $this->post->bugIDList; diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index e7fd0c2722..e478f68b13 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -150,9 +150,10 @@
id}, \"bug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
-
id");?>" id='linkedBugsForm' data-ride="table"> + + id}&type=bug&link=$link¶m=$param&orderBy=%s";?> @@ -178,7 +179,7 @@ createLink('bug', 'view', "bugID=$bug->id", '', true);?>
- +
@@ -208,10 +209,21 @@