* adjust my-bug list.

* goto my-bug list from bug-view.
 * ajax get the detail of bug.
This commit is contained in:
chencongzhi520@gmail.com
2013-06-27 02:03:48 +00:00
parent 5368aaeec1
commit 273c5061b2
5 changed files with 27 additions and 53 deletions

View File

@@ -873,6 +873,19 @@ class bug extends control
die(html::select('assignedTo', $assignedToList, $selectedUser, 'class="select-3"'));
}
/**
* AJAX: get actions of a bug. for web app.
*
* @param int $bugID
* @access public
* @return void
*/
public function ajaxGetDetail($bugID)
{
$this->view->actions = $this->loadModel('action')->getList('bug', $bugID);
$this->display();
}
/**
* Send email.
*

View File

@@ -1,40 +1 @@
<?php
/**
* The view file of view method of todo module of ZenTaoPMS.
*
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package todo
* @version $Id: view.html.php 4642 2013-04-11 05:38:37Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/m.header.html.php';?>
</div>
<h3 class='title'><?php echo "Bug #$bug->id $bug->title"?></h3>
<div class='textContent'><?php echo $bug->steps;?></div>
<?php include '../../common/view/m.action.html.php';?>
<div data-role='footer' data-position='fixed'>
<div data-role='navbar'>
<ul>
<?php
if($this->session->bugList)
{
$browseLink = $this->session->bugList;
}
else
{
$browseLink = $this->createLink('my', 'bug');
}
common::printIcon('bug', 'confirmBug', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'assignTo', "bugID=$bug->id", '', 'button', '', '', 'iframe', true);
common::printIcon('bug', 'resolve', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'close', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'activate', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
echo '<li>' . html::a($browseLink, $lang->goback) . '</li>';
?>
</ul>
</div>
</div>
<?php include '../../common/view/m.footer.html.php';?>
<?php die(js::locate($this->createLink('my', 'bug', "type={$this->session->bugType}"), 'parent'));?>

View File

@@ -13,11 +13,13 @@
</ul>
</div>
</div>
<?php $this->session->set('bugType', $type);?>
<?php foreach($bugs as $bug):?>
<div data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="true">
<h1><?php echo $bug->title;?></h1>
<h1 onClick="showDetail('bug', <?php echo $bug->id;?>)"><?php echo $bug->title;?></h1>
<div><?php echo $bug->steps;?></div>
<div id='item<?php echo $bug->id;?>'></div>
<div data-role='navbar'>
<ul>
<?php
@@ -29,11 +31,11 @@
{
$browseLink = $this->createLink('my', 'bug');
}
common::printIcon('bug', 'confirmBug', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'assignTo', "bugID=$bug->id", '', 'button', '', '', 'iframe', true);
common::printIcon('bug', 'resolve', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'close', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'activate', "bugID=$bug->id", $bug, 'button', '', '', 'iframe', true);
common::printIcon('bug', 'confirmBug', "bugID=$bug->id", $bug, 'button', '', '', 'iframe');
common::printIcon('bug', 'assignTo', "bugID=$bug->id", '', 'button', '', '', 'iframe');
common::printIcon('bug', 'resolve', "bugID=$bug->id", $bug, 'button', '', '', 'iframe');
common::printIcon('bug', 'close', "bugID=$bug->id", $bug, 'button', '', '', 'iframe');
common::printIcon('bug', 'activate', "bugID=$bug->id", $bug, 'button', '', '', 'iframe');
?>
</ul>
</div>

View File

@@ -12,17 +12,11 @@
?>
<?php include '../../common/view/m.header.html.php';?>
</div>
<script>
function showDetail(storyID)
{
$.get(createLink('story', 'ajaxGetDetail', "storyID=" + storyID), function(data){$('#item' + storyID).html(data)})
}
</script>
<?php foreach($stories as $story):?>
<?php if($story->status == 'closed') continue;?>
<div data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="true">
<h1 onClick="showDetail(<?php echo $story->id; ?>)"><?php echo $story->title;?></h1>
<h1 onClick="showDetail('story', <?php echo $story->id;?>)"><?php echo $story->title;?></h1>
<div id='item<?php echo $story->id;?>'></div>
<div data-role='navbar'>

View File

@@ -198,6 +198,10 @@ function ajaxGetSearchForm()
}
}
function showDetail(objectType, objectID)
{
$.get(createLink(objectType, 'ajaxGetDetail', "objectID=" + objectID), function(data){$('#item' + objectID).html(data)});
}
/* Ping the server every some minutes to keep the session. */
needPing = true;