* adjus for todo to story and bug.

This commit is contained in:
wangyidong
2018-01-16 10:25:51 +08:00
parent d49cc7d23f
commit 5dddac711b
7 changed files with 72 additions and 10 deletions

View File

@@ -157,8 +157,8 @@ $lang->bug->confirmDeleteTemplate = '您确认要删除该模板吗?';
/* 模板。*/
$lang->bug->tplStep = "<p>[步骤]</p>";
$lang->bug->tplResult = "</br><p>[结果]</p>";
$lang->bug->tplExpect = "</br><p>[期望]</p>";
$lang->bug->tplResult = "<p>[结果]</p>";
$lang->bug->tplExpect = "<p>[期望]</p>";
/* 各个字段取值列表。*/
$lang->bug->severityList[3] = '3';

View File

@@ -157,8 +157,8 @@ $lang->bug->confirmDeleteTemplate = '您確認要刪除該模板嗎?';
/* 模板。*/
$lang->bug->tplStep = "<p>[步驟]</p>";
$lang->bug->tplResult = "</br><p>[結果]</p>";
$lang->bug->tplExpect = "</br><p>[期望]</p>";
$lang->bug->tplResult = "<p>[結果]</p>";
$lang->bug->tplExpect = "<p>[期望]</p>";
/* 各個欄位取值列表。*/
$lang->bug->severityList[3] = '3';

View File

@@ -16,7 +16,7 @@ class devModel extends model
foreach($datatables as $table)
{
$table = current($table);
if(strpos($table, $this->config->db->prefix) !== false)
if(empty($this->config->db->prefix) or strpos($table, $this->config->db->prefix) !== false)
{
$subTable = substr($table, strpos($table, '_') + 1);
$group = zget($this->config->dev->group, $subTable, 'other');

View File

@@ -333,6 +333,7 @@ class todo extends control
$this->view->actions = $this->loadModel('action')->getList('todo', $todoID);
$this->view->from = $from;
$this->view->projects = $this->loadModel('project')->getPairs();
$this->view->products = $this->loadModel('product')->getPairs();
$this->display();
}

View File

@@ -1,5 +1,17 @@
$(function()
{
$('#toStoryLink').click(function()
{
$('#productModal .modal-body .input-group .input-group-btn').addClass('hidden');
$('#productModal #toStoryButton').closest('.input-group-btn').removeClass('hidden');
})
$('#toBugLink').click(function()
{
$('#productModal .modal-body .input-group .input-group-btn').addClass('hidden');
$('#productModal #toBugButton').closest('.input-group-btn').removeClass('hidden');
})
$('#toTaskButton').click(function()
{
var onlybody = config.onlybody;
@@ -10,6 +22,29 @@ $(function()
config.onlybody = onlybody;
parent.location.href = link;
})
$('#toStoryButton').click(function()
{
var onlybody = config.onlybody;
config.onlybody = 'no';
var productID = $(this).closest('.input-group').find('#product').val();
var link = createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&projectID=0&bugID=0&planID=0&todoID=' + todoID);
config.onlybody = onlybody;
parent.location.href = link;
})
$('#toBugButton').click(function()
{
var onlybody = config.onlybody;
config.onlybody = 'no';
var productID = $(this).closest('.input-group').find('#product').val();
var link = createLink('bug', 'create', 'productID=' + productID + '&branch=0&extras=todoID=' + todoID);
config.onlybody = onlybody;
parent.location.href = link;
})
});

View File

@@ -56,7 +56,7 @@
</tr>
<tr>
<th class='w-80px'><?php echo $lang->todo->account;?></th>
<td><?php echo $todo->account;?></td>
<td><?php echo zget($users, $todo->account);?></td>
</tr>
<tr>
<th class='w-80px'><?php echo $lang->todo->date;?></th>
@@ -143,9 +143,9 @@
unset($_GET['onlybody']);
echo "<button type='button' class='btn btn-success dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
echo "<ul class='dropdown-menu pull-right' role='menu'>";
if($createStoryPriv) echo '<li>' . html::a($this->createLink('story', 'create', "productID=0&branch=0&moduleID=0&storyID=0&projectID=0&bugID=0&planID=0&todoID={$todo->id}"), $lang->todo->reasonList['story'], '_parent') . '</li>';
if($createTaskPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['task'], '', "data-toggle='modal' data-target='#projectModal' data-moveable='true' data-position='193px'") . '</li>';
if($createBugPriv) echo '<li>' . html::a($this->createLink('bug', 'create', "productID=0&branch=0&extras=todoID={$todo->id}"), $lang->todo->reasonList['bug'], '_parent') . '</li>';
if($createStoryPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['story'], '', "data-toggle='modal' data-target='#productModal' data-moveable='true' data-position='193px' id='toStoryLink'") . '</li>';
if($createTaskPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['task'], '', "data-toggle='modal' data-target='#projectModal' data-moveable='true' data-position='193px' id='toTaskLink'") . '</li>';
if($createBugPriv) echo '<li>' . html::a('###', $lang->todo->reasonList['bug'], '', "data-toggle='modal' data-target='#productModal' data-moveable='true' data-position='193px' id='toBugLink'") . '</li>';
echo "</ul>";
if($isonlybody) $_GET['onlybody'] = 'yes';
}
@@ -179,6 +179,23 @@
</div>
</div>
</div>
<div class="modal fade" id="productModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><i class="icon-file-text"></i> <?php echo $lang->product->select;?></h4>
</div>
<div class="modal-body">
<div class='input-group'>
<?php echo html::select('product', $products, '', "class='form-control chosen'");?>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['story'], "id='toStoryButton'");?></span>
<span class='input-group-btn'><?php echo html::commonButton($lang->todo->reasonList['bug'], "id='toBugButton'");?></span>
</div>
</div>
</div>
</div>
</div>
<?php js::set('todoID', $todo->id);?>
<?php else:?>
<?php echo $lang->todo->thisIsPrivate;?>

View File

@@ -15,7 +15,16 @@ function createLink(moduleName, methodName, vars, viewType, isOnlyBody)
if(vars)
{
vars = vars.split('&');
for(i = 0; i < vars.length; i ++) vars[i] = vars[i].split('=');
for(i = 0; i < vars.length; i ++)
{
splited = vars[i].split('=');
var newvars = new Array()
newvars[0] = splited.shift();
newvars[1] = splited.join('=');
vars[i] = newvars;
}
}
if(config.requestType != 'GET')
{