From 273c5061b2f6dcd18bd4e077ec176170e89dc847 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Thu, 27 Jun 2013 02:03:48 +0000 Subject: [PATCH] * adjust my-bug list. * goto my-bug list from bug-view. * ajax get the detail of bug. --- module/bug/control.php | 13 +++++++++ module/bug/view/m.view.html.php | 41 +-------------------------- module/my/view/m.bug.html.php | 14 +++++---- module/product/view/m.browse.html.php | 8 +----- www/js/m.my.full.js | 4 +++ 5 files changed, 27 insertions(+), 53 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 1f9bd29976..508ad21a6d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -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. * diff --git a/module/bug/view/m.view.html.php b/module/bug/view/m.view.html.php index b04a4d01cc..bb41973900 100755 --- a/module/bug/view/m.view.html.php +++ b/module/bug/view/m.view.html.php @@ -1,40 +1 @@ - - * @package todo - * @version $Id: view.html.php 4642 2013-04-11 05:38:37Z chencongzhi520@gmail.com $ - * @link http://www.zentao.net - */ -?> - - -

id $bug->title"?>

-
steps;?>
- -
-
-
    - 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 '
  • ' . html::a($browseLink, $lang->goback) . '
  • '; - ?> -
-
-
- +createLink('my', 'bug', "type={$this->session->bugType}"), 'parent'));?> diff --git a/module/my/view/m.bug.html.php b/module/my/view/m.bug.html.php index 462461373c..09e6bbc9ee 100755 --- a/module/my/view/m.bug.html.php +++ b/module/my/view/m.bug.html.php @@ -13,11 +13,13 @@ +session->set('bugType', $type);?>
-

title;?>

+

title;?>

steps;?>
+
    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'); ?>
diff --git a/module/product/view/m.browse.html.php b/module/product/view/m.browse.html.php index 114b99ddf1..c0ade7db0a 100755 --- a/module/product/view/m.browse.html.php +++ b/module/product/view/m.browse.html.php @@ -12,17 +12,11 @@ ?>
- status == 'closed') continue;?>
-

title;?>

+

title;?>

diff --git a/www/js/m.my.full.js b/www/js/m.my.full.js index 58b89a45be..6d2c9a39ad 100644 --- a/www/js/m.my.full.js +++ b/www/js/m.my.full.js @@ -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;