* Finish bug create page.
This commit is contained in:
@@ -99,12 +99,46 @@ function changeModule(event)
|
||||
loadProductStories(productID, storyID, executionID, moduleID);
|
||||
}
|
||||
|
||||
function clickRefresh(event)
|
||||
function changeRegion(event)
|
||||
{
|
||||
const regionID = $(event.target).val();
|
||||
const url = $.createLink('kanban', 'ajaxGetLanes', 'regionID=' + regionID + '&type=bug&field=lane');
|
||||
$.get(url, function(lane)
|
||||
{
|
||||
if(!lane) lane = "<select id='lane' name='lane' class='form-control'></select>";
|
||||
$('#lane').replaceWith(lane);
|
||||
});
|
||||
}
|
||||
|
||||
function changeContact(event)
|
||||
{
|
||||
const contactID = $(event.target).val();
|
||||
setMailto(contactID);
|
||||
}
|
||||
|
||||
function refreshModule(event)
|
||||
{
|
||||
const productID = $('#product').val();
|
||||
loadProductModules(productID);
|
||||
}
|
||||
|
||||
function refreshContact(event)
|
||||
{
|
||||
loadContacts();
|
||||
}
|
||||
|
||||
function refreshProductBuild(event)
|
||||
{
|
||||
const productID = $('#product').val();
|
||||
loadProductBuilds(productID);
|
||||
}
|
||||
|
||||
function refreshExecutionBuild(event)
|
||||
{
|
||||
const executionID = $('#execution').val();
|
||||
loadExecutionBuilds(executionID);
|
||||
}
|
||||
|
||||
function loadProductBranches(productID)
|
||||
{
|
||||
$('#branch').remove();
|
||||
@@ -295,6 +329,7 @@ function loadProductBuilds(productID, type = 'normal', buildBox = 'all')
|
||||
$.get(link, function(data)
|
||||
{
|
||||
$('#openedBuild').replaceWith(data);
|
||||
loadBuildActions();
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -328,6 +363,7 @@ function loadExecutionBuilds(executionID, num)
|
||||
let branch = $('#branch' + num).val();
|
||||
let productID = $('#product' + num).val();
|
||||
const oldOpenedBuild = $('#openedBuild' + num).val() ? $('#openedBuild' + num).val() : 0;
|
||||
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(typeof(productID) == 'undefined') productID = 0;
|
||||
|
||||
@@ -338,6 +374,7 @@ function loadExecutionBuilds(executionID, num)
|
||||
{
|
||||
$('#openedBuild').replaceWith(data);
|
||||
$('#openedBuild').val(oldOpenedBuild);
|
||||
loadBuildActions();
|
||||
})
|
||||
}
|
||||
else
|
||||
@@ -558,3 +595,60 @@ function setBranchRelated(event)
|
||||
$.ajaxSettings.async = true;
|
||||
}
|
||||
}
|
||||
|
||||
function loadBuildActions()
|
||||
{
|
||||
if(config.currentMethod == 'edit') return;
|
||||
$('#buildBoxActions').empty().hide();
|
||||
let itemCount = $('#openedBuild').find('option').length;
|
||||
if($('#openedBuild').attr('data-items') != undefined) itemCount = $('#openedBuild').attr('data-items');
|
||||
if(itemCount <= 1)
|
||||
{
|
||||
let html = '';
|
||||
if($('#execution').length == 0 || $('#execution').val() == 0)
|
||||
{
|
||||
let branch = $('#branch').val();
|
||||
let projectID = $('#project').val();
|
||||
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
if(typeof(projectID) == 'undefined') projectID = 0;
|
||||
|
||||
let link = $.createLink('release', 'create', 'productID=' + $('#product').val() + '&branch=' + branch);
|
||||
if(projectID > 0) link = $.createLink('projectrelease', 'create', 'projectID=' + projectID);
|
||||
|
||||
html += '<a href="' + link + '" data-toggle="modal" style="padding-right:5px">' + createRelease + '</a> ';
|
||||
html += '<a href="javascript:;" id="refreshProductBuild">' + refresh + '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
const executionID = $('#execution').val();
|
||||
const productID = $('#product').val();
|
||||
const projectID = $('#project').val();
|
||||
let link = $.createLink('build', 'create','executionID=' + executionID + '&productID=' + productID + '&projectID=' + projectID);
|
||||
link += link.indexOf('?') >= 0 ? '&onlybody=yes' : '?onlybody=yes';
|
||||
html += '<a href="' + link + '" data-toggle="modal" style="padding-right:5px">' + createBuild + '</a> ';
|
||||
html += '<a href="javascript:;" id="refreshExecutionBuild">' + refresh + '</a>';
|
||||
}
|
||||
$('#buildBoxActions').html(html).show();
|
||||
}
|
||||
}
|
||||
|
||||
function loadContacts()
|
||||
{
|
||||
const link = $.createLink('user', 'ajaxGetContactList', 'dropdownName=mailto');
|
||||
$.get(link, function(contacts)
|
||||
{
|
||||
if(!contacts) return false;
|
||||
$('#contactBox').html(contacts)
|
||||
});
|
||||
}
|
||||
|
||||
function setMailto(contactID)
|
||||
{
|
||||
const oldUsers = $('#mailto').val();
|
||||
const link = $.createLink('user', 'ajaxGetContactUsers', 'listID=' + contactID + '&dropdownName=mailto&oldUsers=' + oldUsers);
|
||||
$.get(link, function(users)
|
||||
{
|
||||
$('#mailto').replaceWith(users);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
$(function()
|
||||
{
|
||||
changeProductConfirmed = true;
|
||||
if(parseInt($('#execution').val()))
|
||||
{
|
||||
changeExecution();
|
||||
}
|
||||
else if(parseInt($('#project').val()))
|
||||
{
|
||||
const projectID = $('#project').val()
|
||||
loadProjectBuilds(projectID);
|
||||
loadAssignedToByProject(projectID);
|
||||
}
|
||||
else
|
||||
{
|
||||
const productID = $('#product').val();
|
||||
const moduleID = $('#module').val();
|
||||
const assignedTo = $('#assignedTo').val();
|
||||
if(!assignedTo) setTimeout(function(){loadAssignedToByModule(moduleID, productID)}, 500);
|
||||
}
|
||||
loadBuildActions();
|
||||
});
|
||||
|
||||
@@ -178,8 +178,7 @@ $lang->bug->lblAssignedTo = 'Bearbeiter';
|
||||
$lang->bug->lblMailto = 'Mail an';
|
||||
$lang->bug->lblLastEdited = 'Letzte Bearbeitung';
|
||||
$lang->bug->lblResolved = 'Gelöst von';
|
||||
$lang->bug->allUsers = 'Alle Benutzer laden';
|
||||
$lang->bug->allBuilds = 'Alle';
|
||||
$lang->bug->loadAll = 'Load All';
|
||||
$lang->bug->createBuild = 'Neu';
|
||||
|
||||
global $config;
|
||||
|
||||
@@ -178,8 +178,7 @@ $lang->bug->lblAssignedTo = 'AssignTo';
|
||||
$lang->bug->lblMailto = 'Mailto';
|
||||
$lang->bug->lblLastEdited = 'EditedBy';
|
||||
$lang->bug->lblResolved = 'ResolvedBy';
|
||||
$lang->bug->allUsers = 'Load All Users';
|
||||
$lang->bug->allBuilds = 'All Builds';
|
||||
$lang->bug->loadAll = 'Load All';
|
||||
$lang->bug->createBuild = 'New';
|
||||
|
||||
global $config;
|
||||
|
||||
@@ -178,8 +178,7 @@ $lang->bug->lblAssignedTo = 'Affecté à';
|
||||
$lang->bug->lblMailto = 'Mailto';
|
||||
$lang->bug->lblLastEdited = 'Edité par';
|
||||
$lang->bug->lblResolved = 'Résolu par';
|
||||
$lang->bug->allUsers = 'Charger Tous';
|
||||
$lang->bug->allBuilds = 'Tous les Builds';
|
||||
$lang->bug->loadAll = 'Load All';
|
||||
$lang->bug->createBuild = 'Nouveau';
|
||||
|
||||
global $config;
|
||||
|
||||
@@ -157,8 +157,7 @@ $lang->bug->lblAssignedTo = 'Giao cho';
|
||||
$lang->bug->lblMailto = 'Mail tới';
|
||||
$lang->bug->lblLastEdited = 'Sửa cuối';
|
||||
$lang->bug->lblResolved = 'Người giải quyết';
|
||||
$lang->bug->allUsers = 'Nạp tất cả người dùng';
|
||||
$lang->bug->allBuilds = 'Tất cả bản dựng';
|
||||
$lang->bug->loadAll = 'Load All';
|
||||
$lang->bug->createBuild = 'Mới';
|
||||
|
||||
/* Legend list。*/
|
||||
|
||||
@@ -178,8 +178,7 @@ $lang->bug->lblAssignedTo = '当前指派';
|
||||
$lang->bug->lblMailto = '抄送给';
|
||||
$lang->bug->lblLastEdited = '最后修改';
|
||||
$lang->bug->lblResolved = '由谁解决';
|
||||
$lang->bug->allUsers = '加载所有用户';
|
||||
$lang->bug->allBuilds = '所有';
|
||||
$lang->bug->loadAll = '加载所有';
|
||||
$lang->bug->createBuild = '创建';
|
||||
|
||||
global $config;
|
||||
|
||||
+113
-52
@@ -11,9 +11,11 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
jsVar('bug', $bug);
|
||||
jsVar('moduleID', $bug->moduleID);
|
||||
jsVar('tab', $this->app->tab);
|
||||
jsVar('bug', $bug);
|
||||
jsVar('moduleID', $bug->moduleID);
|
||||
jsVar('tab', $this->app->tab);
|
||||
jsVar('createRelease', $lang->release->create);
|
||||
jsVar('refresh', $lang->refreshIcon);
|
||||
|
||||
foreach(explode(',', $config->bug->create->requiredFields) as $field)
|
||||
{
|
||||
@@ -34,14 +36,20 @@ $showKeywords = strpos(",$showFields,", ',keywords,') !== false;
|
||||
|
||||
formPanel
|
||||
(
|
||||
on::change('#product', 'changeProduct'),
|
||||
on::change('#branch', 'changeBranch'),
|
||||
on::change('#project', 'changeProject'),
|
||||
on::change('#execution', 'changeExecution'),
|
||||
on::change('#module', 'changeModule'),
|
||||
on::click('#refresh', 'clickRefresh'),
|
||||
on::click('#allBuilds', 'loadAllBuilds'),
|
||||
on::click('#allUsers', 'loadAllUsers'),
|
||||
on::change('#product', 'changeProduct'),
|
||||
on::change('#branch', 'changeBranch'),
|
||||
on::change('#project', 'changeProject'),
|
||||
on::change('#execution', 'changeExecution'),
|
||||
on::change('#module', 'changeModule'),
|
||||
on::change('#region', 'changeRegion'),
|
||||
on::change('#contactListMenu', 'changeContact'),
|
||||
on::click('#allBuilds', 'loadAllBuilds'),
|
||||
on::click('#allUsers', 'loadAllUsers'),
|
||||
on::click('#refreshModule', 'refreshModule'),
|
||||
on::click('#refreshMailto', 'refreshContact'),
|
||||
on::click('#refreshExecutionBuild', 'refreshExecutionBuild'),
|
||||
on::click('#refreshProductBuild', 'refreshProductBuild'),
|
||||
set::title($lang->bug->create),
|
||||
to::headingActions(icon('cog-outline')),
|
||||
formRow
|
||||
(
|
||||
@@ -147,17 +155,24 @@ formPanel
|
||||
(
|
||||
set::multiple(true),
|
||||
set::name('openedBuild[]'),
|
||||
set('data-items', count($builds)),
|
||||
set::items($builds),
|
||||
set::value(empty($bug->buildID) ? '' : $bug->buildID)
|
||||
),
|
||||
span
|
||||
(
|
||||
set('id', 'buildBoxActions'),
|
||||
set('class', 'input-group-addon'),
|
||||
set('style', array('display' => 'none'))
|
||||
),
|
||||
span
|
||||
(
|
||||
set('class', 'input-group-addon'),
|
||||
a
|
||||
(
|
||||
set('id', 'allBuilds'),
|
||||
set('href', 'javascript:;'),
|
||||
$lang->bug->allBuilds
|
||||
$lang->bug->loadAll
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -181,44 +196,62 @@ formPanel
|
||||
(
|
||||
set('id', 'allUsers'),
|
||||
set('href', 'javascript:;'),
|
||||
$lang->bug->allUsers
|
||||
$lang->bug->loadAll
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
formRow
|
||||
(!empty($executionType) && $executionType == 'kanban') ? formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showDeadline ? '' : 'hidden'),
|
||||
set::label($lang->kanbancard->region),
|
||||
set::control('select'),
|
||||
set::name('region'),
|
||||
set::items($regionPairs),
|
||||
set::value($regionID)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::label($lang->kanbancard->lane),
|
||||
set::control('select'),
|
||||
set::name('lane'),
|
||||
set::items($lanePairs),
|
||||
set::value($laneID)
|
||||
),
|
||||
) : null,
|
||||
($showDeadline || $showNoticefeedbackBy) ? formRow
|
||||
(
|
||||
$showDeadline ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::label($lang->bug->deadline),
|
||||
datePicker
|
||||
(
|
||||
set::name('deadline'),
|
||||
set::value($bug->deadline)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
) : null,
|
||||
$showNoticefeedbackBy ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showNoticefeedbackBy ? '' : 'hidden'),
|
||||
set::label($lang->bug->feedbackBy),
|
||||
set::name('feedbackBy'),
|
||||
set::value(isset($bug->feedbackBy) ? $bug->feedbackBy : '')
|
||||
)
|
||||
),
|
||||
) : null,
|
||||
) : null,
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
$showNoticefeedbackBy ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showNoticefeedbackBy ? '' : 'hidden'),
|
||||
set::label($lang->bug->notifyEmail),
|
||||
set::name('notifyEmail'),
|
||||
set::value($bug->notifyEmail)
|
||||
),
|
||||
) : null,
|
||||
formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
@@ -230,24 +263,22 @@ formPanel
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
$showOS ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showOS ? '' : 'hidden'),
|
||||
set::label($lang->bug->os),
|
||||
set::control(array('type' => 'select', 'items' => $lang->bug->osList, 'multiple' => true)),
|
||||
set::name('os[]'),
|
||||
set::value($bug->os)
|
||||
),
|
||||
formGroup
|
||||
) : null,
|
||||
$showBrowser ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showOS ? '' : 'hidden'),
|
||||
set::label($lang->bug->browser),
|
||||
set::control(array('type' => 'select', 'items' => $lang->bug->browserList)),
|
||||
set::name('browser'),
|
||||
set::value($bug->browser)
|
||||
)
|
||||
) : null
|
||||
),
|
||||
formRow
|
||||
(
|
||||
@@ -260,21 +291,19 @@ formPanel
|
||||
formGroup
|
||||
(
|
||||
set::width('180px'),
|
||||
set::class($showSeverity ? '' : 'hidden'),
|
||||
set::label($lang->bug->severity),
|
||||
set::control(array('type' => 'select', 'items' => $lang->bug->severityList)),
|
||||
set::name('severity'),
|
||||
set::value($bug->severity)
|
||||
),
|
||||
formGroup
|
||||
$showPri ? formGroup
|
||||
(
|
||||
set::width('180px'),
|
||||
set::class($showPri ? '' : 'hidden'),
|
||||
set::label($lang->bug->pri),
|
||||
set::control(array('type' => 'select', 'items' => $lang->bug->priList)),
|
||||
set::name('pri'),
|
||||
set::value($bug->pri)
|
||||
)
|
||||
) : null
|
||||
),
|
||||
formRow
|
||||
(
|
||||
@@ -288,12 +317,11 @@ formPanel
|
||||
)
|
||||
),
|
||||
),
|
||||
formRow
|
||||
($showStory || $showTask) ? formRow
|
||||
(
|
||||
formGroup
|
||||
$showStory ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showStory ? '' : 'hidden'),
|
||||
set::label($lang->bug->story),
|
||||
inputGroup
|
||||
(
|
||||
@@ -305,37 +333,70 @@ formPanel
|
||||
set::value($bug->storyID)
|
||||
)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
) : null,
|
||||
$showTask ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showTask ? '' : 'hidden'),
|
||||
set::label($lang->bug->task),
|
||||
set::control(array('type' => 'select', 'items' => '')),
|
||||
set::name('task'),
|
||||
set::value($bug->taskID)
|
||||
)
|
||||
),
|
||||
formRow
|
||||
) : null
|
||||
) : null,
|
||||
($showMailto || $showKeywords) ? formRow
|
||||
(
|
||||
formGroup
|
||||
$showMailto ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showMailto ? '' : 'hidden'),
|
||||
set::label($lang->bug->lblMailto),
|
||||
set::control(array('type' => 'select', 'items' => $users, 'multiple' => true)),
|
||||
set::name('mailto[]'),
|
||||
set::value($bug->mailto ? str_replace(' ', '', $bug->mailto) : '')
|
||||
),
|
||||
formGroup
|
||||
inputGroup
|
||||
(
|
||||
select
|
||||
(
|
||||
set::multiple(true),
|
||||
set::name('mailto[]'),
|
||||
set::items($users),
|
||||
set::value($bug->mailto ? str_replace(' ', '', $bug->mailto) : '')
|
||||
),
|
||||
span
|
||||
(
|
||||
set('id', 'contactBox'),
|
||||
set('class', 'input-group-addon'),
|
||||
$contactList ? select
|
||||
(
|
||||
set::class('width', 'w-20'),
|
||||
set::name('contactListMenu'),
|
||||
set::items($contactList),
|
||||
set::value()
|
||||
) : a
|
||||
(
|
||||
set('href', createLink('my', 'managecontacts', 'listID=0&mode=new')),
|
||||
set('title', $lang->user->contacts->manage),
|
||||
set('data-toggle', 'modal'),
|
||||
icon('cog'),
|
||||
)
|
||||
),
|
||||
span
|
||||
(
|
||||
set('class', 'input-group-addon'),
|
||||
a
|
||||
(
|
||||
set('id', 'refreshMailto'),
|
||||
set('class', 'text-black'),
|
||||
set('href', 'javascript:void(0)'),
|
||||
icon('refresh')
|
||||
)
|
||||
)
|
||||
)
|
||||
) : null,
|
||||
$showKeywords ? formGroup
|
||||
(
|
||||
set::width('1/2'),
|
||||
set::class($showKeywords ? '' : 'hidden'),
|
||||
set::label($lang->bug->keywords),
|
||||
set::name('keywords'),
|
||||
set::value($bug->keywords)
|
||||
)
|
||||
),
|
||||
) : null
|
||||
) : null,
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
|
||||
@@ -187,7 +187,7 @@ panel
|
||||
(
|
||||
set('id', 'allUsers'),
|
||||
set('href', 'javascript:;'),
|
||||
$lang->bug->allUsers
|
||||
$lang->bug->loadAll
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -323,7 +323,7 @@ panel
|
||||
(
|
||||
set('id', 'allBuilds'),
|
||||
set('href', 'javascript:;'),
|
||||
$lang->bug->allBuilds
|
||||
$lang->bug->loadAll
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -364,7 +364,7 @@ panel
|
||||
(
|
||||
set('id', 'allBuilds'),
|
||||
set('href', 'javascript:;'),
|
||||
$lang->bug->allBuilds
|
||||
$lang->bug->loadAll
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1158,6 +1158,7 @@ class bugZen extends bug
|
||||
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($bug->productID, $bug->branch);
|
||||
$this->view->resultFiles = (!empty($resultID) and !empty($stepIdList)) ? $this->loadModel('file')->getByObject('stepResult', $resultID, str_replace('_', ',', $stepIdList)) : array();
|
||||
$this->view->product = $currentProduct;
|
||||
$this->view->contactList = $this->loadModel('user')->getContactLists($this->app->user->account, 'withnote');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -588,7 +588,7 @@ class tree extends control
|
||||
$output .= "<span class='input-group-addon'>";
|
||||
$output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch", '', true), $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
$output .= ' ';
|
||||
$output .= html::a("javascript:void(0)", $this->lang->refreshIcon, '', "class='refresh' onclick='loadProductModules($rootID)'");
|
||||
$output .= html::a("javascript:void(0)", $this->lang->refreshIcon, '', "id='refreshModule' class='refresh' onclick='loadProductModules($rootID)'");
|
||||
$output .= '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user