From 38389eb15ec191c031ba7b72c8a16b1f6032a115 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Sun, 2 May 2010 15:32:06 +0000 Subject: [PATCH] * change the copyright, email and website. --- trunk/bin/ztcli | 138 +- trunk/config/config.php | 218 +-- trunk/doc/README | 2 +- trunk/lib/front/front.class.php | 6 +- trunk/lib/front/tests/html_checkbox.php | 62 +- trunk/lib/front/tests/html_radio.php | 58 +- trunk/lib/front/tests/html_select.php | 68 +- trunk/lib/front/tests/html_selectgroup.php | 52 +- trunk/module/action/control.php | 126 +- trunk/module/action/lang/en.php | 94 +- trunk/module/action/lang/zh-cn.php | 198 +-- trunk/module/action/model.php | 472 +++---- trunk/module/action/view/trash.html.php | 112 +- trunk/module/admin/control.php | 62 +- trunk/module/admin/lang/en.php | 66 +- trunk/module/admin/lang/zh-cn.php | 62 +- trunk/module/admin/model.php | 88 +- .../module/admin/view/browsecompany.html.php | 122 +- trunk/module/api/control.php | 86 +- trunk/module/api/lang/zh-cn.php | 50 +- trunk/module/bug/control.php | 1070 +++++++------- trunk/module/bug/lang/en.php | 338 ++--- trunk/module/bug/lang/zh-cn.php | 542 ++++---- trunk/module/bug/model.php | 868 ++++++------ trunk/module/bug/view/activate.html.php | 6 +- trunk/module/bug/view/browse.html.php | 298 ++-- trunk/module/bug/view/close.html.php | 6 +- trunk/module/bug/view/create.html.php | 384 ++--- trunk/module/bug/view/edit.html.php | 6 +- trunk/module/bug/view/index.html.php | 54 +- trunk/module/bug/view/report.html.php | 154 +- trunk/module/bug/view/resolve.html.php | 6 +- trunk/module/bug/view/sendmail.html.php | 6 +- trunk/module/bug/view/view.html.php | 6 +- trunk/module/build/control.php | 244 ++-- trunk/module/build/lang/en.php | 84 +- trunk/module/build/lang/zh-cn.php | 84 +- trunk/module/build/model.php | 232 ++-- trunk/module/build/view/create.html.php | 126 +- trunk/module/build/view/edit.html.php | 126 +- trunk/module/build/view/view.html.php | 144 +- trunk/module/common/control.php | 944 ++++++------- trunk/module/common/lang/en.php | 382 ++--- trunk/module/common/lang/zh-cn.php | 506 +++---- trunk/module/common/view/footer.html.php | 34 +- trunk/module/company/control.php | 236 ++-- trunk/module/company/lang/en.php | 98 +- trunk/module/company/lang/zh-cn.php | 100 +- trunk/module/company/model.php | 194 +-- trunk/module/company/view/browse.html.php | 178 +-- trunk/module/company/view/create.html.php | 140 +- trunk/module/company/view/edit.html.php | 140 +- trunk/module/convert/control.php | 248 ++-- trunk/module/convert/converter/bugfree.php | 138 +- trunk/module/convert/converter/bugfree1.php | 578 ++++---- trunk/module/convert/converter/bugfree2.php | 916 ++++++------ trunk/module/convert/lang/en.php | 154 +- trunk/module/convert/lang/zh-cn.php | 158 +-- trunk/module/convert/model.php | 158 +-- .../module/convert/view/checkconfig.html.php | 84 +- trunk/module/convert/view/execute.html.php | 64 +- trunk/module/convert/view/index.html.php | 64 +- .../module/convert/view/selectsource.html.php | 90 +- trunk/module/convert/view/setconfig.html.php | 74 +- trunk/module/dept/control.php | 198 +-- trunk/module/dept/lang/en.php | 70 +- trunk/module/dept/lang/zh-cn.php | 70 +- trunk/module/dept/model.php | 468 +++---- trunk/module/dept/view/browse.html.php | 160 +-- trunk/module/dept/view/create.html.php | 102 +- trunk/module/dept/view/edit.html.php | 104 +- trunk/module/file/control.php | 110 +- trunk/module/file/lang/en.php | 50 +- trunk/module/file/lang/zh-cn.php | 54 +- trunk/module/file/model.php | 298 ++-- trunk/module/group/control.php | 330 ++--- trunk/module/group/lang/en.php | 404 +++--- trunk/module/group/lang/zh-cn.php | 490 +++---- trunk/module/group/model.php | 322 ++--- trunk/module/group/view/browse.html.php | 112 +- trunk/module/group/view/copy.html.php | 92 +- trunk/module/group/view/create.html.php | 84 +- trunk/module/group/view/edit.html.php | 84 +- trunk/module/group/view/index.html.php | 116 +- trunk/module/group/view/managemember.html.php | 76 +- trunk/module/group/view/managepriv.html.php | 140 +- trunk/module/index/control.php | 128 +- trunk/module/index/lang/en.php | 60 +- trunk/module/index/lang/zh-cn.php | 60 +- trunk/module/index/model.php | 72 +- trunk/module/index/view/index.html.php | 150 +- trunk/module/install/control.php | 262 ++-- trunk/module/install/lang/en.php | 198 +-- trunk/module/install/lang/zh-cn.php | 214 +-- trunk/module/install/model.php | 498 +++---- trunk/module/install/view/footer.html.php | 34 +- trunk/module/install/view/index.html.php | 90 +- trunk/module/install/view/step1.html.php | 208 +-- trunk/module/install/view/step2.html.php | 142 +- trunk/module/install/view/step3.html.php | 170 +-- trunk/module/install/view/step4.html.php | 130 +- trunk/module/mail/model.php | 346 ++--- trunk/module/misc/control.php | 88 +- trunk/module/misc/lang/zh-cn.php | 138 +- trunk/module/misc/model.php | 56 +- trunk/module/my/control.php | 304 ++-- trunk/module/my/model.php | 66 +- trunk/module/my/view/bug.html.php | 132 +- trunk/module/my/view/editprofile.html.php | 120 +- trunk/module/my/view/profile.html.php | 144 +- trunk/module/my/view/project.html.php | 120 +- trunk/module/my/view/story.html.php | 138 +- trunk/module/my/view/task.html.php | 122 +- trunk/module/my/view/team.html.php | 52 +- trunk/module/my/view/todo.html.php | 208 +-- trunk/module/product/control.php | 446 +++--- trunk/module/product/lang/en.php | 110 +- trunk/module/product/lang/zh-cn.php | 120 +- trunk/module/product/model.php | 298 ++-- trunk/module/product/view/browse.html.php | 272 ++-- trunk/module/product/view/create.html.php | 100 +- trunk/module/product/view/edit.html.php | 100 +- trunk/module/product/view/roadmap.html.php | 126 +- trunk/module/product/view/view.html.php | 118 +- trunk/module/productplan/control.php | 302 ++-- trunk/module/productplan/lang/en.php | 88 +- trunk/module/productplan/lang/zh-cn.php | 88 +- trunk/module/productplan/model.php | 192 +-- trunk/module/productplan/view/browse.html.php | 126 +- trunk/module/productplan/view/create.html.php | 126 +- trunk/module/productplan/view/edit.html.php | 126 +- .../productplan/view/linkstory.html.php | 206 +-- trunk/module/productplan/view/view.html.php | 186 +-- trunk/module/project/control.php | 1234 ++++++++--------- trunk/module/project/lang/en.php | 204 +-- trunk/module/project/lang/zh-cn.php | 258 ++-- trunk/module/project/model.php | 902 ++++++------ trunk/module/project/view/browse.html.php | 332 ++--- trunk/module/project/view/bug.html.php | 144 +- trunk/module/project/view/build.html.php | 128 +- trunk/module/project/view/burn.html.php | 56 +- trunk/module/project/view/create.html.php | 160 +-- trunk/module/project/view/edit.html.php | 164 +-- trunk/module/project/view/grouptask.html.php | 144 +- trunk/module/project/view/importtask.html.php | 146 +- trunk/module/project/view/index.html.php | 268 ++-- trunk/module/project/view/linkstory.html.php | 130 +- .../module/project/view/managechilds.html.php | 82 +- .../project/view/managemembers.html.php | 138 +- .../project/view/manageproducts.html.php | 76 +- trunk/module/project/view/story.html.php | 184 +-- trunk/module/project/view/task.html.php | 200 +-- trunk/module/project/view/team.html.php | 122 +- trunk/module/project/view/view.html.php | 180 +-- trunk/module/qa/control.php | 60 +- trunk/module/qa/lang/en.php | 50 +- trunk/module/qa/lang/zh-cn.php | 50 +- trunk/module/qa/view/index.html.php | 56 +- trunk/module/release/control.php | 242 ++-- trunk/module/release/lang/en.php | 76 +- trunk/module/release/lang/zh-cn.php | 76 +- trunk/module/release/model.php | 152 +- trunk/module/release/view/browse.html.php | 120 +- trunk/module/release/view/create.html.php | 104 +- trunk/module/release/view/edit.html.php | 106 +- trunk/module/release/view/view.html.php | 126 +- trunk/module/report/control.php | 52 +- trunk/module/report/lang/en.php | 48 +- trunk/module/report/lang/zh-cn.php | 82 +- trunk/module/report/model.php | 228 +-- trunk/module/search/control.php | 86 +- trunk/module/search/lang/en.php | 86 +- trunk/module/search/lang/zh-cn.php | 90 +- trunk/module/search/model.php | 256 ++-- trunk/module/search/view/buildform.html.php | 376 ++--- trunk/module/setting/model.php | 92 +- trunk/module/story/control.php | 784 +++++------ trunk/module/story/lang/en.php | 272 ++-- trunk/module/story/lang/zh-cn.php | 312 ++--- trunk/module/story/model.php | 1100 +++++++-------- trunk/module/story/view/activate.html.php | 100 +- trunk/module/story/view/change.html.php | 122 +- trunk/module/story/view/close.html.php | 6 +- trunk/module/story/view/create.html.php | 156 +-- trunk/module/story/view/edit.html.php | 304 ++-- trunk/module/story/view/review.html.php | 6 +- trunk/module/story/view/sendmail.html.php | 6 +- trunk/module/story/view/view.html.php | 6 +- trunk/module/task/control.php | 448 +++--- trunk/module/task/lang/en.php | 164 +-- trunk/module/task/lang/zh-cn.php | 200 +-- trunk/module/task/model.php | 492 +++---- trunk/module/task/view/browse.html.php | 96 +- trunk/module/task/view/create.html.php | 242 ++-- trunk/module/task/view/edit.html.php | 224 +-- trunk/module/task/view/import.html.php | 144 +- trunk/module/task/view/view.html.php | 6 +- trunk/module/testcase/control.php | 488 +++---- trunk/module/testcase/lang/en.php | 222 +-- trunk/module/testcase/lang/zh-cn.php | 274 ++-- trunk/module/testcase/model.php | 364 ++--- trunk/module/testcase/view/browse.html.php | 262 ++-- trunk/module/testcase/view/create.html.php | 192 +-- trunk/module/testcase/view/edit.html.php | 6 +- trunk/module/testcase/view/index.html.php | 54 +- trunk/module/testcase/view/view.html.php | 6 +- trunk/module/testtask/control.php | 554 ++++---- trunk/module/testtask/lang/en.php | 122 +- trunk/module/testtask/lang/zh-cn.php | 136 +- trunk/module/testtask/model.php | 356 ++--- trunk/module/testtask/view/browse.html.php | 136 +- trunk/module/testtask/view/cases.html.php | 6 +- trunk/module/testtask/view/create.html.php | 130 +- trunk/module/testtask/view/edit.html.php | 130 +- trunk/module/testtask/view/linkcase.html.php | 178 +-- trunk/module/testtask/view/results.html.php | 6 +- trunk/module/testtask/view/runcase.html.php | 6 +- trunk/module/testtask/view/view.html.php | 6 +- trunk/module/todo/control.php | 312 ++--- trunk/module/todo/lang/en.php | 158 +-- trunk/module/todo/lang/zh-cn.php | 174 +-- trunk/module/todo/model.php | 548 ++++---- trunk/module/todo/view/create.html.php | 150 +- trunk/module/todo/view/edit.html.php | 160 +-- trunk/module/todo/view/view.html.php | 208 +-- trunk/module/tree/control.php | 320 ++--- trunk/module/tree/lang/en.php | 78 +- trunk/module/tree/lang/zh-cn.php | 88 +- trunk/module/tree/model.php | 640 ++++----- trunk/module/tree/view/browse.html.php | 194 +-- trunk/module/tree/view/create.html.php | 102 +- trunk/module/tree/view/edit.html.php | 92 +- trunk/module/upgrade/control.php | 146 +- trunk/module/upgrade/lang/en.php | 94 +- trunk/module/upgrade/lang/zh-cn.php | 102 +- trunk/module/upgrade/model.php | 548 ++++---- trunk/module/upgrade/view/confirm.html.php | 76 +- trunk/module/upgrade/view/execute.html.php | 90 +- trunk/module/upgrade/view/index.html.php | 76 +- .../upgrade/view/selectversion.html.php | 88 +- trunk/module/user/control.php | 736 +++++----- trunk/module/user/lang/en.php | 178 +-- trunk/module/user/lang/zh-cn.php | 178 +-- trunk/module/user/model.php | 468 +++---- trunk/module/user/view/bug.html.php | 114 +- trunk/module/user/view/create.html.php | 134 +- trunk/module/user/view/deny.html.php | 92 +- trunk/module/user/view/edit.html.php | 134 +- trunk/module/user/view/login.html.php | 8 +- trunk/module/user/view/profile.html.php | 128 +- trunk/module/user/view/project.html.php | 120 +- trunk/module/user/view/story.html.php | 54 +- trunk/module/user/view/task.html.php | 116 +- trunk/module/user/view/team.html.php | 52 +- trunk/module/user/view/todo.html.php | 162 +-- trunk/module/user/view/view.html.php | 172 +-- trunk/www/index.php | 212 +-- trunk/www/install.php | 128 +- trunk/www/theme/default/style.css | 596 ++++---- trunk/www/upgrade.php | 128 +- 260 files changed, 24581 insertions(+), 24581 deletions(-) diff --git a/trunk/bin/ztcli b/trunk/bin/ztcli index f9cca9b875..04809a312c 100755 --- a/trunk/bin/ztcli +++ b/trunk/bin/ztcli @@ -1,69 +1,69 @@ -#!/usr/bin/env php -. - * - * @copyright Copyright: 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package ZenTaoPMS - * @version $Id$ - * @link http://www.zentao.cn - */ -error_reporting(0); -define('IN_SHELL', true); - -/* 获取命令参数。 */ -if($argc != 2) -{ - die('Usage: ' . basename(__FILE__) . " \n"); -} - -/* 包含必须的类文件。*/ -chdir(dirname(__FILE__)); -include '../framework/router.class.php'; -include '../framework/control.class.php'; -include '../framework/model.class.php'; -include '../framework/helper.class.php'; - -/* 将输入的参数解析成对于的变量。*/ -$request = parse_url(trim($argv[1])); -$_SERVER['HTTP_HOST'] = $request['host']; -$_SERVER['PATH_INFO'] = $request['path']; -$_SERVER['REQUEST_URI'] = $request['query']; -if(isset($request['query'])) parse_str($request['query'], $_GET); - -/* 实例化路由对象,并加载配置,连接到数据库。*/ -$app = router::createApp('pms', dirname(dirname(__FILE__))); -$config = $app->loadConfig('common'); -$app->setDebug(); -$dbh = $app->connectDB(); - -/* 设置时区。*/ -$app->setTimezone(); - -/* 设置终端使用的语言,并加载共用的模块。*/ -$app->setClientLang('zh-cn'); -$lang = $app->loadLang('common'); -$common = $app->loadCommon(); - -/* 加载相应的lib文件,并设置超全局变量的引用。*/ -$app->loadClass('front', $static = true); -$app->loadClass('filter', $static = true); -$app->setSuperVars(); - -/* 解析请求,加载模块。*/ -$app->parseRequest(); -$app->loadModule(); +#!/usr/bin/env php +. + * + * @copyright Copyright: 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package ZenTaoPMS + * @version $Id$ + * @link http://www.zentaoms.com + */ +error_reporting(0); +define('IN_SHELL', true); + +/* 获取命令参数。 */ +if($argc != 2) +{ + die('Usage: ' . basename(__FILE__) . " \n"); +} + +/* 包含必须的类文件。*/ +chdir(dirname(__FILE__)); +include '../framework/router.class.php'; +include '../framework/control.class.php'; +include '../framework/model.class.php'; +include '../framework/helper.class.php'; + +/* 将输入的参数解析成对于的变量。*/ +$request = parse_url(trim($argv[1])); +$_SERVER['HTTP_HOST'] = $request['host']; +$_SERVER['PATH_INFO'] = $request['path']; +$_SERVER['REQUEST_URI'] = $request['query']; +if(isset($request['query'])) parse_str($request['query'], $_GET); + +/* 实例化路由对象,并加载配置,连接到数据库。*/ +$app = router::createApp('pms', dirname(dirname(__FILE__))); +$config = $app->loadConfig('common'); +$app->setDebug(); +$dbh = $app->connectDB(); + +/* 设置时区。*/ +$app->setTimezone(); + +/* 设置终端使用的语言,并加载共用的模块。*/ +$app->setClientLang('zh-cn'); +$lang = $app->loadLang('common'); +$common = $app->loadCommon(); + +/* 加载相应的lib文件,并设置超全局变量的引用。*/ +$app->loadClass('front', $static = true); +$app->loadClass('filter', $static = true); +$app->setSuperVars(); + +/* 解析请求,加载模块。*/ +$app->parseRequest(); +$app->loadModule(); diff --git a/trunk/config/config.php b/trunk/config/config.php index 55262fee41..7fa1384841 100644 --- a/trunk/config/config.php +++ b/trunk/config/config.php @@ -1,109 +1,109 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package ZenTaoMS - * @version $Id$ - * @link http://www.zentao.cn - */ -/* 基本参数设定。*/ -$config->version = '1.0.stable'; // 版本号,切勿修改。 -$config->encoding = 'UTF-8'; // 网站的编码。 -$config->cookiePath = '/'; // cookie的有效路径。 -$config->cookieLife = time() + 2592000; // cookie的生命周期。 -$config->timezone = 'Asia/Shanghai'; //时区设置,详细的列表,请访问 http://www.php.net/manual/en/timezones.php - -/* 请求方式设置。*/ -$config->requestType = 'PATH_INFO'; // 如何获取当前请求的信息,可选值:PATH_INFO|GET -$config->pathType = 'clean'; // requestType=PATH_INFO: 请求url的格式,可选值为full|clean,full格式会带有参数名称,clean则只有取值。 -$config->requestFix = '-'; // requestType=PATH_INFO: 请求url的分隔符,可选值为斜线、减号。后面两种形式有助于SEO。 -$config->moduleVar = 'm'; // requestType=GET: 模块变量名。 -$config->methodVar = 'f'; // requestType=GET: 方法变量名。 -$config->viewVar = 't'; // requestType=GET: 模板变量名。 - -/* 视图和主题。*/ -$config->views = ',html,json,csv,'; // 支持的视图列表。 -$config->themes = 'default,blue'; // 支持的主题列表。 - -/* 支持的语言列表。*/ -$config->langs['zh-cn'] = 'Chinese Simplified'; - -/* 默认参数设定。*/ -$config->default->view = 'html'; // 默认的视图格式。 -$config->default->lang = 'zh-cn'; // 默认的语言。 -$config->default->theme = 'default'; // 默认的主题。 -$config->default->module = 'index'; // 默认的模块。当请求中没有指定模块时,加载该模块。 -$config->default->method = 'index'; // 默认的方法。当请求中没有指定方法或者指定的方法不存在时,调用该方法。 - -/* 上传附件参数设定。*/ -$config->file->dangers = 'php,jsp,py,rb,asp,'; // 不允许上传的文件类型列表。 -$config->file->maxSize = 1024 * 1024; // 允许上传的文件大小,单位为字节。 - -/* 数据库参数设定。*/ -$config->db->persistant = false; // 是否打开持久连接。 -$config->db->driver = 'mysql'; // pdo的驱动类型,目前暂时只支持mysql。 -$config->db->dao = true; // 是否使用DAO。 -$config->db->encoding = 'UTF8'; // 数据库的编码。 -$config->db->strictMode = false; // 关闭MySQL的严格模式。 - -/* 通过对象引用全局变量。*/ -$config->super2OBJ = true; - -/* 包含自定义配置文件。*/ -$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php'; -if(file_exists($myConfig)) include $myConfig; -if(!isset($config->db->prefix)) $config->db->prefix = 'zt_'; - -/* 数据表的定义。*/ -define('TABLE_COMPANY', $config->db->prefix . 'company'); -define('TABLE_DEPT', $config->db->prefix . 'dept'); -define('TABLE_CONFIG', $config->db->prefix . 'config'); -define('TABLE_USER', $config->db->prefix . 'user'); -define('TABLE_TODO', $config->db->prefix . 'todo'); -define('TABLE_GROUP', $config->db->prefix . 'group'); -define('TABLE_GROUPPRIV', $config->db->prefix . 'groupPriv'); -define('TABLE_USERGROUP', $config->db->prefix . 'userGroup'); -//define('TABLE_USERQUERY', $config->db->prefix . 'userQuery'); - -define('TABLE_BUG', $config->db->prefix . 'bug'); -define('TABLE_CASE', $config->db->prefix . 'case'); -define('TABLE_CASESTEP', $config->db->prefix . 'caseStep'); -define('TABLE_TESTTASK', $config->db->prefix . 'testTask'); -define('TABLE_TESTRUN', $config->db->prefix . 'testRun'); -define('TABLE_TESTRESULT', $config->db->prefix . 'testResult'); - -define('TABLE_PRODUCT', $config->db->prefix . 'product'); -define('TABLE_STORY', $config->db->prefix . 'story'); -define('TABLE_STORYSPEC', $config->db->prefix . 'storySpec'); -define('TABLE_PRODUCTPLAN', $config->db->prefix . 'productPlan'); -define('TABLE_RELEASE', $config->db->prefix . 'release'); - -define('TABLE_PROJECT', $config->db->prefix . 'project'); -define('TABLE_TASK', $config->db->prefix . 'task'); -define('TABLE_TEAM', $config->db->prefix . 'team'); -define('TABLE_PROJECTPRODUCT', $config->db->prefix . 'projectProduct'); -define('TABLE_PROJECTSTORY', $config->db->prefix . 'projectStory'); -define('TABLE_TASKESTIMATE', $config->db->prefix . 'taskEstimate'); -define('TABLE_EFFORT', $config->db->prefix . 'effort'); -define('TABLE_BURN', $config->db->prefix . 'burn'); -define('TABLE_BUILD', $config->db->prefix . 'build'); - -define('TABLE_MODULE', $config->db->prefix . 'module'); -define('TABLE_ACTION', $config->db->prefix . 'action'); -define('TABLE_FILE', $config->db->prefix . 'file'); -define('TABLE_HISTORY', $config->db->prefix . 'history'); +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package ZenTaoMS + * @version $Id$ + * @link http://www.zentaoms.com + */ +/* 基本参数设定。*/ +$config->version = '1.0.stable'; // 版本号,切勿修改。 +$config->encoding = 'UTF-8'; // 网站的编码。 +$config->cookiePath = '/'; // cookie的有效路径。 +$config->cookieLife = time() + 2592000; // cookie的生命周期。 +$config->timezone = 'Asia/Shanghai'; //时区设置,详细的列表,请访问 http://www.php.net/manual/en/timezones.php + +/* 请求方式设置。*/ +$config->requestType = 'PATH_INFO'; // 如何获取当前请求的信息,可选值:PATH_INFO|GET +$config->pathType = 'clean'; // requestType=PATH_INFO: 请求url的格式,可选值为full|clean,full格式会带有参数名称,clean则只有取值。 +$config->requestFix = '-'; // requestType=PATH_INFO: 请求url的分隔符,可选值为斜线、减号。后面两种形式有助于SEO。 +$config->moduleVar = 'm'; // requestType=GET: 模块变量名。 +$config->methodVar = 'f'; // requestType=GET: 方法变量名。 +$config->viewVar = 't'; // requestType=GET: 模板变量名。 + +/* 视图和主题。*/ +$config->views = ',html,json,csv,'; // 支持的视图列表。 +$config->themes = 'default,blue'; // 支持的主题列表。 + +/* 支持的语言列表。*/ +$config->langs['zh-cn'] = 'Chinese Simplified'; + +/* 默认参数设定。*/ +$config->default->view = 'html'; // 默认的视图格式。 +$config->default->lang = 'zh-cn'; // 默认的语言。 +$config->default->theme = 'default'; // 默认的主题。 +$config->default->module = 'index'; // 默认的模块。当请求中没有指定模块时,加载该模块。 +$config->default->method = 'index'; // 默认的方法。当请求中没有指定方法或者指定的方法不存在时,调用该方法。 + +/* 上传附件参数设定。*/ +$config->file->dangers = 'php,jsp,py,rb,asp,'; // 不允许上传的文件类型列表。 +$config->file->maxSize = 1024 * 1024; // 允许上传的文件大小,单位为字节。 + +/* 数据库参数设定。*/ +$config->db->persistant = false; // 是否打开持久连接。 +$config->db->driver = 'mysql'; // pdo的驱动类型,目前暂时只支持mysql。 +$config->db->dao = true; // 是否使用DAO。 +$config->db->encoding = 'UTF8'; // 数据库的编码。 +$config->db->strictMode = false; // 关闭MySQL的严格模式。 + +/* 通过对象引用全局变量。*/ +$config->super2OBJ = true; + +/* 包含自定义配置文件。*/ +$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php'; +if(file_exists($myConfig)) include $myConfig; +if(!isset($config->db->prefix)) $config->db->prefix = 'zt_'; + +/* 数据表的定义。*/ +define('TABLE_COMPANY', $config->db->prefix . 'company'); +define('TABLE_DEPT', $config->db->prefix . 'dept'); +define('TABLE_CONFIG', $config->db->prefix . 'config'); +define('TABLE_USER', $config->db->prefix . 'user'); +define('TABLE_TODO', $config->db->prefix . 'todo'); +define('TABLE_GROUP', $config->db->prefix . 'group'); +define('TABLE_GROUPPRIV', $config->db->prefix . 'groupPriv'); +define('TABLE_USERGROUP', $config->db->prefix . 'userGroup'); +//define('TABLE_USERQUERY', $config->db->prefix . 'userQuery'); + +define('TABLE_BUG', $config->db->prefix . 'bug'); +define('TABLE_CASE', $config->db->prefix . 'case'); +define('TABLE_CASESTEP', $config->db->prefix . 'caseStep'); +define('TABLE_TESTTASK', $config->db->prefix . 'testTask'); +define('TABLE_TESTRUN', $config->db->prefix . 'testRun'); +define('TABLE_TESTRESULT', $config->db->prefix . 'testResult'); + +define('TABLE_PRODUCT', $config->db->prefix . 'product'); +define('TABLE_STORY', $config->db->prefix . 'story'); +define('TABLE_STORYSPEC', $config->db->prefix . 'storySpec'); +define('TABLE_PRODUCTPLAN', $config->db->prefix . 'productPlan'); +define('TABLE_RELEASE', $config->db->prefix . 'release'); + +define('TABLE_PROJECT', $config->db->prefix . 'project'); +define('TABLE_TASK', $config->db->prefix . 'task'); +define('TABLE_TEAM', $config->db->prefix . 'team'); +define('TABLE_PROJECTPRODUCT', $config->db->prefix . 'projectProduct'); +define('TABLE_PROJECTSTORY', $config->db->prefix . 'projectStory'); +define('TABLE_TASKESTIMATE', $config->db->prefix . 'taskEstimate'); +define('TABLE_EFFORT', $config->db->prefix . 'effort'); +define('TABLE_BURN', $config->db->prefix . 'burn'); +define('TABLE_BUILD', $config->db->prefix . 'build'); + +define('TABLE_MODULE', $config->db->prefix . 'module'); +define('TABLE_ACTION', $config->db->prefix . 'action'); +define('TABLE_FILE', $config->db->prefix . 'file'); +define('TABLE_HISTORY', $config->db->prefix . 'history'); diff --git a/trunk/doc/README b/trunk/doc/README index 1fde5c6af7..4971559c59 100644 --- a/trunk/doc/README +++ b/trunk/doc/README @@ -1,6 +1,6 @@ 涓銆佷粈涔堟槸绂呴亾椤圭洰绠$悊杞欢 -绂呴亾椤圭洰绠$悊杞欢(ZenTaoPMS)鏄竴娆惧浗浜х殑锛屽熀浜嶭GPL鍗忚锛屽紑婧愬厤璐圭殑椤圭洰绠$悊杞欢锛屽畠闆嗕骇鍝佺鐞嗐侀」鐩鐞嗐佹祴璇曠鐞嗕簬涓浣擄紝鍚屾椂杩樺寘鍚簡浜嬪姟绠$悊銆佺粍缁囩鐞嗙瓑璇稿鍔熻兘锛屾槸涓皬鍨嬩紒涓氶」鐩鐞嗙殑棣栭夈傚畼鏂圭綉绔欙細www.zentao.cn +绂呴亾椤圭洰绠$悊杞欢(ZenTaoPMS)鏄竴娆惧浗浜х殑锛屽熀浜嶭GPL鍗忚锛屽紑婧愬厤璐圭殑椤圭洰绠$悊杞欢锛屽畠闆嗕骇鍝佺鐞嗐侀」鐩鐞嗐佹祴璇曠鐞嗕簬涓浣擄紝鍚屾椂杩樺寘鍚簡浜嬪姟绠$悊銆佺粍缁囩鐞嗙瓑璇稿鍔熻兘锛屾槸涓皬鍨嬩紒涓氶」鐩鐞嗙殑棣栭夈傚畼鏂圭綉绔欙細www.zentaoms.com 绂呴亾椤圭洰绠$悊杞欢浣跨敤PHP + MySQL寮鍙戯紝鍩轰簬鑷富鐨凱HP寮鍙戞鏋垛攢鈹ZenTaoPHP鑰屾垚銆傜涓夋柟寮鍙戣呮垨鑰呬紒涓氬彲浠ラ潪甯告柟渚跨殑寮鍙戞彃浠舵垨鑰呰繘琛屽畾鍒躲 diff --git a/trunk/lib/front/front.class.php b/trunk/lib/front/front.class.php index 347941e23d..888e3124c8 100644 --- a/trunk/lib/front/front.class.php +++ b/trunk/lib/front/front.class.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang * @package ZenTaoMS * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ class html { diff --git a/trunk/lib/front/tests/html_checkbox.php b/trunk/lib/front/tests/html_checkbox.php index ec9612c2a5..1a2f900a76 100644 --- a/trunk/lib/front/tests/html_checkbox.php +++ b/trunk/lib/front/tests/html_checkbox.php @@ -1,31 +1,31 @@ -#!/usr/bin/env php - - * @version $Id$ - */ -include '../front.class.php'; - -$options['a'] = 'texta'; -$options['b'] = 'textb'; -$options['c'] = 'textc'; - -echo html::checkbox('checkbox', $options) . "\n"; -echo html::checkbox('checkbox', $options, 'a') . "\n"; -echo html::checkbox('checkbox', $options, 'a,b') . "\n"; -echo html::checkbox('checkbox', $options, 'ab') . "\n"; -echo html::checkbox('checkbox', $options, '', 'style="color:red"') . "\n"; -var_dump(html::checkbox('checkbox', array())); -<< +#!/usr/bin/env php + + * @version $Id$ + */ +include '../front.class.php'; + +$options['a'] = 'texta'; +$options['b'] = 'textb'; +$options['c'] = 'textc'; + +echo html::checkbox('checkbox', $options) . "\n"; +echo html::checkbox('checkbox', $options, 'a') . "\n"; +echo html::checkbox('checkbox', $options, 'a,b') . "\n"; +echo html::checkbox('checkbox', $options, 'ab') . "\n"; +echo html::checkbox('checkbox', $options, '', 'style="color:red"') . "\n"; +var_dump(html::checkbox('checkbox', array())); +<< diff --git a/trunk/lib/front/tests/html_radio.php b/trunk/lib/front/tests/html_radio.php index 20b4635e1d..612d083182 100644 --- a/trunk/lib/front/tests/html_radio.php +++ b/trunk/lib/front/tests/html_radio.php @@ -1,29 +1,29 @@ -#!/usr/bin/env php - - * @version $Id$ - */ -include '../front.class.php'; - -$options['a'] = 'texta'; -$options['b'] = 'textb'; -$options['c'] = 'textc'; - -echo html::radio('radio', $options); -echo html::radio('radio', $options, 'a'); -echo html::radio('radio', $options, 'a,b'); -echo html::radio('radio', $options, '', 'style="color:red"'); -var_dump(html::radio('radio', array())); -<< +#!/usr/bin/env php + + * @version $Id$ + */ +include '../front.class.php'; + +$options['a'] = 'texta'; +$options['b'] = 'textb'; +$options['c'] = 'textc'; + +echo html::radio('radio', $options); +echo html::radio('radio', $options, 'a'); +echo html::radio('radio', $options, 'a,b'); +echo html::radio('radio', $options, '', 'style="color:red"'); +var_dump(html::radio('radio', array())); +<< diff --git a/trunk/lib/front/tests/html_select.php b/trunk/lib/front/tests/html_select.php index 1d2595c101..bbdef57b76 100644 --- a/trunk/lib/front/tests/html_select.php +++ b/trunk/lib/front/tests/html_select.php @@ -1,34 +1,34 @@ -#!/usr/bin/env php - - * @version $Id$ - */ -include '../front.class.php'; - -$options['a'] = 'texta'; -$options['b'] = 'textb'; -$options['c'] = 'textc'; - -echo html::select('select', $options); -echo html::select('select[]', $options); -echo html::select('select', $options, 'a'); -echo html::select('select', $options, 'a,c'); -echo html::select('select', $options, 'ab'); -echo html::select('select', $options, '', 'style="color:red"'); -var_dump(html::select('select', array())); -<< +#!/usr/bin/env php + + * @version $Id$ + */ +include '../front.class.php'; + +$options['a'] = 'texta'; +$options['b'] = 'textb'; +$options['c'] = 'textc'; + +echo html::select('select', $options); +echo html::select('select[]', $options); +echo html::select('select', $options, 'a'); +echo html::select('select', $options, 'a,c'); +echo html::select('select', $options, 'ab'); +echo html::select('select', $options, '', 'style="color:red"'); +var_dump(html::select('select', array())); +<< diff --git a/trunk/lib/front/tests/html_selectgroup.php b/trunk/lib/front/tests/html_selectgroup.php index 5cd601c7a3..ad226469fd 100644 --- a/trunk/lib/front/tests/html_selectgroup.php +++ b/trunk/lib/front/tests/html_selectgroup.php @@ -1,26 +1,26 @@ -#!/usr/bin/env php - - * @version $Id$ - */ -include '../front.class.php'; - -$groups['group1']['a'] = 'texta'; -$groups['group1']['b'] = 'textb'; -$groups['group2']['c'] = 'textc'; -$groups['group2']['d'] = 'textd'; - -echo html::selectgroup('select', $groups); -?> +#!/usr/bin/env php + + * @version $Id$ + */ +include '../front.class.php'; + +$groups['group1']['a'] = 'texta'; +$groups['group1']['b'] = 'textb'; +$groups['group2']['c'] = 'textc'; +$groups['group2']['d'] = 'textd'; + +echo html::selectgroup('select', $groups); +?> diff --git a/trunk/module/action/control.php b/trunk/module/action/control.php index 97126178e6..b5df73dde7 100644 --- a/trunk/module/action/control.php +++ b/trunk/module/action/control.php @@ -1,63 +1,63 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package action - * @version $Id$ - * @link http://www.zentao.cn - */ -class action extends control -{ - /* 宸插垹闄よ褰曞垪琛ㄣ*/ - public function trash($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) - { - /* 鐧昏session銆*/ - $uri = $this->app->getURI(true); - $this->session->set('productList', $uri); - $this->session->set('productPlanList', $uri); - $this->session->set('releaseList', $uri); - $this->session->set('storyList', $uri); - $this->session->set('projectList', $uri); - $this->session->set('taskList', $uri); - $this->session->set('buildList', $uri); - $this->session->set('bugList', $uri); - $this->session->set('caseList', $uri); - $this->session->set('testtaskList', $uri); - - /* 璁剧疆鏍囬鍜屽鑸潯銆*/ - $this->view->header->title = $this->lang->action->trash; - $this->view->position[] = $this->lang->action->trash; - - /* 鑾峰彇宸插垹闄よ褰曘*/ - $this->app->loadClass('pager', $static = true); - $pager = pager::init($recTotal, $recPerPage, $pageID); - $this->view->trashes = $this->action->getTrashes($orderBy, $pager); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->users['system'] = 'system'; - $this->view->orderBy = $orderBy; - $this->view->pager = $pager; - $this->display(); - } - - /* 杩樺師鏌愪竴涓璞°*/ - public function undelete($actionID) - { - $this->action->undelete($actionID); - die(js::locate(inlink('trash'), 'parent')); - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package action + * @version $Id$ + * @link http://www.zentaoms.com + */ +class action extends control +{ + /* 宸插垹闄よ褰曞垪琛ㄣ*/ + public function trash($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + /* 鐧昏session銆*/ + $uri = $this->app->getURI(true); + $this->session->set('productList', $uri); + $this->session->set('productPlanList', $uri); + $this->session->set('releaseList', $uri); + $this->session->set('storyList', $uri); + $this->session->set('projectList', $uri); + $this->session->set('taskList', $uri); + $this->session->set('buildList', $uri); + $this->session->set('bugList', $uri); + $this->session->set('caseList', $uri); + $this->session->set('testtaskList', $uri); + + /* 璁剧疆鏍囬鍜屽鑸潯銆*/ + $this->view->header->title = $this->lang->action->trash; + $this->view->position[] = $this->lang->action->trash; + + /* 鑾峰彇宸插垹闄よ褰曘*/ + $this->app->loadClass('pager', $static = true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + $this->view->trashes = $this->action->getTrashes($orderBy, $pager); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->users['system'] = 'system'; + $this->view->orderBy = $orderBy; + $this->view->pager = $pager; + $this->display(); + } + + /* 杩樺師鏌愪竴涓璞°*/ + public function undelete($actionID) + { + $this->action->undelete($actionID); + die(js::locate(inlink('trash'), 'parent')); + } +} diff --git a/trunk/module/action/lang/en.php b/trunk/module/action/lang/en.php index 557f6e25e4..84d3ffa09b 100644 --- a/trunk/module/action/lang/en.php +++ b/trunk/module/action/lang/en.php @@ -1,47 +1,47 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->action->desc->common = '$date, $action by $actor'; -$lang->action->desc->extra = '$date, $action as $extra by $actor'; -$lang->action->desc->opened = '$date, 鐢 $actor 鍒涘缓銆'; -$lang->action->desc->changed = '$date, 鐢 $actor 鍙樻洿銆'; -$lang->action->desc->edited = '$date, 鐢 $actor 缂栬緫銆'; -$lang->action->desc->closed = '$date, 鐢 $actor 鍏抽棴銆'; -$lang->action->desc->commented = '$date, 鐢 $actor 鍙戣〃璇勮銆'; -$lang->action->desc->activated = '$date, 鐢 $actor 婵娲汇'; -$lang->action->desc->diff1 = '淇敼浜 %s锛屾棫鍊间负 "%s"锛屾柊鍊间负 "%s"銆
'; -$lang->action->desc->diff2 = '淇敼浜 %s锛屽尯鍒负锛
%s
'; - -$lang->action->label->opened = '鍒涘缓浜'; -$lang->action->label->changed = '鍙樻洿浜'; -$lang->action->label->edited = '缂栬緫浜'; -$lang->action->label->closed = '鍏抽棴浜'; -$lang->action->label->commented = '璇勮浜'; -$lang->action->label->activated = '婵娲讳簡'; -$lang->action->label->resolved = '瑙e喅浜'; -$lang->action->label->reviewed = '璇勫浜'; -$lang->action->label->story = '闇姹倈story|view|storyID=%s'; -$lang->action->label->task = '浠诲姟|task|view|taskID=%s'; -$lang->action->label->bug = 'Bug|bug|view|bugID=%s'; -$lang->action->label->testcase = '鐢ㄤ緥|testcase|view|caseID=%s'; -$lang->action->label->space = '銆'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->action->desc->common = '$date, $action by $actor'; +$lang->action->desc->extra = '$date, $action as $extra by $actor'; +$lang->action->desc->opened = '$date, 鐢 $actor 鍒涘缓銆'; +$lang->action->desc->changed = '$date, 鐢 $actor 鍙樻洿銆'; +$lang->action->desc->edited = '$date, 鐢 $actor 缂栬緫銆'; +$lang->action->desc->closed = '$date, 鐢 $actor 鍏抽棴銆'; +$lang->action->desc->commented = '$date, 鐢 $actor 鍙戣〃璇勮銆'; +$lang->action->desc->activated = '$date, 鐢 $actor 婵娲汇'; +$lang->action->desc->diff1 = '淇敼浜 %s锛屾棫鍊间负 "%s"锛屾柊鍊间负 "%s"銆
'; +$lang->action->desc->diff2 = '淇敼浜 %s锛屽尯鍒负锛
%s
'; + +$lang->action->label->opened = '鍒涘缓浜'; +$lang->action->label->changed = '鍙樻洿浜'; +$lang->action->label->edited = '缂栬緫浜'; +$lang->action->label->closed = '鍏抽棴浜'; +$lang->action->label->commented = '璇勮浜'; +$lang->action->label->activated = '婵娲讳簡'; +$lang->action->label->resolved = '瑙e喅浜'; +$lang->action->label->reviewed = '璇勫浜'; +$lang->action->label->story = '闇姹倈story|view|storyID=%s'; +$lang->action->label->task = '浠诲姟|task|view|taskID=%s'; +$lang->action->label->bug = 'Bug|bug|view|bugID=%s'; +$lang->action->label->testcase = '鐢ㄤ緥|testcase|view|caseID=%s'; +$lang->action->label->space = '銆'; diff --git a/trunk/module/action/lang/zh-cn.php b/trunk/module/action/lang/zh-cn.php index d709b1ee30..60d23e9a38 100644 --- a/trunk/module/action/lang/zh-cn.php +++ b/trunk/module/action/lang/zh-cn.php @@ -1,99 +1,99 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package action - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->action->common = '绯荤粺鏃ュ織'; -$lang->action->trash = '鍥炴敹绔'; -$lang->action->undelete = '杩樺師'; - -$lang->action->objectType = '瀵硅薄绫诲瀷'; -$lang->action->objectID = '瀵硅薄ID'; -$lang->action->objectName = '瀵硅薄鍚嶇О'; -$lang->action->actor = '鎿嶄綔鑰'; -$lang->action->date = '鏃ユ湡'; - -$lang->action->objectTypes['product'] = '浜у搧'; -$lang->action->objectTypes['story'] = '闇姹'; -$lang->action->objectTypes['productplan'] = '浜у搧璁″垝'; -$lang->action->objectTypes['release'] = '鍙戝竷'; -$lang->action->objectTypes['project'] = '椤圭洰'; -$lang->action->objectTypes['task'] = '浠诲姟'; -$lang->action->objectTypes['build'] = 'Build'; -$lang->action->objectTypes['bug'] = 'Bug'; -$lang->action->objectTypes['case'] = '鐢ㄤ緥'; -$lang->action->objectTypes['testtask'] = '娴嬭瘯浠诲姟'; -$lang->action->objectTypes['user'] = '鐢ㄦ埛'; - -/* 鐢ㄦ潵鎻忚堪鎿嶄綔鍘嗗彶璁板綍銆*/ -$lang->action->desc->common = '$date, $action by $actor'; -$lang->action->desc->extra = '$date, $action as $extra by $actor'; -$lang->action->desc->opened = '$date, 鐢 $actor 鍒涘缓銆'; -$lang->action->desc->changed = '$date, 鐢 $actor 鍙樻洿銆'; -$lang->action->desc->edited = '$date, 鐢 $actor 缂栬緫銆'; -$lang->action->desc->closed = '$date, 鐢 $actor 鍏抽棴銆'; -$lang->action->desc->deleted = '$date, 鐢 $actor 鍒犻櫎銆'; -$lang->action->desc->erased = '$date, 鐢 $actor 鍒犻櫎銆'; -$lang->action->desc->undeleted = '$date, 鐢 $actor 杩樺師銆'; -$lang->action->desc->commented = '$date, 鐢 $actor 鍙戣〃璇勮銆'; -$lang->action->desc->activated = '$date, 鐢 $actor 婵娲汇'; -$lang->action->desc->moved = '$date, 鐢 $actor 绉诲姩锛屼箣鍓嶄负 "$extra"'; -$lang->action->desc->confirmed = '$date, 鐢 $actor 纭闇姹傚彉鍔紝鏈鏂扮増鏈负#$extra'; -$lang->action->desc->diff1 = '淇敼浜 %s锛屾棫鍊间负 "%s"锛屾柊鍊间负 "%s"銆
'; -$lang->action->desc->diff2 = '淇敼浜 %s锛屽尯鍒负锛
%s
'; - -/* 鐢ㄦ潵鏄剧ず鍔ㄦ佷俊鎭*/ -$lang->action->label->opened = '鍒涘缓浜'; -$lang->action->label->changed = '鍙樻洿浜'; -$lang->action->label->edited = '缂栬緫浜'; -$lang->action->label->closed = '鍏抽棴浜'; -$lang->action->label->deleted = '鍒犻櫎浜'; -$lang->action->label->erased = '鍒犻櫎浜'; -$lang->action->label->undeleted = '杩樺師浜'; -$lang->action->label->commented = '璇勮浜'; -$lang->action->label->activated = '婵娲讳簡'; -$lang->action->label->resolved = '瑙e喅浜'; -$lang->action->label->reviewed = '璇勫浜'; -$lang->action->label->moved = '绉诲姩浜'; -$lang->action->label->confirmed = '纭浜嗛渶姹傦紝'; -$lang->action->label->linked2plan = '鍏宠仈璁″垝'; -$lang->action->label->unlinkedfromplan = '绉婚櫎璁″垝'; -$lang->action->label->linked2project = '鍏宠仈椤圭洰'; -$lang->action->label->unlinkedfromproject = '绉婚櫎椤圭洰'; -$lang->action->label->marked = '缂栬緫浜'; -$lang->action->label->login = '鐧诲綍绯荤粺'; -$lang->action->label->logout = "閫鍑虹櫥褰"; - -/* 鐢ㄦ潵鐢熸垚鐩稿簲瀵硅薄鐨勯摼鎺ャ*/ -$lang->action->label->product = '浜у搧|product|view|productID=%s'; -$lang->action->label->productplan = '璁″垝|productplan|view|productID=%s'; -$lang->action->label->release = '鍙戝竷|release|view|productID=%s'; -$lang->action->label->story = '闇姹倈story|view|storyID=%s'; -$lang->action->label->project = '椤圭洰|project|view|projectID=%s'; -$lang->action->label->task = '浠诲姟|task|view|taskID=%s'; -$lang->action->label->build = 'Build|build|view|buildID=%s'; -$lang->action->label->bug = 'Bug|bug|view|bugID=%s'; -$lang->action->label->case = '鐢ㄤ緥|testcase|view|caseID=%s'; -$lang->action->label->testtask = '娴嬭瘯浠诲姟|testtask|view|caseID=%s'; -$lang->action->label->todo = 'todo|todo|view|todoID=%s'; -$lang->action->label->user = '鐢ㄦ埛'; - -$lang->action->label->space = '銆'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package action + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->action->common = '绯荤粺鏃ュ織'; +$lang->action->trash = '鍥炴敹绔'; +$lang->action->undelete = '杩樺師'; + +$lang->action->objectType = '瀵硅薄绫诲瀷'; +$lang->action->objectID = '瀵硅薄ID'; +$lang->action->objectName = '瀵硅薄鍚嶇О'; +$lang->action->actor = '鎿嶄綔鑰'; +$lang->action->date = '鏃ユ湡'; + +$lang->action->objectTypes['product'] = '浜у搧'; +$lang->action->objectTypes['story'] = '闇姹'; +$lang->action->objectTypes['productplan'] = '浜у搧璁″垝'; +$lang->action->objectTypes['release'] = '鍙戝竷'; +$lang->action->objectTypes['project'] = '椤圭洰'; +$lang->action->objectTypes['task'] = '浠诲姟'; +$lang->action->objectTypes['build'] = 'Build'; +$lang->action->objectTypes['bug'] = 'Bug'; +$lang->action->objectTypes['case'] = '鐢ㄤ緥'; +$lang->action->objectTypes['testtask'] = '娴嬭瘯浠诲姟'; +$lang->action->objectTypes['user'] = '鐢ㄦ埛'; + +/* 鐢ㄦ潵鎻忚堪鎿嶄綔鍘嗗彶璁板綍銆*/ +$lang->action->desc->common = '$date, $action by $actor'; +$lang->action->desc->extra = '$date, $action as $extra by $actor'; +$lang->action->desc->opened = '$date, 鐢 $actor 鍒涘缓銆'; +$lang->action->desc->changed = '$date, 鐢 $actor 鍙樻洿銆'; +$lang->action->desc->edited = '$date, 鐢 $actor 缂栬緫銆'; +$lang->action->desc->closed = '$date, 鐢 $actor 鍏抽棴銆'; +$lang->action->desc->deleted = '$date, 鐢 $actor 鍒犻櫎銆'; +$lang->action->desc->erased = '$date, 鐢 $actor 鍒犻櫎銆'; +$lang->action->desc->undeleted = '$date, 鐢 $actor 杩樺師銆'; +$lang->action->desc->commented = '$date, 鐢 $actor 鍙戣〃璇勮銆'; +$lang->action->desc->activated = '$date, 鐢 $actor 婵娲汇'; +$lang->action->desc->moved = '$date, 鐢 $actor 绉诲姩锛屼箣鍓嶄负 "$extra"'; +$lang->action->desc->confirmed = '$date, 鐢 $actor 纭闇姹傚彉鍔紝鏈鏂扮増鏈负#$extra'; +$lang->action->desc->diff1 = '淇敼浜 %s锛屾棫鍊间负 "%s"锛屾柊鍊间负 "%s"銆
'; +$lang->action->desc->diff2 = '淇敼浜 %s锛屽尯鍒负锛
%s
'; + +/* 鐢ㄦ潵鏄剧ず鍔ㄦ佷俊鎭*/ +$lang->action->label->opened = '鍒涘缓浜'; +$lang->action->label->changed = '鍙樻洿浜'; +$lang->action->label->edited = '缂栬緫浜'; +$lang->action->label->closed = '鍏抽棴浜'; +$lang->action->label->deleted = '鍒犻櫎浜'; +$lang->action->label->erased = '鍒犻櫎浜'; +$lang->action->label->undeleted = '杩樺師浜'; +$lang->action->label->commented = '璇勮浜'; +$lang->action->label->activated = '婵娲讳簡'; +$lang->action->label->resolved = '瑙e喅浜'; +$lang->action->label->reviewed = '璇勫浜'; +$lang->action->label->moved = '绉诲姩浜'; +$lang->action->label->confirmed = '纭浜嗛渶姹傦紝'; +$lang->action->label->linked2plan = '鍏宠仈璁″垝'; +$lang->action->label->unlinkedfromplan = '绉婚櫎璁″垝'; +$lang->action->label->linked2project = '鍏宠仈椤圭洰'; +$lang->action->label->unlinkedfromproject = '绉婚櫎椤圭洰'; +$lang->action->label->marked = '缂栬緫浜'; +$lang->action->label->login = '鐧诲綍绯荤粺'; +$lang->action->label->logout = "閫鍑虹櫥褰"; + +/* 鐢ㄦ潵鐢熸垚鐩稿簲瀵硅薄鐨勯摼鎺ャ*/ +$lang->action->label->product = '浜у搧|product|view|productID=%s'; +$lang->action->label->productplan = '璁″垝|productplan|view|productID=%s'; +$lang->action->label->release = '鍙戝竷|release|view|productID=%s'; +$lang->action->label->story = '闇姹倈story|view|storyID=%s'; +$lang->action->label->project = '椤圭洰|project|view|projectID=%s'; +$lang->action->label->task = '浠诲姟|task|view|taskID=%s'; +$lang->action->label->build = 'Build|build|view|buildID=%s'; +$lang->action->label->bug = 'Bug|bug|view|bugID=%s'; +$lang->action->label->case = '鐢ㄤ緥|testcase|view|caseID=%s'; +$lang->action->label->testtask = '娴嬭瘯浠诲姟|testtask|view|caseID=%s'; +$lang->action->label->todo = 'todo|todo|view|todoID=%s'; +$lang->action->label->user = '鐢ㄦ埛'; + +$lang->action->label->space = '銆'; diff --git a/trunk/module/action/model.php b/trunk/module/action/model.php index 822e4104fd..7a1435c63b 100644 --- a/trunk/module/action/model.php +++ b/trunk/module/action/model.php @@ -1,236 +1,236 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package action - * @version $Id$ - * @link http://www.zentao.cn - */ -?> -objectType = strtolower($objectType); - $action->objectID = $objectID; - $action->actor = $this->app->user->account; - $action->action = strtolower($actionType); - $action->date = helper::now(); - $action->comment = htmlspecialchars($comment); - $action->extra = $extra; - $this->dao->insert(TABLE_ACTION)->data($action)->autoCheck()->exec(); - return $this->dbh->lastInsertID(); - } - - /* 杩斿洖鏌愪竴涓璞$殑鎵鏈塧ction鍒楄〃銆*/ - public function getList($objectType, $objectID) - { - $actions = $this->dao->select('*')->from(TABLE_ACTION) - ->where('objectType')->eq($objectType) - ->andWhere('objectID')->eq($objectID) - ->orderBy('id')->fetchAll('id'); - $histories = $this->getHistory(array_keys($actions)); - foreach($actions as $actionID => $action) - { - $action->history = isset($histories[$actionID]) ? $histories[$actionID] : array(); - $actions[$actionID] = $action; - } - return $actions; - } - - /* 鑾峰緱action淇℃伅銆*/ - public function getById($actionID) - { - return $this->dao->findById((int)$actionID)->from(TABLE_ACTION)->fetch(); - } - - /* 鑾峰緱鎵鏈夌殑鍒犻櫎璁板綍鍒楄〃銆*/ - public function getTrashes($orderBy, $pager) - { - $trashes = $this->dao->select('*')->from(TABLE_ACTION) - ->where('action')->eq('deleted') - ->andWhere('extra')->eq(self::CAN_UNDELETED) - ->orderBy($orderBy)->page($pager)->fetchAll(); - if(!$trashes) return array(); - - /* 灏嗗璞℃寜鐓х被鍨嬪垎寮锛岀劧鍚庢煡鎵惧叾瀵瑰簲鐨勫悕绉般*/ - foreach($trashes as $object) $typeTrashes[$object->objectType][] = $object->objectID; - foreach($typeTrashes as $objectType => $objectIds) - { - $objectIds = array_unique($objectIds); - $table = $this->config->action->objectTables[$objectType]; - $field = $this->config->action->objectNameFields[$objectType]; - $objectNames[$objectType] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs(); - } - - /* 灏唍ame瀛楁娣诲姞鍒皌rashes涓*/ - foreach($trashes as $trash) $trash->objectName = $objectNames[$trash->objectType][$trash->objectID]; - return $trashes; - } - - /* 杩斿洖鏌愪竴涓猘ction鎵瀵瑰簲鐨勫瓧娈典慨鏀硅褰曘*/ - public function getHistory($actionID) - { - return $this->dao->select()->from(TABLE_HISTORY)->where('action')->in($actionID)->orderBy('id')->fetchGroup('action'); - } - - /* 璁板綍鍘嗗彶銆*/ - public function logHistory($actionID, $changes) - { - foreach($changes as $change) - { - $change['action'] = $actionID; - $this->dao->insert(TABLE_HISTORY)->data($change)->exec(); - } - } - - /* 鎵撳嵃action鏍囬锛屾樉绀哄湪姣忎竴涓璞$殑璇︽儏鐣岄潰銆*/ - public function printAction($action) - { - $objectType = $action->objectType; - $actionType = strtolower($action->action); - - /** - * 鍒ゆ柇浣跨敤鍝竴绉嶆弿杩般傚鏋滆妯″潡鏈夊搴旂殑鎻忚堪锛屽垯鍙栦箣锛岀劧鍚庡垯鍙朼ction妯″潡涓搴旂殑鏂规硶鐨勬弿杩般 - * 濡傛灉杩樻病鏈夛紝鍒欏垽鏂綋鍓峚ction鏄惁鏈塭xtra淇℃伅锛屽鏋滄湁锛屽垯鍙朼ction妯″潡鐨別xtra鎻忚堪锛屾渶鍚庝娇鐢ㄩ氱敤鐨勬弿杩般 - */ - if(isset($this->lang->$objectType->action->$actionType)) - { - $desc = $this->lang->$objectType->action->$actionType; - } - elseif(isset($this->lang->action->desc->$actionType)) - { - $desc = $this->lang->action->desc->$actionType; - } - else - { - $desc = $action->extra ? $this->lang->action->desc->extra : $this->lang->action->desc->common; - } - - /* 寰幆鏇挎崲desc涓搴旂殑鏍囩銆*/ - foreach($action as $key => $value) - { - if($key == 'history') continue; - - /* desc鍙兘鏄暟缁勶紝涔熸湁鍙兘鏄竴涓瓧绗︿覆銆*/ - if(is_array($desc)) - { - if($key == 'extra') continue; - $desc['main'] = str_replace('$' . $key, $value, $desc['main']); - } - else - { - $desc = str_replace('$' . $key, $value, $desc); - } - } - - /* 濡傛灉desc鏄暟缁勶紝鍐嶅鐞唀xtra鍙橀噺銆備緥瀛愬弬鑰僢ug妯″潡鐨勮瑷璁剧疆銆*/ - if(is_array($desc)) - { - $extra = strtolower($action->extra); - if(isset($desc['extra'][$extra])) - { - echo str_replace('$extra', $desc['extra'][$extra], $desc['main']); - } - else - { - echo str_replace('$extra', $action->extra, $desc['main']); - } - } - else - { - echo $desc; - } - } - - /* 鎵撳嵃鍔ㄦ佷俊鎭*/ - public function getDynamic($objectType = 'all', $count = 30) - { - $actions = $this->dao->select('*')->from(TABLE_ACTION) - ->onCaseOf($objectType != 'all')->where('objectType')->eq($objectType)->endCase() - ->orderBy('id desc')->limit($count)->fetchAll(); - if(!$actions) return array(); - foreach($actions as $action) - { - $actionType = strtolower($action->action); - $objectType = strtolower($action->objectType); - $action->date = date(DT_MONTHTIME2, strtotime($action->date)); - $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : $action->action; - $action->objectLabel = isset($this->lang->action->label->$objectType) ? $this->lang->action->label->$objectType : $objectType; - - /* 澶勭悊login鍜宭ogout鍔ㄤ綔銆*/ - if($actionType == 'login' or $actionType == 'logout') - { - $action->objectLink = ''; - $action->objectLabel = ''; - continue; - } - - /* 鍏朵粬鐨勫姩浣滅敓鎴愮浉搴旂殑閾炬帴銆*/ - if(strpos($action->objectLabel, '|') !== false) - { - list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); - $action->objectLink = html::a(helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)), '#' . $action->objectID); - $action->objectLabel = $objectLabel; - } - else - { - $action->objectLink = '#' . $action->objectID; - } - } - return $actions; - } - - /* 鎵撳嵃淇敼璁板綍銆*/ - public function printChanges($objectType, $histories) - { - if(empty($histories)) return; - - /* 璁$畻瀛楁鐨勬渶澶ч暱搴︼紝骞跺皢鍘嗗彶璁板綍鏍规嵁鏄惁鏈塪iff鍒嗗紑锛屼互淇濊瘉鍚湁diff鐨勫瓧娈垫樉绀哄湪鏈鍚庨潰銆*/ - $maxLength = 0; - $historiesWithDiff = array(); - $historiesWithoutDiff = array(); - - foreach($histories as $history) - { - $fieldName = $history->field; - $history->fieldLabel = isset($this->lang->$objectType->$fieldName) ? $this->lang->$objectType->$fieldName : $fieldName; - if(($length = strlen($history->fieldLabel)) > $maxLength) $maxLength = $length; - $history->diff ? $historiesWithDiff[] = $history : $historiesWithoutDiff[] = $history; - } - $histories = array_merge($historiesWithoutDiff, $historiesWithDiff); - - foreach($histories as $history) - { - $history->fieldLabel = str_pad($history->fieldLabel, $maxLength, $this->lang->action->label->space); - if($history->diff != '') - { - printf($this->lang->action->desc->diff2, $history->fieldLabel, nl2br($history->diff)); - } - else - { - printf($this->lang->action->desc->diff1, $history->fieldLabel, $history->old, $history->new); - } - } - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package action + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> +objectType = strtolower($objectType); + $action->objectID = $objectID; + $action->actor = $this->app->user->account; + $action->action = strtolower($actionType); + $action->date = helper::now(); + $action->comment = htmlspecialchars($comment); + $action->extra = $extra; + $this->dao->insert(TABLE_ACTION)->data($action)->autoCheck()->exec(); + return $this->dbh->lastInsertID(); + } + + /* 杩斿洖鏌愪竴涓璞$殑鎵鏈塧ction鍒楄〃銆*/ + public function getList($objectType, $objectID) + { + $actions = $this->dao->select('*')->from(TABLE_ACTION) + ->where('objectType')->eq($objectType) + ->andWhere('objectID')->eq($objectID) + ->orderBy('id')->fetchAll('id'); + $histories = $this->getHistory(array_keys($actions)); + foreach($actions as $actionID => $action) + { + $action->history = isset($histories[$actionID]) ? $histories[$actionID] : array(); + $actions[$actionID] = $action; + } + return $actions; + } + + /* 鑾峰緱action淇℃伅銆*/ + public function getById($actionID) + { + return $this->dao->findById((int)$actionID)->from(TABLE_ACTION)->fetch(); + } + + /* 鑾峰緱鎵鏈夌殑鍒犻櫎璁板綍鍒楄〃銆*/ + public function getTrashes($orderBy, $pager) + { + $trashes = $this->dao->select('*')->from(TABLE_ACTION) + ->where('action')->eq('deleted') + ->andWhere('extra')->eq(self::CAN_UNDELETED) + ->orderBy($orderBy)->page($pager)->fetchAll(); + if(!$trashes) return array(); + + /* 灏嗗璞℃寜鐓х被鍨嬪垎寮锛岀劧鍚庢煡鎵惧叾瀵瑰簲鐨勫悕绉般*/ + foreach($trashes as $object) $typeTrashes[$object->objectType][] = $object->objectID; + foreach($typeTrashes as $objectType => $objectIds) + { + $objectIds = array_unique($objectIds); + $table = $this->config->action->objectTables[$objectType]; + $field = $this->config->action->objectNameFields[$objectType]; + $objectNames[$objectType] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs(); + } + + /* 灏唍ame瀛楁娣诲姞鍒皌rashes涓*/ + foreach($trashes as $trash) $trash->objectName = $objectNames[$trash->objectType][$trash->objectID]; + return $trashes; + } + + /* 杩斿洖鏌愪竴涓猘ction鎵瀵瑰簲鐨勫瓧娈典慨鏀硅褰曘*/ + public function getHistory($actionID) + { + return $this->dao->select()->from(TABLE_HISTORY)->where('action')->in($actionID)->orderBy('id')->fetchGroup('action'); + } + + /* 璁板綍鍘嗗彶銆*/ + public function logHistory($actionID, $changes) + { + foreach($changes as $change) + { + $change['action'] = $actionID; + $this->dao->insert(TABLE_HISTORY)->data($change)->exec(); + } + } + + /* 鎵撳嵃action鏍囬锛屾樉绀哄湪姣忎竴涓璞$殑璇︽儏鐣岄潰銆*/ + public function printAction($action) + { + $objectType = $action->objectType; + $actionType = strtolower($action->action); + + /** + * 鍒ゆ柇浣跨敤鍝竴绉嶆弿杩般傚鏋滆妯″潡鏈夊搴旂殑鎻忚堪锛屽垯鍙栦箣锛岀劧鍚庡垯鍙朼ction妯″潡涓搴旂殑鏂规硶鐨勬弿杩般 + * 濡傛灉杩樻病鏈夛紝鍒欏垽鏂綋鍓峚ction鏄惁鏈塭xtra淇℃伅锛屽鏋滄湁锛屽垯鍙朼ction妯″潡鐨別xtra鎻忚堪锛屾渶鍚庝娇鐢ㄩ氱敤鐨勬弿杩般 + */ + if(isset($this->lang->$objectType->action->$actionType)) + { + $desc = $this->lang->$objectType->action->$actionType; + } + elseif(isset($this->lang->action->desc->$actionType)) + { + $desc = $this->lang->action->desc->$actionType; + } + else + { + $desc = $action->extra ? $this->lang->action->desc->extra : $this->lang->action->desc->common; + } + + /* 寰幆鏇挎崲desc涓搴旂殑鏍囩銆*/ + foreach($action as $key => $value) + { + if($key == 'history') continue; + + /* desc鍙兘鏄暟缁勶紝涔熸湁鍙兘鏄竴涓瓧绗︿覆銆*/ + if(is_array($desc)) + { + if($key == 'extra') continue; + $desc['main'] = str_replace('$' . $key, $value, $desc['main']); + } + else + { + $desc = str_replace('$' . $key, $value, $desc); + } + } + + /* 濡傛灉desc鏄暟缁勶紝鍐嶅鐞唀xtra鍙橀噺銆備緥瀛愬弬鑰僢ug妯″潡鐨勮瑷璁剧疆銆*/ + if(is_array($desc)) + { + $extra = strtolower($action->extra); + if(isset($desc['extra'][$extra])) + { + echo str_replace('$extra', $desc['extra'][$extra], $desc['main']); + } + else + { + echo str_replace('$extra', $action->extra, $desc['main']); + } + } + else + { + echo $desc; + } + } + + /* 鎵撳嵃鍔ㄦ佷俊鎭*/ + public function getDynamic($objectType = 'all', $count = 30) + { + $actions = $this->dao->select('*')->from(TABLE_ACTION) + ->onCaseOf($objectType != 'all')->where('objectType')->eq($objectType)->endCase() + ->orderBy('id desc')->limit($count)->fetchAll(); + if(!$actions) return array(); + foreach($actions as $action) + { + $actionType = strtolower($action->action); + $objectType = strtolower($action->objectType); + $action->date = date(DT_MONTHTIME2, strtotime($action->date)); + $action->actionLabel = isset($this->lang->action->label->$actionType) ? $this->lang->action->label->$actionType : $action->action; + $action->objectLabel = isset($this->lang->action->label->$objectType) ? $this->lang->action->label->$objectType : $objectType; + + /* 澶勭悊login鍜宭ogout鍔ㄤ綔銆*/ + if($actionType == 'login' or $actionType == 'logout') + { + $action->objectLink = ''; + $action->objectLabel = ''; + continue; + } + + /* 鍏朵粬鐨勫姩浣滅敓鎴愮浉搴旂殑閾炬帴銆*/ + if(strpos($action->objectLabel, '|') !== false) + { + list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); + $action->objectLink = html::a(helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)), '#' . $action->objectID); + $action->objectLabel = $objectLabel; + } + else + { + $action->objectLink = '#' . $action->objectID; + } + } + return $actions; + } + + /* 鎵撳嵃淇敼璁板綍銆*/ + public function printChanges($objectType, $histories) + { + if(empty($histories)) return; + + /* 璁$畻瀛楁鐨勬渶澶ч暱搴︼紝骞跺皢鍘嗗彶璁板綍鏍规嵁鏄惁鏈塪iff鍒嗗紑锛屼互淇濊瘉鍚湁diff鐨勫瓧娈垫樉绀哄湪鏈鍚庨潰銆*/ + $maxLength = 0; + $historiesWithDiff = array(); + $historiesWithoutDiff = array(); + + foreach($histories as $history) + { + $fieldName = $history->field; + $history->fieldLabel = isset($this->lang->$objectType->$fieldName) ? $this->lang->$objectType->$fieldName : $fieldName; + if(($length = strlen($history->fieldLabel)) > $maxLength) $maxLength = $length; + $history->diff ? $historiesWithDiff[] = $history : $historiesWithoutDiff[] = $history; + } + $histories = array_merge($historiesWithoutDiff, $historiesWithDiff); + + foreach($histories as $history) + { + $history->fieldLabel = str_pad($history->fieldLabel, $maxLength, $this->lang->action->label->space); + if($history->diff != '') + { + printf($this->lang->action->desc->diff2, $history->fieldLabel, nl2br($history->diff)); + } + else + { + printf($this->lang->action->desc->diff1, $history->fieldLabel, $history->old, $history->new); + } + } + } +} diff --git a/trunk/module/action/view/trash.html.php b/trunk/module/action/view/trash.html.php index 0aee7b4aef..059d1b71a9 100644 --- a/trunk/module/action/view/trash.html.php +++ b/trunk/module/action/view/trash.html.php @@ -1,56 +1,56 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package action - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - - -
- - recTotal}&recPerPage={$pager->recPerPage}"; ?> - - - - - - - - - - - - - objectType == 'case' ? 'testcase' : $action->objectType;?> - - - - - - - - - -
action->objectType);?>idAB);?>action->objectName;?>action->actor);?>action->date);?>actions;?>
action->objectTypes[$action->objectType];?>objectID;?>createLink($module, 'view', "id=$action->objectID"), $action->objectName);?>actor];?>date;?>id", $lang->action->undelete, 'hiddenwin');?> -
-
show();?>
-
- +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package action + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + + +
+ + recTotal}&recPerPage={$pager->recPerPage}"; ?> + + + + + + + + + + + + + objectType == 'case' ? 'testcase' : $action->objectType;?> + + + + + + + + + +
action->objectType);?>idAB);?>action->objectName;?>action->actor);?>action->date);?>actions;?>
action->objectTypes[$action->objectType];?>objectID;?>createLink($module, 'view', "id=$action->objectID"), $action->objectName);?>actor];?>date;?>id", $lang->action->undelete, 'hiddenwin');?> +
+
show();?>
+
+ diff --git a/trunk/module/admin/control.php b/trunk/module/admin/control.php index 1ac7b4a825..ef84ce0382 100644 --- a/trunk/module/admin/control.php +++ b/trunk/module/admin/control.php @@ -1,31 +1,31 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package admin - * @version $Id$ - * @link http://www.zentao.cn - */ -class admin extends control -{ - /* 棣栭〉銆*/ - public function index($tab = 'index') - { - $this->locate($this->createLink('action', 'trash')); - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package admin + * @version $Id$ + * @link http://www.zentaoms.com + */ +class admin extends control +{ + /* 棣栭〉銆*/ + public function index($tab = 'index') + { + $this->locate($this->createLink('action', 'trash')); + } +} diff --git a/trunk/module/admin/lang/en.php b/trunk/module/admin/lang/en.php index b5b6806297..806e9d7a2c 100644 --- a/trunk/module/admin/lang/en.php +++ b/trunk/module/admin/lang/en.php @@ -1,33 +1,33 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package admin - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->admin->common = '鍚庡彴绠$悊'; -$lang->admin->index = '鍚庡彴绠$悊棣栭〉'; -$lang->admin->company = '鍏徃绠$悊'; -$lang->admin->user = '鐢ㄦ埛绠$悊'; -$lang->admin->group = '鍒嗙粍绠$悊'; -$lang->admin->welcome = '娆㈣繋浣跨敤绂呴亾绠$悊杞欢鍚庡彴绠$悊绯荤粺'; - -$lang->admin->browseCompany = '娴忚鍏徃'; -$lang->admin->browseUser = '娴忚鐢ㄦ埛'; -$lang->admin->browseGroup = '娴忚鍒嗙粍'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package admin + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->admin->common = '鍚庡彴绠$悊'; +$lang->admin->index = '鍚庡彴绠$悊棣栭〉'; +$lang->admin->company = '鍏徃绠$悊'; +$lang->admin->user = '鐢ㄦ埛绠$悊'; +$lang->admin->group = '鍒嗙粍绠$悊'; +$lang->admin->welcome = '娆㈣繋浣跨敤绂呴亾绠$悊杞欢鍚庡彴绠$悊绯荤粺'; + +$lang->admin->browseCompany = '娴忚鍏徃'; +$lang->admin->browseUser = '娴忚鐢ㄦ埛'; +$lang->admin->browseGroup = '娴忚鍒嗙粍'; diff --git a/trunk/module/admin/lang/zh-cn.php b/trunk/module/admin/lang/zh-cn.php index 9996081d31..c8053651a3 100644 --- a/trunk/module/admin/lang/zh-cn.php +++ b/trunk/module/admin/lang/zh-cn.php @@ -1,31 +1,31 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package admin - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->admin->common = '鍚庡彴绠$悊'; -$lang->admin->index = '鍚庡彴绠$悊棣栭〉'; -$lang->admin->company = '鍏徃绠$悊'; -$lang->admin->user = '鐢ㄦ埛绠$悊'; -$lang->admin->group = '鍒嗙粍绠$悊'; -$lang->admin->welcome = '娆㈣繋浣跨敤绂呴亾绠$悊杞欢鍚庡彴绠$悊绯荤粺'; - -$lang->admin->browseCompany = '娴忚鍏徃'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package admin + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->admin->common = '鍚庡彴绠$悊'; +$lang->admin->index = '鍚庡彴绠$悊棣栭〉'; +$lang->admin->company = '鍏徃绠$悊'; +$lang->admin->user = '鐢ㄦ埛绠$悊'; +$lang->admin->group = '鍒嗙粍绠$悊'; +$lang->admin->welcome = '娆㈣繋浣跨敤绂呴亾绠$悊杞欢鍚庡彴绠$悊绯荤粺'; + +$lang->admin->browseCompany = '娴忚鍏徃'; diff --git a/trunk/module/admin/model.php b/trunk/module/admin/model.php index b979e98b15..ac98ab378f 100644 --- a/trunk/module/admin/model.php +++ b/trunk/module/admin/model.php @@ -1,44 +1,44 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package admin - * @version $Id$ - * @link http://www.zentao.cn - */ -?> -dbh->query($sql)->fetchALL(); - } - - /* 鑾峰緱鏌愪竴涓叕鍙哥殑缁熻淇℃伅銆*/ - public function getStatOfCompany($companyID) - { - } - - /* 鑾峰緱绯荤粺鐨勮繍琛屼俊鎭*/ - public function getStatOfSys() - { - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package admin + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> +dbh->query($sql)->fetchALL(); + } + + /* 鑾峰緱鏌愪竴涓叕鍙哥殑缁熻淇℃伅銆*/ + public function getStatOfCompany($companyID) + { + } + + /* 鑾峰緱绯荤粺鐨勮繍琛屼俊鎭*/ + public function getStatOfSys() + { + } +} diff --git a/trunk/module/admin/view/browsecompany.html.php b/trunk/module/admin/view/browsecompany.html.php index b559542fd2..3c120678e1 100644 --- a/trunk/module/admin/view/browsecompany.html.php +++ b/trunk/module/admin/view/browsecompany.html.php @@ -1,61 +1,61 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package admin - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
company->id;?>company->name;?>company->phone;?>company->fax;?>company->address;?>company->zipcode;?>company->website;?>company->backyard;?>company->pms;?>company->guest;?>actions;?>
id;?>name;?>phone;?>fax;?>address;?>zipcode;?>website, $company->website, '_blank');?>backyard,$company->backyard, '_blank');?>pms, $company->pms, '_blank');?>company->guestList[(int)$company->guest];?> - createLink('company', 'edit', "companyID=$company->id"), $this->lang->company->edit);?> - createLink('company', 'delete', "companyID=$company->id"), $this->lang->company->delete, "hiddenwin");?> -
-
- +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package admin + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
company->id;?>company->name;?>company->phone;?>company->fax;?>company->address;?>company->zipcode;?>company->website;?>company->backyard;?>company->pms;?>company->guest;?>actions;?>
id;?>name;?>phone;?>fax;?>address;?>zipcode;?>website, $company->website, '_blank');?>backyard,$company->backyard, '_blank');?>pms, $company->pms, '_blank');?>company->guestList[(int)$company->guest];?> + createLink('company', 'edit', "companyID=$company->id"), $this->lang->company->edit);?> + createLink('company', 'delete', "companyID=$company->id"), $this->lang->company->delete, "hiddenwin");?> +
+
+ diff --git a/trunk/module/api/control.php b/trunk/module/api/control.php index 25c5d42d48..be3336f6a7 100644 --- a/trunk/module/api/control.php +++ b/trunk/module/api/control.php @@ -1,43 +1,43 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package api - * @version $Id$ - * @link http://www.zentao.cn - */ -class api extends control -{ - /* 鑾峰緱sessionid銆*/ - public function getSessionID() - { - $this->view->sessionName = session_name(); - $this->view->sessionID = session_id(); - $this->display(); - } - - /* 鑾峰緱鏌愪竴涓猰odel鏌愪竴涓柟娉曠殑缁撴灉銆俻arams鐨勪紶閫掓柟寮忥細param1=value1,param2=value2銆*/ - public function getModel($moduleName, $methodName, $params = '') - { - parse_str(str_replace(',', '&', $params), $params); - $module = $this->loadModel($moduleName); - $result = call_user_func_array(array(&$module, $methodName), $params); - if(dao::isError()) die(json_encode(dao::getError())); - die(json_encode($result)); - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package api + * @version $Id$ + * @link http://www.zentaoms.com + */ +class api extends control +{ + /* 鑾峰緱sessionid銆*/ + public function getSessionID() + { + $this->view->sessionName = session_name(); + $this->view->sessionID = session_id(); + $this->display(); + } + + /* 鑾峰緱鏌愪竴涓猰odel鏌愪竴涓柟娉曠殑缁撴灉銆俻arams鐨勪紶閫掓柟寮忥細param1=value1,param2=value2銆*/ + public function getModel($moduleName, $methodName, $params = '') + { + parse_str(str_replace(',', '&', $params), $params); + $module = $this->loadModel($moduleName); + $result = call_user_func_array(array(&$module, $methodName), $params); + if(dao::isError()) die(json_encode(dao::getError())); + die(json_encode($result)); + } +} diff --git a/trunk/module/api/lang/zh-cn.php b/trunk/module/api/lang/zh-cn.php index 5043b78070..93433db69c 100644 --- a/trunk/module/api/lang/zh-cn.php +++ b/trunk/module/api/lang/zh-cn.php @@ -1,25 +1,25 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package api - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->api->common = 'API鎺ュ彛'; -$lang->api->getModel = '瓒呯骇model璋冪敤鎺ュ彛'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package api + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->api->common = 'API鎺ュ彛'; +$lang->api->getModel = '瓒呯骇model璋冪敤鎺ュ彛'; diff --git a/trunk/module/bug/control.php b/trunk/module/bug/control.php index bf00737b82..c8fba64d6d 100644 --- a/trunk/module/bug/control.php +++ b/trunk/module/bug/control.php @@ -1,535 +1,535 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -class bug extends control -{ - private $products = array(); - - /* 鏋勯犲嚱鏁帮紝鍔犺浇story, release, tree绛夋ā鍧椼*/ - public function __construct() - { - parent::__construct(); - $this->loadModel('product'); - $this->loadModel('tree'); - $this->loadModel('user'); - $this->loadModel('action'); - $this->loadModel('story'); - $this->loadModel('task'); - $this->products = $this->product->getPairs(); - if(empty($this->products)) $this->locate($this->createLink('product', 'create')); - $this->assign('products', $this->products); - } - - /* bug棣栭〉銆*/ - public function index() - { - $this->locate($this->createLink('bug', 'browse')); - } - - /* 娴忚涓涓骇鍝佷笅闈㈢殑bug銆*/ - public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) - { - /* 璁剧疆浜у搧id鍜屾ā鍧梚d銆*/ - $browseType = strtolower($browseType); - $productID = common::saveProductState($productID, key($this->products)); - $moduleID = ($browseType == 'bymodule') ? (int)$param : 0; - - /* 璁剧疆鎼滅储琛ㄥ崟銆*/ - $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&browseType=bySearch"); - $this->config->bug->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->bug->allProduct); - $this->config->bug->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0); - $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID); - $this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->bug->search); - - /* 璁剧疆鑿滃崟锛岀櫥璁皊ession銆*/ - $this->bug->setMenu($this->products, $productID); - $this->session->set('bugList', $this->app->getURI(true)); - - /* 鍔犺浇鍒嗛〉绫汇*/ - $this->app->loadClass('pager', $static = true); - $pager = pager::init($recTotal, $recPerPage, $pageID); - - $bugs = array(); - if($browseType == 'all') - { - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq($productID) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == "bymodule") - { - $childModuleIds = $this->tree->getAllChildId($moduleID); - $bugs = $this->bug->getModuleBugs($productID, $childModuleIds, $orderBy, $pager); - } - elseif($browseType == 'assigntome') - { - $bugs = $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == 'openedbyme') - { - $bugs = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == 'resolvedbyme') - { - $bugs = $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == 'assigntonull') - { - $bugs = $this->dao->findByAssignedTo('')->from(TABLE_BUG)->andWhere('product')->eq($productID) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == 'longlifebugs') - { - $bugs = $this->dao->findByLastEditedDate("<", date(DT_DATE1, strtotime('-7 days')))->from(TABLE_BUG)->andWhere('product')->eq($productID) - ->andWhere('deleted')->eq(0) - ->andWhere('status')->ne('closed')->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == 'postponedbugs') - { - $bugs = $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->eq($productID) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - elseif($browseType == 'needconfirm') - { - $bugs = $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->where("t2.status = 'active'") - ->andWhere('t1.deleted')->eq(0) - ->andWhere('t2.version > t1.storyVersion') - ->orderBy($orderBy) - ->fetchAll(); - } - elseif($browseType == 'bysearch') - { - if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1'); - $bugQuery = str_replace("`product` = 'all'", '1', $this->session->bugQuery); // 濡傛灉鎸囧畾浜嗘悳绱㈡墍鏈夌殑浜у搧锛屽幓鎺夎繖涓煡璇㈡潯浠躲 - $bugs = $this->dao->select('*')->from(TABLE_BUG)->where($bugQuery) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - - /* 澶勭悊鏌ヨ璇彞锛岃幏鍙栨潯浠堕儴鍒嗭紝骞惰褰晄ession銆傞渶姹傚緟纭鐨勶紝涓嶅弬涓庢姤琛ㄧ粺璁°*/ - if($browseType != 'needconfirm') - { - $sql = explode('WHERE', $this->dao->get()); - $sql = explode('ORDER', $sql[1]); - $this->session->set('bugReportCondition', $sql[0]); - } - - $users = $this->user->getPairs('noletter'); - - $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; - $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $position[] = $this->lang->bug->common; - - $this->assign('header', $header); - $this->assign('position', $position); - $this->assign('productID', $productID); - $this->assign('productName', $this->products[$productID]); - $this->assign('moduleTree', $this->tree->getTreeMenu($productID, $viewType = 'bug', $rooteModuleID = 0, array('treeModel', 'createBugLink'))); - $this->assign('browseType', $browseType); - $this->assign('bugs', $bugs); - $this->assign('users', $users); - $this->assign('pager', $pager); - $this->assign('param', $param); - $this->assign('orderBy', $orderBy); - $this->assign('moduleID', $moduleID); - - $this->display(); - } - - /* 缁熻鎶ヨ〃銆*/ - public function report($productID, $browseType, $moduleID) - { - $this->loadModel('report'); - $this->view->charts = array(); - $this->view->rendJS = ''; - - if(!empty($_POST)) - { - foreach($this->post->charts as $chart) - { - $chartFunc = 'getDataOf' . $chart; - $chartData = $this->bug->$chartFunc(); - $chartOption = $this->lang->bug->report->$chart; - $this->bug->mergeChartOption($chart); - - $chartXML = $this->report->createSingleXML($chartData, $chartOption->graph); - $this->view->charts[$chart] = $this->report->createJSChart($chartOption->swf, $chartXML, $chartOption->width, $chartOption->height); - $this->view->datas[$chart] = $this->report->computePercent($chartData); - } - $this->view->rendJS = $this->report->rendJsCharts(count($this->view->charts)); - } - - $this->bug->setMenu($this->products, $productID); - $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; - $this->view->productID = $productID; - $this->view->browseType = $browseType; - $this->view->moduleID = $moduleID; - $this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : ''; - $this->display(); - } - - /* 鍒涘缓Bug銆俥xtras鏄叾浠栫殑鍙傛暟锛宬ey鍜寁alue涔嬮棿浣跨敤=杩炴帴锛屽涓敭鍊煎涔嬮棿浣跨敤,闅斿紑銆*/ - public function create($productID, $extras = '') - { - if(empty($this->products)) $this->locate($this->createLink('product', 'create')); - - if(!empty($_POST)) - { - $bugID = $this->bug->create(); - if(dao::isError()) die(js::error(dao::getError())); - $actionID = $this->action->create('bug', $bugID, 'Opened'); - $this->sendmail($bugID, $actionID); - die(js::locate($this->createLink('bug', 'browse', "productID={$this->post->product}&type=byModule¶m={$this->post->module}"), 'parent')); - } - - /* 璁剧疆褰撳墠鐨勪骇鍝侊紝璁剧疆鑿滃崟銆*/ - $productID = common::saveProductState($productID, key($this->products)); - $this->bug->setMenu($this->products, $productID); - - /* 鍘绘帀鍑犱釜绫诲瀷鐨勮缃*/ - unset($this->lang->bug->typeList['designchange']); - unset($this->lang->bug->typeList['newfeature']); - unset($this->lang->bug->typeList['trackthings']); - - /* 鍒濆鍖栧彉閲忋*/ - $moduleID = 0; - $projectID = 0; - $taskID = 0; - $storyID = 0; - $buildID = 0; - $caseID = 0; - $runID = 0; - $title = ''; - $steps = ''; - - /* 瑙f瀽extra鍙傛暟銆*/ - $extras = str_replace(array(',', ' '), array('&', ''), $extras); - parse_str($extras); - - /* 濡傛灉璁剧疆浜唕unID锛岃幏寰楁渶鍚庝竴娆$殑resultID銆*/ - if($runID > 0) $resultID = $this->dao->select('id')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->limit(1)->fetch('id'); - if(isset($resultID) and $resultID > 0) extract($this->bug->getBugInfoFromResult($resultID)); - - /* 濡傛灉鎸囧畾浜嗛」鐩紝鍒欐煡鎵鹃」鐩寖鍥村唴鐨刡uild鍜宻tory銆*/ - if($projectID) - { - $builds = $this->loadModel('build')->getProjectBuildPairs($projectID, 'noempty'); - $stories = $this->story->getProjectStoryPairs($projectID); - } - else - { - $builds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); - $stories = $this->story->getProductStoryPairs($productID); - } - - /* 浣嶇疆淇℃伅銆*/ - $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->create; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $this->view->position[] = $this->lang->bug->create; - - $this->view->productID = $productID; - $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0); - $this->view->stories = $stories; - $this->view->users = $this->user->getPairs('noclosed'); - $this->view->projects = $this->product->getProjectPairs($productID); - $this->view->builds = $builds; - $this->view->tasks = $this->loadModel('task')->getProjectTaskPairs($projectID); - $this->view->moduleID = $moduleID; - $this->view->projectID = $projectID; - $this->view->taskID = $taskID; - $this->view->storyID = $storyID; - $this->view->buildID = $buildID; - $this->view->caseID = $caseID; - $this->view->title = $title; - $this->view->steps = $steps; - $this->display(); - } - - /* 鏌ョ湅涓涓猙ug銆*/ - public function view($bugID) - { - /* 鏌ユ壘bug淇℃伅鍙婄浉鍏充骇鍝佷俊鎭*/ - $bug = $this->bug->getById($bugID); - if(!$bug) die(js::error($this->lang->notFound) . js::locate('back')); - - $productID = $bug->product; - $productName = $this->products[$productID]; - - /* 璁剧疆鑿滃崟銆*/ - $this->bug->setMenu($this->products, $productID); - - /* 浣嶇疆淇℃伅銆*/ - $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->view; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName); - $this->view->position[] = $this->lang->bug->view; - - /* 璧嬪笺*/ - $this->view->productName = $productName; - $this->view->modulePath = $this->tree->getParents($bug->module); - $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('noletter'); - $this->view->actions = $this->action->getList('bug', $bugID); - $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); - - $this->display(); - } - - /* 缂栬緫涓涓狟ug銆*/ - public function edit($bugID) - { - /* 鏇存柊bug淇℃伅銆*/ - if(!empty($_POST)) - { - $changes = $this->bug->update($bugID); - if(dao::isError()) die(js::error(dao::getError())); - $files = $this->loadModel('file')->saveUpload('bug', $bugID); - if($this->post->comment != '' or !empty($changes) or !empty($files)) - { - $action = !empty($changes) ? 'Edited' : 'Commented'; - $fileAction = ''; - if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ; - $actionID = $this->action->create('bug', $bugID, $action, $fileAction . $this->post->comment); - $this->action->logHistory($actionID, $changes); - $this->sendmail($bugID, $actionID); - } - die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); - } - - /* 鏌ユ壘褰撳墠bug淇℃伅鍜屼骇鍝佹ā鍧椾俊鎭*/ - $bug = $this->bug->getById($bugID); - $productID = $bug->product; - $currentModuleID = $bug->module; - - /* 淇敼绫诲瀷鐨勯厤缃*/ - if($bug->type != 'designchange') unset($this->lang->bug->typeList['designchange']); - if($bug->type != 'newfeature') unset($this->lang->bug->typeList['newfeature']); - if($bug->type != 'trackthings') unset($this->lang->bug->typeList['trackthings']); - - /* 璁剧疆鑿滃崟銆*/ - $this->bug->setMenu($this->products, $productID); - - /* 浣嶇疆銆*/ - $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->edit; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $this->view->position[] = $this->lang->bug->edit; - - /* 璧嬪笺*/ - $this->view->bug = $bug; - $this->view->productID = $productID; - $this->view->productName = $this->products[$productID]; - $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0); - $this->view->currentModuleID = $currentModuleID; - $this->view->projects = $this->product->getProjectPairs($bug->product); - $this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product); - $this->view->tasks = $this->task->getProjectTaskPairs($bug->project); - $this->view->users = $this->user->getPairs(); - $this->view->openedBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); - $this->view->resolvedBuilds = array('' => '') + $this->view->openedBuilds; - $this->view->actions = $this->action->getList('bug', $bugID); - - $this->display(); - } - - /* 瑙e喅bug銆*/ - public function resolve($bugID) - { - /* 鏇存柊bug淇℃伅銆*/ - if(!empty($_POST)) - { - $this->bug->resolve($bugID); - if(dao::isError()) die(js::error(dao::getError())); - $actionID = $this->action->create('bug', $bugID, 'Resolved', $this->post->comment, $this->post->resolution); - $this->sendmail($bugID, $actionID); - die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); - } - - /* 鏌ユ壘bug鍜屼骇鍝佷俊鎭*/ - $bug = $this->bug->getById($bugID); - $productID = $bug->product; - - /* 璁剧疆鑿滃崟銆*/ - $this->bug->setMenu($this->products, $productID); - - /* 浣嶇疆銆*/ - $this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $this->view->position[] = $this->lang->bug->resolve; - - /* 璧嬪笺*/ - $this->view->bug = $bug; - $this->view->users = $this->user->getPairs(); - $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); - $this->view->actions = $this->action->getList('bug', $bugID); - $this->display(); - } - - /* 婵娲籦ug銆*/ - public function activate($bugID) - { - /* 鏇存柊bug淇℃伅銆*/ - if(!empty($_POST)) - { - $this->bug->activate($bugID); - if(dao::isError()) die(js::error(dao::getError())); - $files = $this->loadModel('file')->saveUpload('bug', $bugID); - $actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment); - $this->sendmail($bugID, $actionID); - die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); - } - - /* 鑾峰緱bug鍜屼骇鍝佷俊鎭*/ - $bug = $this->bug->getById($bugID); - $productID = $bug->product; - - /* 璁剧疆鑿滃崟銆*/ - $this->bug->setMenu($this->products, $productID); - - /* 褰撳墠浣嶇疆銆*/ - $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $this->view->position[] = $this->lang->bug->activate; - - /* 璧嬪笺*/ - $this->view->bug = $bug; - $this->view->users = $this->user->getPairs(); - $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); - $this->view->actions = $this->action->getList('bug', $bugID); - - $this->display(); - } - - /* 婵娲籦ug銆*/ - public function close($bugID) - { - /* 鏇存柊bug淇℃伅銆*/ - if(!empty($_POST)) - { - $this->bug->close($bugID); - if(dao::isError()) die(js::error(dao::getError())); - $actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment); - $this->sendmail($bugID, $actionID); - die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); - } - - /* bug鍜屼骇鍝佷俊鎭*/ - $bug = $this->bug->getById($bugID); - $productID = $bug->product; - - /* 璁剧疆鑿滃崟銆*/ - $this->bug->setMenu($this->products, $productID); - - $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; - $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); - $this->view->position[] = $this->lang->bug->activate; - - $this->view->bug = $bug; - $this->view->users = $this->user->getPairs(); - $this->view->actions = $this->action->getList('bug', $bugID); - $this->display(); - } - - /* 纭闇姹傚彉鍔ㄣ*/ - public function confirmStoryChange($bugID) - { - $bug = $this->bug->getById($bugID); - $this->dao->update(TABLE_BUG)->set('storyVersion')->eq($bug->latestStoryVersion)->where('id')->eq($bugID)->exec(); - $this->loadModel('action')->create('bug', $bugID, 'confirmed', '', $bug->latestStoryVersion); - die(js::reload('parent')); - } - - /* 鍒犻櫎bug銆*/ - public function delete($bugID, $confirm = 'no') - { - if($confirm == 'no') - { - die(js::confirm($this->lang->bug->confirmDelete, inlink('delete', "bugID=$bugID&confirm=yes"))); - } - else - { - $this->bug->delete(TABLE_BUG, $bugID); - die(js::locate($this->session->bugList, 'parent')); - } - } - - /* 鑾峰緱鐢ㄦ埛鐨刡ug鍒楄〃銆*/ - public function ajaxGetUserBugs($account = '') - { - if($account == '') $account = $this->app->user->account; - $bugs = $this->bug->getUserBugPairs($account); - die(html::select('bug', $bugs, '', 'class=select-1')); - } - - /* 鍙戦侀偖浠躲*/ - private function sendmail($bugID, $actionID) - { - /* 璁惧畾toList鍜宑cList銆*/ - $bug = $this->bug->getByID($bugID); - $toList = $bug->assignedTo; - $ccList = trim($bug->mailto, ','); - if($toList == '') - { - if($ccList == '') return; - if(strpos($ccList, ',') === false) - { - $toList = $ccList; - $ccList = ''; - } - else - { - $commaPos = strpos($ccList, ','); - $toList = substr($ccList, 0, $commaPos); - $ccList = substr($ccList, $commaPos + 1); - } - } - elseif(strtolower($toList) == 'closed') - { - $toList = $bug->resolvedBy; - } - - /* 鑾峰緱action淇℃伅銆*/ - $action = $this->action->getById($actionID); - $history = $this->action->getHistory($actionID); - $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); - if(strtolower($action->action) == 'opened') $action->comment = $bug->steps; - - /* 璧嬪硷紝鑾峰緱閭欢鍐呭銆*/ - $this->assign('bug', $bug); - $this->assign('action', $action); - $mailContent = $this->parse($this->moduleName, 'sendmail'); - - /* 鍙戜俊銆*/ - $this->loadModel('mail')->send($toList, 'BUG #' . $bug->id . $this->lang->colon . $bug->title, $mailContent, $ccList); - if($this->mail->isError()) echo js::error($this->mail->getError()); - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +class bug extends control +{ + private $products = array(); + + /* 鏋勯犲嚱鏁帮紝鍔犺浇story, release, tree绛夋ā鍧椼*/ + public function __construct() + { + parent::__construct(); + $this->loadModel('product'); + $this->loadModel('tree'); + $this->loadModel('user'); + $this->loadModel('action'); + $this->loadModel('story'); + $this->loadModel('task'); + $this->products = $this->product->getPairs(); + if(empty($this->products)) $this->locate($this->createLink('product', 'create')); + $this->assign('products', $this->products); + } + + /* bug棣栭〉銆*/ + public function index() + { + $this->locate($this->createLink('bug', 'browse')); + } + + /* 娴忚涓涓骇鍝佷笅闈㈢殑bug銆*/ + public function browse($productID = 0, $browseType = 'byModule', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + /* 璁剧疆浜у搧id鍜屾ā鍧梚d銆*/ + $browseType = strtolower($browseType); + $productID = common::saveProductState($productID, key($this->products)); + $moduleID = ($browseType == 'bymodule') ? (int)$param : 0; + + /* 璁剧疆鎼滅储琛ㄥ崟銆*/ + $this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&browseType=bySearch"); + $this->config->bug->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->bug->allProduct); + $this->config->bug->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0); + $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID); + $this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->bug->search); + + /* 璁剧疆鑿滃崟锛岀櫥璁皊ession銆*/ + $this->bug->setMenu($this->products, $productID); + $this->session->set('bugList', $this->app->getURI(true)); + + /* 鍔犺浇鍒嗛〉绫汇*/ + $this->app->loadClass('pager', $static = true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + + $bugs = array(); + if($browseType == 'all') + { + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == "bymodule") + { + $childModuleIds = $this->tree->getAllChildId($moduleID); + $bugs = $this->bug->getModuleBugs($productID, $childModuleIds, $orderBy, $pager); + } + elseif($browseType == 'assigntome') + { + $bugs = $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == 'openedbyme') + { + $bugs = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == 'resolvedbyme') + { + $bugs = $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == 'assigntonull') + { + $bugs = $this->dao->findByAssignedTo('')->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == 'longlifebugs') + { + $bugs = $this->dao->findByLastEditedDate("<", date(DT_DATE1, strtotime('-7 days')))->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->andWhere('status')->ne('closed')->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == 'postponedbugs') + { + $bugs = $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->eq($productID) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + elseif($browseType == 'needconfirm') + { + $bugs = $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->where("t2.status = 'active'") + ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.version > t1.storyVersion') + ->orderBy($orderBy) + ->fetchAll(); + } + elseif($browseType == 'bysearch') + { + if($this->session->bugQuery == false) $this->session->set('bugQuery', ' 1 = 1'); + $bugQuery = str_replace("`product` = 'all'", '1', $this->session->bugQuery); // 濡傛灉鎸囧畾浜嗘悳绱㈡墍鏈夌殑浜у搧锛屽幓鎺夎繖涓煡璇㈡潯浠躲 + $bugs = $this->dao->select('*')->from(TABLE_BUG)->where($bugQuery) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + + /* 澶勭悊鏌ヨ璇彞锛岃幏鍙栨潯浠堕儴鍒嗭紝骞惰褰晄ession銆傞渶姹傚緟纭鐨勶紝涓嶅弬涓庢姤琛ㄧ粺璁°*/ + if($browseType != 'needconfirm') + { + $sql = explode('WHERE', $this->dao->get()); + $sql = explode('ORDER', $sql[1]); + $this->session->set('bugReportCondition', $sql[0]); + } + + $users = $this->user->getPairs('noletter'); + + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; + $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $position[] = $this->lang->bug->common; + + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('productID', $productID); + $this->assign('productName', $this->products[$productID]); + $this->assign('moduleTree', $this->tree->getTreeMenu($productID, $viewType = 'bug', $rooteModuleID = 0, array('treeModel', 'createBugLink'))); + $this->assign('browseType', $browseType); + $this->assign('bugs', $bugs); + $this->assign('users', $users); + $this->assign('pager', $pager); + $this->assign('param', $param); + $this->assign('orderBy', $orderBy); + $this->assign('moduleID', $moduleID); + + $this->display(); + } + + /* 缁熻鎶ヨ〃銆*/ + public function report($productID, $browseType, $moduleID) + { + $this->loadModel('report'); + $this->view->charts = array(); + $this->view->rendJS = ''; + + if(!empty($_POST)) + { + foreach($this->post->charts as $chart) + { + $chartFunc = 'getDataOf' . $chart; + $chartData = $this->bug->$chartFunc(); + $chartOption = $this->lang->bug->report->$chart; + $this->bug->mergeChartOption($chart); + + $chartXML = $this->report->createSingleXML($chartData, $chartOption->graph); + $this->view->charts[$chart] = $this->report->createJSChart($chartOption->swf, $chartXML, $chartOption->width, $chartOption->height); + $this->view->datas[$chart] = $this->report->computePercent($chartData); + } + $this->view->rendJS = $this->report->rendJsCharts(count($this->view->charts)); + } + + $this->bug->setMenu($this->products, $productID); + $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->common; + $this->view->productID = $productID; + $this->view->browseType = $browseType; + $this->view->moduleID = $moduleID; + $this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : ''; + $this->display(); + } + + /* 鍒涘缓Bug銆俥xtras鏄叾浠栫殑鍙傛暟锛宬ey鍜寁alue涔嬮棿浣跨敤=杩炴帴锛屽涓敭鍊煎涔嬮棿浣跨敤,闅斿紑銆*/ + public function create($productID, $extras = '') + { + if(empty($this->products)) $this->locate($this->createLink('product', 'create')); + + if(!empty($_POST)) + { + $bugID = $this->bug->create(); + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->action->create('bug', $bugID, 'Opened'); + $this->sendmail($bugID, $actionID); + die(js::locate($this->createLink('bug', 'browse', "productID={$this->post->product}&type=byModule¶m={$this->post->module}"), 'parent')); + } + + /* 璁剧疆褰撳墠鐨勪骇鍝侊紝璁剧疆鑿滃崟銆*/ + $productID = common::saveProductState($productID, key($this->products)); + $this->bug->setMenu($this->products, $productID); + + /* 鍘绘帀鍑犱釜绫诲瀷鐨勮缃*/ + unset($this->lang->bug->typeList['designchange']); + unset($this->lang->bug->typeList['newfeature']); + unset($this->lang->bug->typeList['trackthings']); + + /* 鍒濆鍖栧彉閲忋*/ + $moduleID = 0; + $projectID = 0; + $taskID = 0; + $storyID = 0; + $buildID = 0; + $caseID = 0; + $runID = 0; + $title = ''; + $steps = ''; + + /* 瑙f瀽extra鍙傛暟銆*/ + $extras = str_replace(array(',', ' '), array('&', ''), $extras); + parse_str($extras); + + /* 濡傛灉璁剧疆浜唕unID锛岃幏寰楁渶鍚庝竴娆$殑resultID銆*/ + if($runID > 0) $resultID = $this->dao->select('id')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->limit(1)->fetch('id'); + if(isset($resultID) and $resultID > 0) extract($this->bug->getBugInfoFromResult($resultID)); + + /* 濡傛灉鎸囧畾浜嗛」鐩紝鍒欐煡鎵鹃」鐩寖鍥村唴鐨刡uild鍜宻tory銆*/ + if($projectID) + { + $builds = $this->loadModel('build')->getProjectBuildPairs($projectID, 'noempty'); + $stories = $this->story->getProjectStoryPairs($projectID); + } + else + { + $builds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); + $stories = $this->story->getProductStoryPairs($productID); + } + + /* 浣嶇疆淇℃伅銆*/ + $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->create; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->create; + + $this->view->productID = $productID; + $this->view->productName = $this->products[$productID]; + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0); + $this->view->stories = $stories; + $this->view->users = $this->user->getPairs('noclosed'); + $this->view->projects = $this->product->getProjectPairs($productID); + $this->view->builds = $builds; + $this->view->tasks = $this->loadModel('task')->getProjectTaskPairs($projectID); + $this->view->moduleID = $moduleID; + $this->view->projectID = $projectID; + $this->view->taskID = $taskID; + $this->view->storyID = $storyID; + $this->view->buildID = $buildID; + $this->view->caseID = $caseID; + $this->view->title = $title; + $this->view->steps = $steps; + $this->display(); + } + + /* 鏌ョ湅涓涓猙ug銆*/ + public function view($bugID) + { + /* 鏌ユ壘bug淇℃伅鍙婄浉鍏充骇鍝佷俊鎭*/ + $bug = $this->bug->getById($bugID); + if(!$bug) die(js::error($this->lang->notFound) . js::locate('back')); + + $productID = $bug->product; + $productName = $this->products[$productID]; + + /* 璁剧疆鑿滃崟銆*/ + $this->bug->setMenu($this->products, $productID); + + /* 浣嶇疆淇℃伅銆*/ + $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->view; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName); + $this->view->position[] = $this->lang->bug->view; + + /* 璧嬪笺*/ + $this->view->productName = $productName; + $this->view->modulePath = $this->tree->getParents($bug->module); + $this->view->bug = $bug; + $this->view->users = $this->user->getPairs('noletter'); + $this->view->actions = $this->action->getList('bug', $bugID); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); + + $this->display(); + } + + /* 缂栬緫涓涓狟ug銆*/ + public function edit($bugID) + { + /* 鏇存柊bug淇℃伅銆*/ + if(!empty($_POST)) + { + $changes = $this->bug->update($bugID); + if(dao::isError()) die(js::error(dao::getError())); + $files = $this->loadModel('file')->saveUpload('bug', $bugID); + if($this->post->comment != '' or !empty($changes) or !empty($files)) + { + $action = !empty($changes) ? 'Edited' : 'Commented'; + $fileAction = ''; + if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ; + $actionID = $this->action->create('bug', $bugID, $action, $fileAction . $this->post->comment); + $this->action->logHistory($actionID, $changes); + $this->sendmail($bugID, $actionID); + } + die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + } + + /* 鏌ユ壘褰撳墠bug淇℃伅鍜屼骇鍝佹ā鍧椾俊鎭*/ + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + $currentModuleID = $bug->module; + + /* 淇敼绫诲瀷鐨勯厤缃*/ + if($bug->type != 'designchange') unset($this->lang->bug->typeList['designchange']); + if($bug->type != 'newfeature') unset($this->lang->bug->typeList['newfeature']); + if($bug->type != 'trackthings') unset($this->lang->bug->typeList['trackthings']); + + /* 璁剧疆鑿滃崟銆*/ + $this->bug->setMenu($this->products, $productID); + + /* 浣嶇疆銆*/ + $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->edit; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->edit; + + /* 璧嬪笺*/ + $this->view->bug = $bug; + $this->view->productID = $productID; + $this->view->productName = $this->products[$productID]; + $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0); + $this->view->currentModuleID = $currentModuleID; + $this->view->projects = $this->product->getProjectPairs($bug->product); + $this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product); + $this->view->tasks = $this->task->getProjectTaskPairs($bug->project); + $this->view->users = $this->user->getPairs(); + $this->view->openedBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty'); + $this->view->resolvedBuilds = array('' => '') + $this->view->openedBuilds; + $this->view->actions = $this->action->getList('bug', $bugID); + + $this->display(); + } + + /* 瑙e喅bug銆*/ + public function resolve($bugID) + { + /* 鏇存柊bug淇℃伅銆*/ + if(!empty($_POST)) + { + $this->bug->resolve($bugID); + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->action->create('bug', $bugID, 'Resolved', $this->post->comment, $this->post->resolution); + $this->sendmail($bugID, $actionID); + die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + } + + /* 鏌ユ壘bug鍜屼骇鍝佷俊鎭*/ + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + + /* 璁剧疆鑿滃崟銆*/ + $this->bug->setMenu($this->products, $productID); + + /* 浣嶇疆銆*/ + $this->view->header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->resolve; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->resolve; + + /* 璧嬪笺*/ + $this->view->bug = $bug; + $this->view->users = $this->user->getPairs(); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); + $this->view->actions = $this->action->getList('bug', $bugID); + $this->display(); + } + + /* 婵娲籦ug銆*/ + public function activate($bugID) + { + /* 鏇存柊bug淇℃伅銆*/ + if(!empty($_POST)) + { + $this->bug->activate($bugID); + if(dao::isError()) die(js::error(dao::getError())); + $files = $this->loadModel('file')->saveUpload('bug', $bugID); + $actionID = $this->action->create('bug', $bugID, 'Activated', $this->post->comment); + $this->sendmail($bugID, $actionID); + die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + } + + /* 鑾峰緱bug鍜屼骇鍝佷俊鎭*/ + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + + /* 璁剧疆鑿滃崟銆*/ + $this->bug->setMenu($this->products, $productID); + + /* 褰撳墠浣嶇疆銆*/ + $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->activate; + + /* 璧嬪笺*/ + $this->view->bug = $bug; + $this->view->users = $this->user->getPairs(); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); + $this->view->actions = $this->action->getList('bug', $bugID); + + $this->display(); + } + + /* 婵娲籦ug銆*/ + public function close($bugID) + { + /* 鏇存柊bug淇℃伅銆*/ + if(!empty($_POST)) + { + $this->bug->close($bugID); + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->action->create('bug', $bugID, 'Closed', $this->post->comment); + $this->sendmail($bugID, $actionID); + die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + } + + /* bug鍜屼骇鍝佷俊鎭*/ + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + + /* 璁剧疆鑿滃崟銆*/ + $this->bug->setMenu($this->products, $productID); + + $this->view->header->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->activate; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->activate; + + $this->view->bug = $bug; + $this->view->users = $this->user->getPairs(); + $this->view->actions = $this->action->getList('bug', $bugID); + $this->display(); + } + + /* 纭闇姹傚彉鍔ㄣ*/ + public function confirmStoryChange($bugID) + { + $bug = $this->bug->getById($bugID); + $this->dao->update(TABLE_BUG)->set('storyVersion')->eq($bug->latestStoryVersion)->where('id')->eq($bugID)->exec(); + $this->loadModel('action')->create('bug', $bugID, 'confirmed', '', $bug->latestStoryVersion); + die(js::reload('parent')); + } + + /* 鍒犻櫎bug銆*/ + public function delete($bugID, $confirm = 'no') + { + if($confirm == 'no') + { + die(js::confirm($this->lang->bug->confirmDelete, inlink('delete', "bugID=$bugID&confirm=yes"))); + } + else + { + $this->bug->delete(TABLE_BUG, $bugID); + die(js::locate($this->session->bugList, 'parent')); + } + } + + /* 鑾峰緱鐢ㄦ埛鐨刡ug鍒楄〃銆*/ + public function ajaxGetUserBugs($account = '') + { + if($account == '') $account = $this->app->user->account; + $bugs = $this->bug->getUserBugPairs($account); + die(html::select('bug', $bugs, '', 'class=select-1')); + } + + /* 鍙戦侀偖浠躲*/ + private function sendmail($bugID, $actionID) + { + /* 璁惧畾toList鍜宑cList銆*/ + $bug = $this->bug->getByID($bugID); + $toList = $bug->assignedTo; + $ccList = trim($bug->mailto, ','); + if($toList == '') + { + if($ccList == '') return; + if(strpos($ccList, ',') === false) + { + $toList = $ccList; + $ccList = ''; + } + else + { + $commaPos = strpos($ccList, ','); + $toList = substr($ccList, 0, $commaPos); + $ccList = substr($ccList, $commaPos + 1); + } + } + elseif(strtolower($toList) == 'closed') + { + $toList = $bug->resolvedBy; + } + + /* 鑾峰緱action淇℃伅銆*/ + $action = $this->action->getById($actionID); + $history = $this->action->getHistory($actionID); + $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); + if(strtolower($action->action) == 'opened') $action->comment = $bug->steps; + + /* 璧嬪硷紝鑾峰緱閭欢鍐呭銆*/ + $this->assign('bug', $bug); + $this->assign('action', $action); + $mailContent = $this->parse($this->moduleName, 'sendmail'); + + /* 鍙戜俊銆*/ + $this->loadModel('mail')->send($toList, 'BUG #' . $bug->id . $this->lang->colon . $bug->title, $mailContent, $ccList); + if($this->mail->isError()) echo js::error($this->mail->getError()); + } +} diff --git a/trunk/module/bug/lang/en.php b/trunk/module/bug/lang/en.php index 4340460c4d..41d6ecb74c 100644 --- a/trunk/module/bug/lang/en.php +++ b/trunk/module/bug/lang/en.php @@ -1,169 +1,169 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->bug->common = '缂洪櫡绠$悊'; -$lang->bug->index = '棣栭〉'; -$lang->bug->create = '鍒涘缓Bug'; -$lang->bug->edit = '缂栬緫Bug'; -$lang->bug->browse = 'Bug鍒楄〃'; -$lang->bug->view = 'Bug璇︽儏'; -$lang->bug->resolve = '瑙e喅Bug'; -$lang->bug->close = '鍏抽棴Bug'; -$lang->bug->activate = '婵娲籅ug'; -$lang->bug->ajaxGetUserBugs = '鎺ュ彛:鎴戠殑Bug'; - -$lang->bug->selectProduct = '璇烽夋嫨浜у搧'; -$lang->bug->byModule = '鎸夋ā鍧'; -$lang->bug->assignToMe = '鎸囨淳缁欐垜'; -$lang->bug->openedByMe = '鐢辨垜鍒涘缓'; -$lang->bug->resolvedByMe = '鐢辨垜瑙e喅'; -$lang->bug->assignToNull = '鏈寚娲'; -$lang->bug->longLifeBugs = '涔呮湭澶勭悊'; -$lang->bug->postponedBugs = '琚欢鏈'; -$lang->bug->allBugs = '鎵鏈塀ug'; -$lang->bug->moduleBugs = '鎸夋ā鍧楁祻瑙'; -$lang->bug->byQuery = '鎼滅储'; - -$lang->bug->lblProductAndModule = '浜у搧妯″潡'; -$lang->bug->lblProjectAndTask = '椤圭洰浠诲姟'; -$lang->bug->lblStory = '鐩稿叧闇姹'; -$lang->bug->lblTypeAndSeverity = '绫诲瀷/涓ラ噸绋嬪害'; -$lang->bug->lblSystemBrowserAndHardware = '绯荤粺/娴忚鍣'; -$lang->bug->lblAssignedTo = '褰撳墠鎸囨淳'; -$lang->bug->lblMailto = '鎶勯佺粰'; -$lang->bug->lblLastEdited = '鏈鍚庝慨鏀'; -$lang->bug->lblResolved = '鐢辫皝瑙e喅'; - -$lang->bug->confirmChangeProduct = '淇敼浜у搧浼氬鑷寸浉搴旂殑椤圭洰銆侀渶姹傚拰浠诲姟鍙戠敓鍙樺寲锛岀‘瀹氬悧锛'; - -$lang->bug->legendBasicInfo = '鍩烘湰淇℃伅'; -$lang->bug->legendMailto = '鎶勯佺粰'; -$lang->bug->legendAttatch = '闄勪欢'; -$lang->bug->legendLinkBugs = '鐩稿叧Bug'; -$lang->bug->legendPrjStoryTask= '椤圭洰/闇姹/浠诲姟'; -$lang->bug->legendCases = '鐩稿叧鐢ㄤ緥'; -$lang->bug->legendSteps = '閲嶇幇姝ラ'; -$lang->bug->legendAction = '鎿嶄綔'; -$lang->bug->legendHistory = '鍘嗗彶璁板綍'; -$lang->bug->legendComment = '澶囨敞'; -$lang->bug->legendLife = 'BUG鐨勪竴鐢'; -$lang->bug->legendMisc = '鍏剁浉鍏充粬'; - -$lang->bug->buttonEdit = '缂栬緫'; -$lang->bug->buttonActivate = '婵娲'; -$lang->bug->buttonResolve = '瑙e喅'; -$lang->bug->buttonClose = '鍏抽棴'; -$lang->bug->buttonToList = '杩斿洖'; - -$lang->bug->severityList[3] = 3; -$lang->bug->severityList[1] = 1; -$lang->bug->severityList[2] = 2; -$lang->bug->severityList[4] = 4; - -/* Define the OS list. */ -$lang->bug->osList['all'] = '鍏ㄩ儴'; -$lang->bug->osList['winxp'] = 'Windows XP'; -$lang->bug->osList['win7'] = 'Windows 7'; -$lang->bug->osList['vista'] = 'Windows Vista'; -$lang->bug->osList['win2000'] = 'Windows 2000'; -$lang->bug->osList['winnt'] = 'Windows NT'; -$lang->bug->osList['win98'] = 'Windows 98'; -$lang->bug->osList['linux'] = 'Linux'; -$lang->bug->osList['unix'] = 'Unix'; -$lang->bug->osList['others'] = '鍏朵粬'; - -/* Define the OS list. */ -$lang->bug->browserList['all'] = '鍏ㄩ儴'; -$lang->bug->browserList['ie6'] = 'IE6'; -$lang->bug->browserList['ie7'] = 'IE7'; -$lang->bug->browserList['ie8'] = 'IE8'; -$lang->bug->browserList['firefox2'] = 'firefox2'; -$lang->bug->browserList['firefx3'] = 'firefox3'; -$lang->bug->browserList['opera9'] = 'opera9'; -$lang->bug->browserList['oprea10'] = 'opera10'; -$lang->bug->browserList['safari'] = 'safari'; -$lang->bug->browserList['chrome'] = 'chrome'; -$lang->bug->browserList['other'] = '鍏朵粬'; - -/* Define the types. */ -$lang->bug->typeList[''] = ''; -$lang->bug->typeList['codeerror'] = '浠g爜閿欒'; -$lang->bug->typeList['interface'] = '鐣岄潰浼樺寲'; -$lang->bug->typeList['designchange'] = '璁捐鍙樻洿'; -$lang->bug->typeList['Others'] = '鍏朵粬'; - -$lang->bug->statusList[''] = ''; -$lang->bug->statusList['active'] = '婵娲'; -$lang->bug->statusList['resolved'] = '宸茶В鍐'; -$lang->bug->statusList['closed'] = '宸插叧闂'; - -$lang->bug->resolutionList[''] = ''; -$lang->bug->resolutionList['bydesign'] = '璁捐濡傛'; -$lang->bug->resolutionList['duplicate'] = '閲嶅Bug'; -$lang->bug->resolutionList['external'] = '澶栭儴鍘熷洜'; -$lang->bug->resolutionList['fixed'] = '宸茶В鍐'; -$lang->bug->resolutionList['notrepro'] = '鏃犳硶閲嶇幇'; -$lang->bug->resolutionList['postponed'] = '寤舵湡澶勭悊'; -$lang->bug->resolutionList['willnotfix'] = "涓嶄簣瑙e喅"; - -$lang->bug->id = 'Bug缂栧彿'; -$lang->bug->product = '鎵灞炰骇鍝'; -$lang->bug->module = '鎵灞炴ā鍧'; -$lang->bug->path = '妯″潡璺緞'; -$lang->bug->project = '鎵灞為」鐩'; -$lang->bug->story = '鐩稿叧闇姹'; -$lang->bug->storyVersion = '闇姹傜増鏈'; -$lang->bug->task = '鐩稿叧浠诲姟'; -$lang->bug->title = 'Bug鏍囬'; -$lang->bug->severity = '涓ラ噸绋嬪害'; -$lang->bug->type = 'Bug绫诲瀷'; -$lang->bug->os = '鎿嶄綔绯荤粺'; -$lang->bug->browser = '娴忚鍣'; -$lang->bug->machine = '鏈哄櫒纭欢'; -$lang->bug->found = '濡備綍鍙戠幇'; -$lang->bug->steps = '閲嶇幇姝ラ'; -$lang->bug->status = 'Bug鐘舵'; -$lang->bug->mailto = '鎶勯佺粰'; -$lang->bug->openedBy = '鐢辫皝鍒涘缓'; -$lang->bug->openedDate = '鍒涘缓鏃ユ湡'; -$lang->bug->openedBuild = '褰卞搷鐗堟湰'; -$lang->bug->assignedTo = '鎸囨淳缁'; -$lang->bug->assignedDate = '鎸囨淳鏃ユ湡'; -$lang->bug->resolvedBy = '瑙e喅鑰'; -$lang->bug->resolution = '瑙e喅鏂规'; -$lang->bug->resolvedBuild = '瑙e喅鐗堟湰'; -$lang->bug->resolvedDate = '瑙e喅鏃ユ湡'; -$lang->bug->closedBy = '鐢辫皝鍏抽棴'; -$lang->bug->closedDate = '鍏抽棴鏃ユ湡'; -$lang->bug->duplicateBug = '閲嶅Bug'; -$lang->bug->lastEditedBy = '鏈鍚庝慨鏀硅'; -$lang->bug->lastEditedDate = '鏈鍚庝慨鏀规棩鏈'; -$lang->bug->linkBug = '鐩稿叧Bug'; -$lang->bug->case = '鐩稿叧鐢ㄤ緥'; -$lang->bug->files = '闄勪欢'; - -$lang->bug->tblStep = "[姝ラ]\n"; -$lang->bug->tblResult = "[缁撴灉]\n"; -$lang->bug->tblExpect = "[鏈熸湜]\n"; - -$lang->bug->action->resolved = array('main' => '$date, 鐢 $actor 瑙e喅锛屾柟妗堜负 $extra銆', 'extra' => $lang->bug->resolutionList); +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->bug->common = '缂洪櫡绠$悊'; +$lang->bug->index = '棣栭〉'; +$lang->bug->create = '鍒涘缓Bug'; +$lang->bug->edit = '缂栬緫Bug'; +$lang->bug->browse = 'Bug鍒楄〃'; +$lang->bug->view = 'Bug璇︽儏'; +$lang->bug->resolve = '瑙e喅Bug'; +$lang->bug->close = '鍏抽棴Bug'; +$lang->bug->activate = '婵娲籅ug'; +$lang->bug->ajaxGetUserBugs = '鎺ュ彛:鎴戠殑Bug'; + +$lang->bug->selectProduct = '璇烽夋嫨浜у搧'; +$lang->bug->byModule = '鎸夋ā鍧'; +$lang->bug->assignToMe = '鎸囨淳缁欐垜'; +$lang->bug->openedByMe = '鐢辨垜鍒涘缓'; +$lang->bug->resolvedByMe = '鐢辨垜瑙e喅'; +$lang->bug->assignToNull = '鏈寚娲'; +$lang->bug->longLifeBugs = '涔呮湭澶勭悊'; +$lang->bug->postponedBugs = '琚欢鏈'; +$lang->bug->allBugs = '鎵鏈塀ug'; +$lang->bug->moduleBugs = '鎸夋ā鍧楁祻瑙'; +$lang->bug->byQuery = '鎼滅储'; + +$lang->bug->lblProductAndModule = '浜у搧妯″潡'; +$lang->bug->lblProjectAndTask = '椤圭洰浠诲姟'; +$lang->bug->lblStory = '鐩稿叧闇姹'; +$lang->bug->lblTypeAndSeverity = '绫诲瀷/涓ラ噸绋嬪害'; +$lang->bug->lblSystemBrowserAndHardware = '绯荤粺/娴忚鍣'; +$lang->bug->lblAssignedTo = '褰撳墠鎸囨淳'; +$lang->bug->lblMailto = '鎶勯佺粰'; +$lang->bug->lblLastEdited = '鏈鍚庝慨鏀'; +$lang->bug->lblResolved = '鐢辫皝瑙e喅'; + +$lang->bug->confirmChangeProduct = '淇敼浜у搧浼氬鑷寸浉搴旂殑椤圭洰銆侀渶姹傚拰浠诲姟鍙戠敓鍙樺寲锛岀‘瀹氬悧锛'; + +$lang->bug->legendBasicInfo = '鍩烘湰淇℃伅'; +$lang->bug->legendMailto = '鎶勯佺粰'; +$lang->bug->legendAttatch = '闄勪欢'; +$lang->bug->legendLinkBugs = '鐩稿叧Bug'; +$lang->bug->legendPrjStoryTask= '椤圭洰/闇姹/浠诲姟'; +$lang->bug->legendCases = '鐩稿叧鐢ㄤ緥'; +$lang->bug->legendSteps = '閲嶇幇姝ラ'; +$lang->bug->legendAction = '鎿嶄綔'; +$lang->bug->legendHistory = '鍘嗗彶璁板綍'; +$lang->bug->legendComment = '澶囨敞'; +$lang->bug->legendLife = 'BUG鐨勪竴鐢'; +$lang->bug->legendMisc = '鍏剁浉鍏充粬'; + +$lang->bug->buttonEdit = '缂栬緫'; +$lang->bug->buttonActivate = '婵娲'; +$lang->bug->buttonResolve = '瑙e喅'; +$lang->bug->buttonClose = '鍏抽棴'; +$lang->bug->buttonToList = '杩斿洖'; + +$lang->bug->severityList[3] = 3; +$lang->bug->severityList[1] = 1; +$lang->bug->severityList[2] = 2; +$lang->bug->severityList[4] = 4; + +/* Define the OS list. */ +$lang->bug->osList['all'] = '鍏ㄩ儴'; +$lang->bug->osList['winxp'] = 'Windows XP'; +$lang->bug->osList['win7'] = 'Windows 7'; +$lang->bug->osList['vista'] = 'Windows Vista'; +$lang->bug->osList['win2000'] = 'Windows 2000'; +$lang->bug->osList['winnt'] = 'Windows NT'; +$lang->bug->osList['win98'] = 'Windows 98'; +$lang->bug->osList['linux'] = 'Linux'; +$lang->bug->osList['unix'] = 'Unix'; +$lang->bug->osList['others'] = '鍏朵粬'; + +/* Define the OS list. */ +$lang->bug->browserList['all'] = '鍏ㄩ儴'; +$lang->bug->browserList['ie6'] = 'IE6'; +$lang->bug->browserList['ie7'] = 'IE7'; +$lang->bug->browserList['ie8'] = 'IE8'; +$lang->bug->browserList['firefox2'] = 'firefox2'; +$lang->bug->browserList['firefx3'] = 'firefox3'; +$lang->bug->browserList['opera9'] = 'opera9'; +$lang->bug->browserList['oprea10'] = 'opera10'; +$lang->bug->browserList['safari'] = 'safari'; +$lang->bug->browserList['chrome'] = 'chrome'; +$lang->bug->browserList['other'] = '鍏朵粬'; + +/* Define the types. */ +$lang->bug->typeList[''] = ''; +$lang->bug->typeList['codeerror'] = '浠g爜閿欒'; +$lang->bug->typeList['interface'] = '鐣岄潰浼樺寲'; +$lang->bug->typeList['designchange'] = '璁捐鍙樻洿'; +$lang->bug->typeList['Others'] = '鍏朵粬'; + +$lang->bug->statusList[''] = ''; +$lang->bug->statusList['active'] = '婵娲'; +$lang->bug->statusList['resolved'] = '宸茶В鍐'; +$lang->bug->statusList['closed'] = '宸插叧闂'; + +$lang->bug->resolutionList[''] = ''; +$lang->bug->resolutionList['bydesign'] = '璁捐濡傛'; +$lang->bug->resolutionList['duplicate'] = '閲嶅Bug'; +$lang->bug->resolutionList['external'] = '澶栭儴鍘熷洜'; +$lang->bug->resolutionList['fixed'] = '宸茶В鍐'; +$lang->bug->resolutionList['notrepro'] = '鏃犳硶閲嶇幇'; +$lang->bug->resolutionList['postponed'] = '寤舵湡澶勭悊'; +$lang->bug->resolutionList['willnotfix'] = "涓嶄簣瑙e喅"; + +$lang->bug->id = 'Bug缂栧彿'; +$lang->bug->product = '鎵灞炰骇鍝'; +$lang->bug->module = '鎵灞炴ā鍧'; +$lang->bug->path = '妯″潡璺緞'; +$lang->bug->project = '鎵灞為」鐩'; +$lang->bug->story = '鐩稿叧闇姹'; +$lang->bug->storyVersion = '闇姹傜増鏈'; +$lang->bug->task = '鐩稿叧浠诲姟'; +$lang->bug->title = 'Bug鏍囬'; +$lang->bug->severity = '涓ラ噸绋嬪害'; +$lang->bug->type = 'Bug绫诲瀷'; +$lang->bug->os = '鎿嶄綔绯荤粺'; +$lang->bug->browser = '娴忚鍣'; +$lang->bug->machine = '鏈哄櫒纭欢'; +$lang->bug->found = '濡備綍鍙戠幇'; +$lang->bug->steps = '閲嶇幇姝ラ'; +$lang->bug->status = 'Bug鐘舵'; +$lang->bug->mailto = '鎶勯佺粰'; +$lang->bug->openedBy = '鐢辫皝鍒涘缓'; +$lang->bug->openedDate = '鍒涘缓鏃ユ湡'; +$lang->bug->openedBuild = '褰卞搷鐗堟湰'; +$lang->bug->assignedTo = '鎸囨淳缁'; +$lang->bug->assignedDate = '鎸囨淳鏃ユ湡'; +$lang->bug->resolvedBy = '瑙e喅鑰'; +$lang->bug->resolution = '瑙e喅鏂规'; +$lang->bug->resolvedBuild = '瑙e喅鐗堟湰'; +$lang->bug->resolvedDate = '瑙e喅鏃ユ湡'; +$lang->bug->closedBy = '鐢辫皝鍏抽棴'; +$lang->bug->closedDate = '鍏抽棴鏃ユ湡'; +$lang->bug->duplicateBug = '閲嶅Bug'; +$lang->bug->lastEditedBy = '鏈鍚庝慨鏀硅'; +$lang->bug->lastEditedDate = '鏈鍚庝慨鏀规棩鏈'; +$lang->bug->linkBug = '鐩稿叧Bug'; +$lang->bug->case = '鐩稿叧鐢ㄤ緥'; +$lang->bug->files = '闄勪欢'; + +$lang->bug->tblStep = "[姝ラ]\n"; +$lang->bug->tblResult = "[缁撴灉]\n"; +$lang->bug->tblExpect = "[鏈熸湜]\n"; + +$lang->bug->action->resolved = array('main' => '$date, 鐢 $actor 瑙e喅锛屾柟妗堜负 $extra銆', 'extra' => $lang->bug->resolutionList); diff --git a/trunk/module/bug/lang/zh-cn.php b/trunk/module/bug/lang/zh-cn.php index 7e0f7e69bc..91487401e3 100644 --- a/trunk/module/bug/lang/zh-cn.php +++ b/trunk/module/bug/lang/zh-cn.php @@ -1,271 +1,271 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -/* 瀛楁鍒楄〃銆*/ -$lang->bug->common = '缂洪櫡绠$悊'; -$lang->bug->id = 'Bug缂栧彿'; -$lang->bug->product = '鎵灞炰骇鍝'; -$lang->bug->module = '鎵灞炴ā鍧'; -$lang->bug->path = '妯″潡璺緞'; -$lang->bug->project = '鎵灞為」鐩'; -$lang->bug->story = '鐩稿叧闇姹'; -$lang->bug->storyVersion = '闇姹傜増鏈'; -$lang->bug->task = '鐩稿叧浠诲姟'; -$lang->bug->title = 'Bug鏍囬'; -$lang->bug->severity = '涓ラ噸绋嬪害'; -$lang->bug->severityAB = '绾у埆'; -$lang->bug->pri = '浼樺厛绾'; -$lang->bug->type = 'Bug绫诲瀷'; -$lang->bug->os = '鎿嶄綔绯荤粺'; -$lang->bug->browser = '娴忚鍣'; -$lang->bug->machine = '鏈哄櫒纭欢'; -$lang->bug->found = '濡備綍鍙戠幇'; -$lang->bug->steps = '閲嶇幇姝ラ'; -$lang->bug->status = 'Bug鐘舵'; -$lang->bug->mailto = '鎶勯佺粰'; -$lang->bug->openedBy = '鐢辫皝鍒涘缓'; -$lang->bug->openedByAB = '鍒涘缓'; -$lang->bug->openedDate = '鍒涘缓鏃ユ湡'; -$lang->bug->openedBuild = '褰卞搷鐗堟湰'; -$lang->bug->assignedTo = '鎸囨淳缁'; -$lang->bug->assignedDate = '鎸囨淳鏃ユ湡'; -$lang->bug->resolvedBy = '瑙e喅鑰'; -$lang->bug->resolution = '瑙e喅鏂规'; -$lang->bug->resolutionAB = '鏂规'; -$lang->bug->resolvedBuild = '瑙e喅鐗堟湰'; -$lang->bug->resolvedDate = '瑙e喅鏃ユ湡'; -$lang->bug->closedBy = '鐢辫皝鍏抽棴'; -$lang->bug->closedDate = '鍏抽棴鏃ユ湡'; -$lang->bug->duplicateBug = '閲嶅Bug'; -$lang->bug->lastEditedBy = '鏈鍚庝慨鏀硅'; -$lang->bug->lastEditedDate = '鏈鍚庝慨鏀规棩鏈'; -$lang->bug->linkBug = '鐩稿叧Bug'; -$lang->bug->case = '鐩稿叧鐢ㄤ緥'; -$lang->bug->files = '闄勪欢'; -$lang->bug->keywords = '鍏抽敭璇'; - -/* 鏂规硶鍒楄〃銆*/ -$lang->bug->index = '棣栭〉'; -$lang->bug->create = '鍒涘缓Bug'; -$lang->bug->edit = '缂栬緫Bug'; -$lang->bug->browse = 'Bug鍒楄〃'; -$lang->bug->view = 'Bug璇︽儏'; -$lang->bug->resolve = '瑙e喅Bug'; -$lang->bug->close = '鍏抽棴Bug'; -$lang->bug->activate = '婵娲籅ug'; -$lang->bug->reportChart = '鎶ヨ〃缁熻'; -$lang->bug->delete = '鍒犻櫎Bug'; -$lang->bug->ajaxGetUserBugs = '鎺ュ彛:鎴戠殑Bug'; -$lang->bug->confirmStoryChange = '纭闇姹傚彉鍔'; - -/* 鏌ヨ鏉′欢鍒楄〃銆*/ -$lang->bug->selectProduct = '璇烽夋嫨浜у搧'; -$lang->bug->byModule = '鎸夋ā鍧'; -$lang->bug->assignToMe = '鎸囨淳缁欐垜'; -$lang->bug->openedByMe = '鐢辨垜鍒涘缓'; -$lang->bug->resolvedByMe = '鐢辨垜瑙e喅'; -$lang->bug->assignToNull = '鏈寚娲'; -$lang->bug->longLifeBugs = '涔呮湭澶勭悊'; -$lang->bug->postponedBugs = '琚欢鏈'; -$lang->bug->allBugs = '鎵鏈塀ug'; -$lang->bug->moduleBugs = '鎸夋ā鍧楁祻瑙'; -$lang->bug->byQuery = '鎼滅储'; -$lang->bug->needConfirm = '闇姹傛湁鍙樺姩鐨凚ug'; -$lang->bug->allProduct = '鎵鏈変骇鍝'; - -/* 椤甸潰鏍囩銆*/ -$lang->bug->lblProductAndModule = '浜у搧妯″潡'; -$lang->bug->lblProjectAndTask = '椤圭洰浠诲姟'; -$lang->bug->lblStory = '鐩稿叧闇姹'; -$lang->bug->lblTypeAndSeverity = '绫诲瀷/涓ラ噸绋嬪害'; -$lang->bug->lblSystemBrowserAndHardware = '绯荤粺/娴忚鍣'; -$lang->bug->lblAssignedTo = '褰撳墠鎸囨淳'; -$lang->bug->lblMailto = '鎶勯佺粰'; -$lang->bug->lblLastEdited = '鏈鍚庝慨鏀'; -$lang->bug->lblResolved = '鐢辫皝瑙e喅'; - -/* legend鍒楄〃銆*/ -$lang->bug->legendBasicInfo = '鍩烘湰淇℃伅'; -$lang->bug->legendMailto = '鎶勯佺粰'; -$lang->bug->legendAttatch = '闄勪欢'; -$lang->bug->legendLinkBugs = '鐩稿叧Bug'; -$lang->bug->legendPrjStoryTask= '椤圭洰/闇姹/浠诲姟'; -$lang->bug->legendCases = '鐩稿叧鐢ㄤ緥'; -$lang->bug->legendSteps = '閲嶇幇姝ラ'; -$lang->bug->legendAction = '鎿嶄綔'; -$lang->bug->legendHistory = '鍘嗗彶璁板綍'; -$lang->bug->legendComment = '澶囨敞'; -$lang->bug->legendLife = 'BUG鐨勪竴鐢'; -$lang->bug->legendMisc = '鍏剁浉鍏充粬'; - -/* 鍔熻兘鎸夐挳銆*/ -$lang->bug->buttonEdit = '缂栬緫'; -$lang->bug->buttonActivate = '婵娲'; -$lang->bug->buttonResolve = '瑙e喅'; -$lang->bug->buttonClose = '鍏抽棴'; -$lang->bug->buttonToList = '杩斿洖'; - -/* 浜や簰鎻愮ず銆*/ -$lang->bug->confirmChangeProduct = '淇敼浜у搧浼氬鑷寸浉搴旂殑椤圭洰銆侀渶姹傚拰浠诲姟鍙戠敓鍙樺寲锛岀‘瀹氬悧锛'; -$lang->bug->confirmDelete = '鎮ㄧ‘璁よ鍒犻櫎璇ug鍚楋紵'; - -/* 妯℃澘銆*/ -$lang->bug->tblStep = "[姝ラ]\n"; -$lang->bug->tblResult = "[缁撴灉]\n"; -$lang->bug->tblExpect = "[鏈熸湜]\n"; - -/* 鍚勪釜瀛楁鍙栧煎垪琛ㄣ*/ -$lang->bug->severityList[3] = '3'; -$lang->bug->severityList[1] = '1'; -$lang->bug->severityList[2] = '2'; -$lang->bug->severityList[4] = '4'; - -$lang->bug->priList[0] = ''; -$lang->bug->priList[3] = '3'; -$lang->bug->priList[1] = '1'; -$lang->bug->priList[2] = '2'; -$lang->bug->priList[4] = '4'; - -$lang->bug->osList[''] = ''; -$lang->bug->osList['all'] = '鍏ㄩ儴'; -$lang->bug->osList['windows'] = 'Windows'; -$lang->bug->osList['winxp'] = 'Windows XP'; -$lang->bug->osList['win7'] = 'Windows 7'; -$lang->bug->osList['vista'] = 'Windows Vista'; -$lang->bug->osList['win2000'] = 'Windows 2000'; -$lang->bug->osList['winnt'] = 'Windows NT'; -$lang->bug->osList['win98'] = 'Windows 98'; -$lang->bug->osList['linux'] = 'Linux'; -$lang->bug->osList['freebsd'] = 'FreeBSD'; -$lang->bug->osList['unix'] = 'Unix'; -$lang->bug->osList['others'] = '鍏朵粬'; - -$lang->bug->browserList[''] = ''; -$lang->bug->browserList['all'] = '鍏ㄩ儴'; -$lang->bug->browserList['ie'] = 'IE绯诲垪'; -$lang->bug->browserList['ie6'] = 'IE6'; -$lang->bug->browserList['ie7'] = 'IE7'; -$lang->bug->browserList['ie8'] = 'IE8'; -$lang->bug->browserList['firefox'] = 'firefox绯诲垪'; -$lang->bug->browserList['firefox2'] = 'firefox2'; -$lang->bug->browserList['firefx3'] = 'firefox3'; -$lang->bug->browserList['opera'] = 'opera绯诲垪'; -$lang->bug->browserList['opera9'] = 'opera9'; -$lang->bug->browserList['oprea10'] = 'opera10'; -$lang->bug->browserList['safari'] = 'safari'; -$lang->bug->browserList['chrome'] = 'chrome'; -$lang->bug->browserList['other'] = '鍏朵粬'; - -$lang->bug->typeList[''] = ''; -$lang->bug->typeList['codeerror'] = '浠g爜閿欒'; -$lang->bug->typeList['interface'] = '鐣岄潰浼樺寲'; -$lang->bug->typeList['designchange'] = '璁捐鍙樻洿'; -$lang->bug->typeList['newfeature'] = '鏂板闇姹'; -$lang->bug->typeList['designdefect'] = '璁捐缂洪櫡'; -$lang->bug->typeList['config'] = '閰嶇疆鐩稿叧'; -$lang->bug->typeList['install'] = '瀹夎閮ㄧ讲'; -$lang->bug->typeList['security'] = '瀹夊叏鐩稿叧'; -$lang->bug->typeList['performance'] = '鎬ц兘闂'; -$lang->bug->typeList['standard'] = '鏍囧噯瑙勮寖'; -$lang->bug->typeList['automation'] = '娴嬭瘯鑴氭湰'; -$lang->bug->typeList['trackthings'] = '浜嬪姟璺熻釜'; -$lang->bug->typeList['Others'] = '鍏朵粬'; - -$lang->bug->statusList[''] = ''; -$lang->bug->statusList['active'] = '婵娲'; -$lang->bug->statusList['resolved'] = '宸茶В鍐'; -$lang->bug->statusList['closed'] = '宸插叧闂'; - -$lang->bug->resolutionList[''] = ''; -$lang->bug->resolutionList['bydesign'] = '璁捐濡傛'; -$lang->bug->resolutionList['duplicate'] = '閲嶅Bug'; -$lang->bug->resolutionList['external'] = '澶栭儴鍘熷洜'; -$lang->bug->resolutionList['fixed'] = '宸茶В鍐'; -$lang->bug->resolutionList['notrepro'] = '鏃犳硶閲嶇幇'; -$lang->bug->resolutionList['postponed'] = '寤舵湡澶勭悊'; -$lang->bug->resolutionList['willnotfix'] = "涓嶄簣瑙e喅"; - -/* 缁熻鎶ヨ〃銆*/ -$lang->bug->report->common = '缁熻鎶ヨ〃'; -$lang->bug->report->select = '璇烽夋嫨鎶ヨ〃绫诲瀷'; -$lang->bug->report->create = '鐢熸垚鎶ヨ〃'; - -$lang->bug->report->charts['bugsPerProject'] = '椤圭洰Bug鏁伴噺'; -$lang->bug->report->charts['bugsPerModule'] = '妯″潡Bug鏁伴噺'; -$lang->bug->report->charts['openedBugsPerDay'] = '姣忓ぉ鏂板Bug鏁'; -$lang->bug->report->charts['resolvedBugsPerDay'] = '姣忓ぉ瑙e喅Bug鏁'; -$lang->bug->report->charts['closedBugsPerDay'] = '姣忓ぉ鍏抽棴鐨凚ug鏁'; -$lang->bug->report->charts['openedBugsPerUser'] = '姣忎汉鎻愪氦鐨凚ug鏁'; -$lang->bug->report->charts['resolvedBugsPerUser']= '姣忎汉瑙e喅鐨凚ug鏁'; -$lang->bug->report->charts['closedBugsPerUser'] = '姣忎汉鍏抽棴鐨凚ug鏁'; -$lang->bug->report->charts['bugsPerSeverity'] = 'Bug涓ラ噸绋嬪害缁熻'; -$lang->bug->report->charts['bugsPerResolution'] = 'Bug瑙e喅鏂规缁熻'; -$lang->bug->report->charts['bugsPerStatus'] = 'Bug鐘舵佺粺璁'; -$lang->bug->report->charts['bugsPerType'] = 'Bug绫诲瀷缁熻'; -//$lang->bug->report->charts['bugLiveDays'] = 'Bug澶勭悊鏃堕棿缁熻'; -//$lang->bug->report->charts['bugHistories'] = 'Bug澶勭悊姝ラ缁熻'; - -$lang->bug->report->options->swf = 'pie2d'; -$lang->bug->report->options->width = 'auto'; -$lang->bug->report->options->height = 300; -$lang->bug->report->options->graph->baseFontSize = 12; -$lang->bug->report->options->graph->showNames = 1; -$lang->bug->report->options->graph->formatNumber = 1; -$lang->bug->report->options->graph->decimalPrecision = 0; -$lang->bug->report->options->graph->animation = 0; -$lang->bug->report->options->graph->rotateNames = 0; -$lang->bug->report->options->graph->yAxisName = 'COUNT'; -$lang->bug->report->options->graph->pieRadius = 100; // 楗煎浘鐩村緞銆 -$lang->bug->report->options->graph->showColumnShadow = 0; // 鏄惁鏄剧ず鏌辩姸鍥鹃槾褰便 - -$lang->bug->report->bugsPerProject->graph->xAxisName = '椤圭洰'; -$lang->bug->report->bugsPerModule->graph->xAxisName = '妯″潡'; - -$lang->bug->report->openedBugsPerDay->swf = 'column2d'; -$lang->bug->report->openedBugsPerDay->height = 400; -$lang->bug->report->openedBugsPerDay->graph->xAxisName = '鏃ユ湡'; -$lang->bug->report->openedBugsPerDay->graph->rotateNames = 1; - -$lang->bug->report->resolvedBugsPerDay->swf = 'column2d'; -$lang->bug->report->resolvedBugsPerDay->height = 400; -$lang->bug->report->resolvedBugsPerDay->graph->xAxisName = '鏃ユ湡'; -$lang->bug->report->resolvedBugsPerDay->graph->rotateNames = 1; - -$lang->bug->report->closedBugsPerDay->swf = 'column2d'; -$lang->bug->report->closedBugsPerDay->height = 400; -$lang->bug->report->closedBugsPerDay->graph->xAxisName = '鏃ユ湡'; -$lang->bug->report->closedBugsPerDay->graph->rotateNames = 1; - -$lang->bug->report->openedBugsPerUser->graph->xAxisName = '鐢ㄦ埛'; -$lang->bug->report->resolvedBugsPerUser->graph->xAxisName= '鐢ㄦ埛'; -$lang->bug->report->closedBugsPerUser->graph->xAxisName = '鐢ㄦ埛'; - -$lang->bug->report->bugsPerSeverity->graph->xAxisName = '涓ラ噸绋嬪害'; -$lang->bug->report->bugsPerResolution->graph->xAxisName = '瑙e喅鏂规'; -$lang->bug->report->bugsPerStatus->graph->xAxisName = '鐘舵'; -$lang->bug->report->bugsPerType->graph->xAxisName = '绫诲瀷'; -$lang->bug->report->bugLiveDays->graph->xAxisName = '澶勭悊鏃堕棿'; -$lang->bug->report->bugHistories->graph->xAxisName = '澶勭悊姝ラ'; - -/* 鎿嶄綔璁板綍銆*/ -$lang->bug->action->resolved = array('main' => '$date, 鐢 $actor 瑙e喅锛屾柟妗堜负 $extra銆', 'extra' => $lang->bug->resolutionList); +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +/* 瀛楁鍒楄〃銆*/ +$lang->bug->common = '缂洪櫡绠$悊'; +$lang->bug->id = 'Bug缂栧彿'; +$lang->bug->product = '鎵灞炰骇鍝'; +$lang->bug->module = '鎵灞炴ā鍧'; +$lang->bug->path = '妯″潡璺緞'; +$lang->bug->project = '鎵灞為」鐩'; +$lang->bug->story = '鐩稿叧闇姹'; +$lang->bug->storyVersion = '闇姹傜増鏈'; +$lang->bug->task = '鐩稿叧浠诲姟'; +$lang->bug->title = 'Bug鏍囬'; +$lang->bug->severity = '涓ラ噸绋嬪害'; +$lang->bug->severityAB = '绾у埆'; +$lang->bug->pri = '浼樺厛绾'; +$lang->bug->type = 'Bug绫诲瀷'; +$lang->bug->os = '鎿嶄綔绯荤粺'; +$lang->bug->browser = '娴忚鍣'; +$lang->bug->machine = '鏈哄櫒纭欢'; +$lang->bug->found = '濡備綍鍙戠幇'; +$lang->bug->steps = '閲嶇幇姝ラ'; +$lang->bug->status = 'Bug鐘舵'; +$lang->bug->mailto = '鎶勯佺粰'; +$lang->bug->openedBy = '鐢辫皝鍒涘缓'; +$lang->bug->openedByAB = '鍒涘缓'; +$lang->bug->openedDate = '鍒涘缓鏃ユ湡'; +$lang->bug->openedBuild = '褰卞搷鐗堟湰'; +$lang->bug->assignedTo = '鎸囨淳缁'; +$lang->bug->assignedDate = '鎸囨淳鏃ユ湡'; +$lang->bug->resolvedBy = '瑙e喅鑰'; +$lang->bug->resolution = '瑙e喅鏂规'; +$lang->bug->resolutionAB = '鏂规'; +$lang->bug->resolvedBuild = '瑙e喅鐗堟湰'; +$lang->bug->resolvedDate = '瑙e喅鏃ユ湡'; +$lang->bug->closedBy = '鐢辫皝鍏抽棴'; +$lang->bug->closedDate = '鍏抽棴鏃ユ湡'; +$lang->bug->duplicateBug = '閲嶅Bug'; +$lang->bug->lastEditedBy = '鏈鍚庝慨鏀硅'; +$lang->bug->lastEditedDate = '鏈鍚庝慨鏀规棩鏈'; +$lang->bug->linkBug = '鐩稿叧Bug'; +$lang->bug->case = '鐩稿叧鐢ㄤ緥'; +$lang->bug->files = '闄勪欢'; +$lang->bug->keywords = '鍏抽敭璇'; + +/* 鏂规硶鍒楄〃銆*/ +$lang->bug->index = '棣栭〉'; +$lang->bug->create = '鍒涘缓Bug'; +$lang->bug->edit = '缂栬緫Bug'; +$lang->bug->browse = 'Bug鍒楄〃'; +$lang->bug->view = 'Bug璇︽儏'; +$lang->bug->resolve = '瑙e喅Bug'; +$lang->bug->close = '鍏抽棴Bug'; +$lang->bug->activate = '婵娲籅ug'; +$lang->bug->reportChart = '鎶ヨ〃缁熻'; +$lang->bug->delete = '鍒犻櫎Bug'; +$lang->bug->ajaxGetUserBugs = '鎺ュ彛:鎴戠殑Bug'; +$lang->bug->confirmStoryChange = '纭闇姹傚彉鍔'; + +/* 鏌ヨ鏉′欢鍒楄〃銆*/ +$lang->bug->selectProduct = '璇烽夋嫨浜у搧'; +$lang->bug->byModule = '鎸夋ā鍧'; +$lang->bug->assignToMe = '鎸囨淳缁欐垜'; +$lang->bug->openedByMe = '鐢辨垜鍒涘缓'; +$lang->bug->resolvedByMe = '鐢辨垜瑙e喅'; +$lang->bug->assignToNull = '鏈寚娲'; +$lang->bug->longLifeBugs = '涔呮湭澶勭悊'; +$lang->bug->postponedBugs = '琚欢鏈'; +$lang->bug->allBugs = '鎵鏈塀ug'; +$lang->bug->moduleBugs = '鎸夋ā鍧楁祻瑙'; +$lang->bug->byQuery = '鎼滅储'; +$lang->bug->needConfirm = '闇姹傛湁鍙樺姩鐨凚ug'; +$lang->bug->allProduct = '鎵鏈変骇鍝'; + +/* 椤甸潰鏍囩銆*/ +$lang->bug->lblProductAndModule = '浜у搧妯″潡'; +$lang->bug->lblProjectAndTask = '椤圭洰浠诲姟'; +$lang->bug->lblStory = '鐩稿叧闇姹'; +$lang->bug->lblTypeAndSeverity = '绫诲瀷/涓ラ噸绋嬪害'; +$lang->bug->lblSystemBrowserAndHardware = '绯荤粺/娴忚鍣'; +$lang->bug->lblAssignedTo = '褰撳墠鎸囨淳'; +$lang->bug->lblMailto = '鎶勯佺粰'; +$lang->bug->lblLastEdited = '鏈鍚庝慨鏀'; +$lang->bug->lblResolved = '鐢辫皝瑙e喅'; + +/* legend鍒楄〃銆*/ +$lang->bug->legendBasicInfo = '鍩烘湰淇℃伅'; +$lang->bug->legendMailto = '鎶勯佺粰'; +$lang->bug->legendAttatch = '闄勪欢'; +$lang->bug->legendLinkBugs = '鐩稿叧Bug'; +$lang->bug->legendPrjStoryTask= '椤圭洰/闇姹/浠诲姟'; +$lang->bug->legendCases = '鐩稿叧鐢ㄤ緥'; +$lang->bug->legendSteps = '閲嶇幇姝ラ'; +$lang->bug->legendAction = '鎿嶄綔'; +$lang->bug->legendHistory = '鍘嗗彶璁板綍'; +$lang->bug->legendComment = '澶囨敞'; +$lang->bug->legendLife = 'BUG鐨勪竴鐢'; +$lang->bug->legendMisc = '鍏剁浉鍏充粬'; + +/* 鍔熻兘鎸夐挳銆*/ +$lang->bug->buttonEdit = '缂栬緫'; +$lang->bug->buttonActivate = '婵娲'; +$lang->bug->buttonResolve = '瑙e喅'; +$lang->bug->buttonClose = '鍏抽棴'; +$lang->bug->buttonToList = '杩斿洖'; + +/* 浜や簰鎻愮ず銆*/ +$lang->bug->confirmChangeProduct = '淇敼浜у搧浼氬鑷寸浉搴旂殑椤圭洰銆侀渶姹傚拰浠诲姟鍙戠敓鍙樺寲锛岀‘瀹氬悧锛'; +$lang->bug->confirmDelete = '鎮ㄧ‘璁よ鍒犻櫎璇ug鍚楋紵'; + +/* 妯℃澘銆*/ +$lang->bug->tblStep = "[姝ラ]\n"; +$lang->bug->tblResult = "[缁撴灉]\n"; +$lang->bug->tblExpect = "[鏈熸湜]\n"; + +/* 鍚勪釜瀛楁鍙栧煎垪琛ㄣ*/ +$lang->bug->severityList[3] = '3'; +$lang->bug->severityList[1] = '1'; +$lang->bug->severityList[2] = '2'; +$lang->bug->severityList[4] = '4'; + +$lang->bug->priList[0] = ''; +$lang->bug->priList[3] = '3'; +$lang->bug->priList[1] = '1'; +$lang->bug->priList[2] = '2'; +$lang->bug->priList[4] = '4'; + +$lang->bug->osList[''] = ''; +$lang->bug->osList['all'] = '鍏ㄩ儴'; +$lang->bug->osList['windows'] = 'Windows'; +$lang->bug->osList['winxp'] = 'Windows XP'; +$lang->bug->osList['win7'] = 'Windows 7'; +$lang->bug->osList['vista'] = 'Windows Vista'; +$lang->bug->osList['win2000'] = 'Windows 2000'; +$lang->bug->osList['winnt'] = 'Windows NT'; +$lang->bug->osList['win98'] = 'Windows 98'; +$lang->bug->osList['linux'] = 'Linux'; +$lang->bug->osList['freebsd'] = 'FreeBSD'; +$lang->bug->osList['unix'] = 'Unix'; +$lang->bug->osList['others'] = '鍏朵粬'; + +$lang->bug->browserList[''] = ''; +$lang->bug->browserList['all'] = '鍏ㄩ儴'; +$lang->bug->browserList['ie'] = 'IE绯诲垪'; +$lang->bug->browserList['ie6'] = 'IE6'; +$lang->bug->browserList['ie7'] = 'IE7'; +$lang->bug->browserList['ie8'] = 'IE8'; +$lang->bug->browserList['firefox'] = 'firefox绯诲垪'; +$lang->bug->browserList['firefox2'] = 'firefox2'; +$lang->bug->browserList['firefx3'] = 'firefox3'; +$lang->bug->browserList['opera'] = 'opera绯诲垪'; +$lang->bug->browserList['opera9'] = 'opera9'; +$lang->bug->browserList['oprea10'] = 'opera10'; +$lang->bug->browserList['safari'] = 'safari'; +$lang->bug->browserList['chrome'] = 'chrome'; +$lang->bug->browserList['other'] = '鍏朵粬'; + +$lang->bug->typeList[''] = ''; +$lang->bug->typeList['codeerror'] = '浠g爜閿欒'; +$lang->bug->typeList['interface'] = '鐣岄潰浼樺寲'; +$lang->bug->typeList['designchange'] = '璁捐鍙樻洿'; +$lang->bug->typeList['newfeature'] = '鏂板闇姹'; +$lang->bug->typeList['designdefect'] = '璁捐缂洪櫡'; +$lang->bug->typeList['config'] = '閰嶇疆鐩稿叧'; +$lang->bug->typeList['install'] = '瀹夎閮ㄧ讲'; +$lang->bug->typeList['security'] = '瀹夊叏鐩稿叧'; +$lang->bug->typeList['performance'] = '鎬ц兘闂'; +$lang->bug->typeList['standard'] = '鏍囧噯瑙勮寖'; +$lang->bug->typeList['automation'] = '娴嬭瘯鑴氭湰'; +$lang->bug->typeList['trackthings'] = '浜嬪姟璺熻釜'; +$lang->bug->typeList['Others'] = '鍏朵粬'; + +$lang->bug->statusList[''] = ''; +$lang->bug->statusList['active'] = '婵娲'; +$lang->bug->statusList['resolved'] = '宸茶В鍐'; +$lang->bug->statusList['closed'] = '宸插叧闂'; + +$lang->bug->resolutionList[''] = ''; +$lang->bug->resolutionList['bydesign'] = '璁捐濡傛'; +$lang->bug->resolutionList['duplicate'] = '閲嶅Bug'; +$lang->bug->resolutionList['external'] = '澶栭儴鍘熷洜'; +$lang->bug->resolutionList['fixed'] = '宸茶В鍐'; +$lang->bug->resolutionList['notrepro'] = '鏃犳硶閲嶇幇'; +$lang->bug->resolutionList['postponed'] = '寤舵湡澶勭悊'; +$lang->bug->resolutionList['willnotfix'] = "涓嶄簣瑙e喅"; + +/* 缁熻鎶ヨ〃銆*/ +$lang->bug->report->common = '缁熻鎶ヨ〃'; +$lang->bug->report->select = '璇烽夋嫨鎶ヨ〃绫诲瀷'; +$lang->bug->report->create = '鐢熸垚鎶ヨ〃'; + +$lang->bug->report->charts['bugsPerProject'] = '椤圭洰Bug鏁伴噺'; +$lang->bug->report->charts['bugsPerModule'] = '妯″潡Bug鏁伴噺'; +$lang->bug->report->charts['openedBugsPerDay'] = '姣忓ぉ鏂板Bug鏁'; +$lang->bug->report->charts['resolvedBugsPerDay'] = '姣忓ぉ瑙e喅Bug鏁'; +$lang->bug->report->charts['closedBugsPerDay'] = '姣忓ぉ鍏抽棴鐨凚ug鏁'; +$lang->bug->report->charts['openedBugsPerUser'] = '姣忎汉鎻愪氦鐨凚ug鏁'; +$lang->bug->report->charts['resolvedBugsPerUser']= '姣忎汉瑙e喅鐨凚ug鏁'; +$lang->bug->report->charts['closedBugsPerUser'] = '姣忎汉鍏抽棴鐨凚ug鏁'; +$lang->bug->report->charts['bugsPerSeverity'] = 'Bug涓ラ噸绋嬪害缁熻'; +$lang->bug->report->charts['bugsPerResolution'] = 'Bug瑙e喅鏂规缁熻'; +$lang->bug->report->charts['bugsPerStatus'] = 'Bug鐘舵佺粺璁'; +$lang->bug->report->charts['bugsPerType'] = 'Bug绫诲瀷缁熻'; +//$lang->bug->report->charts['bugLiveDays'] = 'Bug澶勭悊鏃堕棿缁熻'; +//$lang->bug->report->charts['bugHistories'] = 'Bug澶勭悊姝ラ缁熻'; + +$lang->bug->report->options->swf = 'pie2d'; +$lang->bug->report->options->width = 'auto'; +$lang->bug->report->options->height = 300; +$lang->bug->report->options->graph->baseFontSize = 12; +$lang->bug->report->options->graph->showNames = 1; +$lang->bug->report->options->graph->formatNumber = 1; +$lang->bug->report->options->graph->decimalPrecision = 0; +$lang->bug->report->options->graph->animation = 0; +$lang->bug->report->options->graph->rotateNames = 0; +$lang->bug->report->options->graph->yAxisName = 'COUNT'; +$lang->bug->report->options->graph->pieRadius = 100; // 楗煎浘鐩村緞銆 +$lang->bug->report->options->graph->showColumnShadow = 0; // 鏄惁鏄剧ず鏌辩姸鍥鹃槾褰便 + +$lang->bug->report->bugsPerProject->graph->xAxisName = '椤圭洰'; +$lang->bug->report->bugsPerModule->graph->xAxisName = '妯″潡'; + +$lang->bug->report->openedBugsPerDay->swf = 'column2d'; +$lang->bug->report->openedBugsPerDay->height = 400; +$lang->bug->report->openedBugsPerDay->graph->xAxisName = '鏃ユ湡'; +$lang->bug->report->openedBugsPerDay->graph->rotateNames = 1; + +$lang->bug->report->resolvedBugsPerDay->swf = 'column2d'; +$lang->bug->report->resolvedBugsPerDay->height = 400; +$lang->bug->report->resolvedBugsPerDay->graph->xAxisName = '鏃ユ湡'; +$lang->bug->report->resolvedBugsPerDay->graph->rotateNames = 1; + +$lang->bug->report->closedBugsPerDay->swf = 'column2d'; +$lang->bug->report->closedBugsPerDay->height = 400; +$lang->bug->report->closedBugsPerDay->graph->xAxisName = '鏃ユ湡'; +$lang->bug->report->closedBugsPerDay->graph->rotateNames = 1; + +$lang->bug->report->openedBugsPerUser->graph->xAxisName = '鐢ㄦ埛'; +$lang->bug->report->resolvedBugsPerUser->graph->xAxisName= '鐢ㄦ埛'; +$lang->bug->report->closedBugsPerUser->graph->xAxisName = '鐢ㄦ埛'; + +$lang->bug->report->bugsPerSeverity->graph->xAxisName = '涓ラ噸绋嬪害'; +$lang->bug->report->bugsPerResolution->graph->xAxisName = '瑙e喅鏂规'; +$lang->bug->report->bugsPerStatus->graph->xAxisName = '鐘舵'; +$lang->bug->report->bugsPerType->graph->xAxisName = '绫诲瀷'; +$lang->bug->report->bugLiveDays->graph->xAxisName = '澶勭悊鏃堕棿'; +$lang->bug->report->bugHistories->graph->xAxisName = '澶勭悊姝ラ'; + +/* 鎿嶄綔璁板綍銆*/ +$lang->bug->action->resolved = array('main' => '$date, 鐢 $actor 瑙e喅锛屾柟妗堜负 $extra銆', 'extra' => $lang->bug->resolutionList); diff --git a/trunk/module/bug/model.php b/trunk/module/bug/model.php index e4df9aa615..02ceff5b3d 100644 --- a/trunk/module/bug/model.php +++ b/trunk/module/bug/model.php @@ -1,434 +1,434 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -?> -lang->bug->menu, 'product', $selectHtml . $this->lang->arrow); - common::setMenuVars($this->lang->bug->menu, 'bug', $productID); - common::setMenuVars($this->lang->bug->menu, 'testcase', $productID); - common::setMenuVars($this->lang->bug->menu, 'testtask', $productID); - } - - /* 鍒涘缓涓涓狟ug銆*/ - public function create() - { - $now = helper::now(); - $bug = fixer::input('post') - ->add('openedBy', $this->app->user->account) - ->add('openedDate', $now) - ->setDefault('project,story,task', 0) - ->setDefault('openedBuild', '') - ->setIF($this->post->assignedTo != '', 'assignedDate', $now) - ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) - ->specialChars('title,steps,keyword') - ->cleanInt('product, module, severity') - ->join('openedBuild', ',') - ->remove('files, labels') - ->get(); - $this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck($this->config->bug->create->requiredFields, 'notempty')->exec(); - if(!dao::isError()) - { - $bugID = $this->dao->lastInsertID(); - $this->loadModel('file')->saveUpload('bug', $bugID); - return $bugID; - } - return false; - } - - /* 鑾峰緱鏌愪竴涓骇鍝侊紝鏌愪竴涓ā鍧椾笅闈㈢殑鎵鏈塨ug銆*/ - public function getModuleBugs($productID, $moduleIds = 0, $orderBy = 'id_desc', $pager = null) - { - return $this->dao->select('*')->from(TABLE_BUG) - ->where('product')->eq((int)$productID) - ->onCaseOf(!empty($moduleIds))->andWhere('module')->in($moduleIds)->endCase() - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - - /* 鑾峰彇涓涓猙ug鐨勮缁嗕俊鎭*/ - public function getById($bugID) - { - $bug = $this->dao->select('t1.*, t2.name AS projectName, t3.title AS storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion, t4.name AS taskName') - ->from(TABLE_BUG)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') - ->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id') - ->leftJoin(TABLE_TASK)->alias('t4')->on('t1.task = t4.id') - ->where('t1.id')->eq((int)$bugID)->fetch(); - if(!$bug) return false; - foreach($bug as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $bug->$key = ''; - if($bug->mailto) - { - $bug->mailto = ltrim(trim($bug->mailto), ','); // 鍘绘帀寮濮嬬殑锛屻 - $bug->mailto = str_replace(' ', '', $bug->mailto); - $bug->mailto = rtrim($bug->mailto, ',') . ','; - $bug->mailto = str_replace(',', ', ', $bug->mailto); - } - if($bug->duplicateBug) $bug->duplicateBugTitle = $this->dao->findById($bug->duplicateBug)->from(TABLE_BUG)->fields('title')->fetch('title'); - if($bug->case) $bug->caseTitle = $this->dao->findById($bug->case)->from(TABLE_CASE)->fields('title')->fetch('title'); - if($bug->linkBug) $bug->linkBugTitles = $this->dao->select('id,title')->from(TABLE_BUG)->where('id')->in($bug->linkBug)->fetchPairs(); - $bug->files = $this->loadModel('file')->getByObject('bug', $bugID); - return $bug; - } - - /* 鏇存柊bug淇℃伅銆*/ - public function update($bugID) - { - $oldBug = $this->getById($bugID); - $now = helper::now(); - $bug = fixer::input('post') - ->cleanInt('product,module,severity,project,story,task') - ->specialChars('title,steps,keyword') - ->remove('comment,fiels,labels') - ->setDefault('project,module,project,story,task,duplicateBug', 0) - ->setDefault('openedBuild', '') - ->add('lastEditedBy', $this->app->user->account) - ->add('lastEditedDate', $now) - ->join('openedBuild', ',') - ->setIF($this->post->assignedTo != $oldBug->assignedTo, 'assignedDate', $now) - ->setIF($this->post->resolvedBy != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) - ->setIF($this->post->resolution != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) - ->setIF($this->post->resolution != '' and $this->post->resolvedBy == '', 'resolvedBy', $this->app->user->account) - ->setIF($this->post->closedBy != '' and $this->post->closedDate == '', 'closedDate', $now) - ->setIF($this->post->closedDate != '' and $this->post->closedBy == '', 'closedBy', $this->app->user->account) - ->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'assignedTo', 'closed') - ->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'assignedDate', $now) - ->setIF($this->post->resolution != '' or $this->post->resolvedDate != '', 'status', 'resolved') - ->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'status', 'closed') - ->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedTo', $oldBug->openedBy) - ->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedDate', $now) - ->setIF($this->post->resolution == '' and $this->post->resolvedDate =='', 'status', 'active') - ->setIF($this->post->story != false and $this->post->story != $oldBug->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) - ->get(); - - $this->dao->update(TABLE_BUG)->data($bug) - ->autoCheck() - ->batchCheck($this->config->bug->edit->requiredFields, 'notempty') - ->checkIF($bug->resolvedBy, 'resolution', 'notempty') - ->checkIF($bug->closedBy, 'resolution', 'notempty') - ->checkIF($bug->resolution == 'duplicate', 'duplicateBug', 'notempty') - ->where('id')->eq((int)$bugID) - ->exec(); - if(!dao::isError()) return common::createChanges($oldBug, $bug); - } - - /* 瑙e喅Bug銆*/ - public function resolve($bugID) - { - $oldBug = $this->getById($bugID); - $now = helper::now(); - $bug = fixer::input('post') - ->add('resolvedBy', $this->app->user->account) - ->add('resolvedDate', $now) - ->add('status', 'resolved') - ->add('assignedDate', $now) - ->add('lastEditedBy', $this->app->user->account) - ->add('lastEditedDate', $now) - ->setDefault('duplicateBug', 0) - ->setDefault('assignedTo', $oldBug->openedBy) - ->remove('comment') - ->get(); - - $this->dao->update(TABLE_BUG)->data($bug) - ->autoCheck() - ->batchCheck($this->config->bug->resolve->requiredFields, 'notempty') - ->checkIF($bug->resolution == 'duplicate', 'duplicateBug', 'notempty') - ->where('id')->eq((int)$bugID) - ->exec(); - } - - /* 婵娲籅ug銆*/ - public function activate($bugID) - { - $oldBug = $this->getById($bugID); - $now = helper::now(); - $bug = fixer::input('post') - ->setDefault('assignedTo', $oldBug->resolvedBy) - ->add('assignedDate', $now) - ->add('resolution', '') - ->add('status', 'active') - ->add('resolvedDate', '0000-00-00') - ->add('resolvedBy', '') - ->add('resolvedBuild', '') - ->add('closedBy', '') - ->add('closedDate', '0000-00-00') - ->add('duplicateBug', 0) - ->add('lastEditedBy', $this->app->user->account) - ->add('lastEditedDate', $now) - ->remove('comment,files,labels') - ->get(); - - $this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec(); - } - - /* 鍏抽棴Bug銆*/ - public function close($bugID) - { - $oldBug = $this->getById($bugID); - $now = helper::now(); - $bug = fixer::input('post') - ->add('assignedTo', 'closed') - ->add('assignedDate', $now) - ->add('status', 'closed') - ->add('closedBy', $this->app->user->account) - ->add('closedDate', $now) - ->add('lastEditedBy', $this->app->user->account) - ->add('lastEditedDate', $now) - ->remove('comment') - ->get(); - - $this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec(); - } - - /* 浠巄ug鍒楄〃涓彁鍙栨墍鏈夊嚭鐜拌繃鐨勮处鎴枫*/ - public function extractAccountsFromList($bugs) - { - $accounts = array(); - foreach($bugs as $bug) - { - if(!empty($bug->openedBy)) $accounts[] = $bug->openedBy; - if(!empty($bug->assignedTo)) $accounts[] = $bug->assignedTo; - if(!empty($bug->resolvedBy)) $accounts[] = $bug->resolvedBy; - if(!empty($bug->closedBy)) $accounts[] = $bug->closedBy; - if(!empty($bug->lastEditedBy)) $accounts[] = $bug->lastEditedBy; - } - return array_unique($accounts); - } - - /* 浠庝竴鏉ug涓彁鍙栨墍鏈夊嚭鐜拌繃鐨勮处鎴枫*/ - public function extractAccountsFromSingle($bug) - { - $accounts = array(); - if(!empty($bug->openedBy)) $accounts[] = $bug->openedBy; - if(!empty($bug->assignedTo)) $accounts[] = $bug->assignedTo; - if(!empty($bug->resolvedBy)) $accounts[] = $bug->resolvedBy; - if(!empty($bug->closedBy)) $accounts[] = $bug->closedBy; - if(!empty($bug->lastEditedBy)) $accounts[] = $bug->lastEditedBy; - return array_unique($accounts); - } - - /* 鑾峰緱鐢ㄦ埛鐨凚ug id=>title鍒楄〃銆*/ - public function getUserBugPairs($account) - { - $bugs = array(); - $stmt = $this->dao->select('t1.id, t1.title, t2.name as product') - ->from(TABLE_BUG)->alias('t1') - ->leftJoin(TABLE_PRODUCT)->alias('t2') - ->on('t1.product=t2.id') - ->where('t1.assignedTo')->eq($account) - ->andWhere('t1.deleted')->eq(0) - ->query(); - while($bug = $stmt->fetch()) - { - $bug->title = $bug->product . ' / ' . $bug->title; - $bugs[$bug->id] = $bug->title; - } - return $bugs; - } - - /* 鑾峰緱鏌愪釜椤圭洰鐨刡ug鍒楄〃銆*/ - public function getProjectBugs($projectID, $orderBy = 'id_desc', $pager = null) - { - return $this->dao->select('*')->from(TABLE_BUG) - ->where('project')->eq((int)$projectID) - ->andWhere('deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll(); - } - - /* 閫氳繃鏌愪竴娆℃祴璇曠粨鏋滆幏寰梑ug鐨勬爣棰樺拰姝ラ銆*/ - public function getBugInfoFromResult($resultID) - { - $title = ''; - $bugSteps = ''; - - $result = $this->dao->findById($resultID)->from(TABLE_TESTRESULT)->fetch(); - $run = $this->loadModel('testtask')->getRunById($result->run); - if($result and $result->caseResult == 'fail') - { - $title = $run->case->title; - $caseSteps = $run->case->steps; - $stepResults = unserialize($result->stepResults); - $bugSteps = $this->lang->bug->tblStep; - foreach($caseSteps as $key => $step) - { - $bugSteps .= ($key + 1) . '. ' .$step->desc . "\n"; - if($stepResults[$step->id]['result'] == 'fail') - { - $bugSteps .= $this->lang->bug->tblResult; - $bugSteps .= $stepResults[$step->id]['real'] . "\n"; - $bugSteps .= $this->lang->bug->tblExpect; - $bugSteps .= $step->expect; - break; - } - } - } - return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story); - } - - /* 鎸夐」鐩粺璁ug鏁般*/ - public function getDataOfBugsPerProject() - { - $datas = $this->dao->select('project as name, count(project) as value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('project')->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - $projects = $this->loadModel('project')->getPairs(); - foreach($datas as $projectID => $data) $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; - return $datas; - } - - /* 鎸変骇鍝佹ā鍧楃粺璁ug鏁般*/ - public function getDataOfBugsPerModule() - { - $datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('module')->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - $modules = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in(array_keys($datas))->fetchPairs(); - foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/'; - return $datas; - } - - /* 鎸塨ug鍒涘缓鏃ユ湡缁熻銆*/ - public function getDataOfOpenedBugsPerDay() - { - return $this->dao->select('DATE_FORMAT(openedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('openedDate')->fetchAll(); - } - - /* 鎸塨ug瑙e喅鏃ユ湡缁熻銆*/ - public function getDataOfResolvedBugsPerDay() - { - return $this->dao->select('DATE_FORMAT(resolvedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG) - ->where($this->session->bugReportCondition)->groupBy('name') - ->having('name != 0000-00-00') - ->orderBy('resolvedDate') - ->fetchAll(); - } - - /* 鎸塨ug鍏抽棴鏃ユ湡缁熻銆*/ - public function getDataOfClosedBugsPerDay() - { - return $this->dao->select('DATE_FORMAT(closedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG) - ->where($this->session->bugReportCondition)->groupBy('name') - ->having('name != 0000-00-00') - ->orderBy('closedDate')->fetchAll(); - } - - /* 鎸塨ug鍒涘缓鑰呯粺璁°*/ - public function getDataOfOpenedBugsPerUser() - { - $datas = $this->dao->select('openedBy AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); - foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; - return $datas; - } - - /* 鎸塨ug瑙e喅鑰呯粺璁°*/ - public function getDataOfResolvedBugsPerUser() - { - $datas = $this->dao->select('resolvedBy AS name, COUNT(*) AS value') - ->from(TABLE_BUG)->where($this->session->bugReportCondition) - ->andWhere('resolvedBy')->ne('') - ->groupBy('name') - ->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); - foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; - return $datas; - } - - /* 鎸塨ug鍏抽棴鑰呯粺璁°*/ - public function getDataOfClosedBugsPerUser() - { - $datas = $this->dao->select('closedBy AS name, COUNT(*) AS value') - ->from(TABLE_BUG) - ->where($this->session->bugReportCondition) - ->andWhere('closedBy')->ne('') - ->groupBy('name') - ->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); - foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; - return $datas; - } - - /* 鎸塨ug涓ラ噸绋嬪害缁熻銆*/ - public function getDataOfBugsPerSeverity() - { - $datas = $this->dao->select('severity AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - foreach($datas as $severity => $data) if(isset($this->lang->bug->severityList[$severity])) $data->name = $this->lang->bug->severityList[$severity]; - return $datas; - } - - /* 鎸塨ug瑙e喅鏂规缁熻銆*/ - public function getDataOfBugsPerResolution() - { - $datas = $this->dao->select('resolution AS name, COUNT(*) AS value') - ->from(TABLE_BUG) - ->where($this->session->bugReportCondition) - ->andWhere('resolution')->ne('') - ->groupBy('name')->orderBy('value DESC') - ->fetchAll('name'); - if(!$datas) return array(); - foreach($datas as $resolution => $data) if(isset($this->lang->bug->resolutionList[$resolution])) $data->name = $this->lang->bug->resolutionList[$resolution]; - return $datas; - } - - /* 鎸塨ug鐘舵佺粺璁°*/ - public function getDataOfBugsPerStatus() - { - $datas = $this->dao->select('status AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - foreach($datas as $status => $data) if(isset($this->lang->bug->statusList[$status])) $data->name = $this->lang->bug->statusList[$status]; - return $datas; - } - - /* 鎸塨ug绫诲瀷缁熻銆*/ - public function getDataOfBugsPerType() - { - $datas = $this->dao->select('type AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); - if(!$datas) return array(); - foreach($datas as $type => $data) if(isset($this->lang->bug->typeList[$type])) $data->name = $this->lang->bug->typeList[$type]; - return $datas; - } - - - /* 鍚堝苟鍏叡鐨刢hart璁剧疆鍜屽綋鍓峜hart鐨勮缃*/ - public function mergeChartOption($chartType) - { - $chartOption = $this->lang->bug->report->$chartType; - $commonOption = $this->lang->bug->report->options; - - /* 璁剧疆鍥捐〃鐨勬爣棰樺拰灞曠ず鏂瑰紡銆*/ - $chartOption->graph->caption = $this->lang->bug->report->charts[$chartType]; - if(!isset($chartOption->swf)) $chartOption->swf = $commonOption->swf; - if(!isset($chartOption->width)) $chartOption->width = $commonOption->width; - if(!isset($chartOption->height)) $chartOption->height = $commonOption->height; - - /* 鍚堝苟閰嶇疆銆*/ - foreach($commonOption->graph as $key => $value) if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value; - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> +lang->bug->menu, 'product', $selectHtml . $this->lang->arrow); + common::setMenuVars($this->lang->bug->menu, 'bug', $productID); + common::setMenuVars($this->lang->bug->menu, 'testcase', $productID); + common::setMenuVars($this->lang->bug->menu, 'testtask', $productID); + } + + /* 鍒涘缓涓涓狟ug銆*/ + public function create() + { + $now = helper::now(); + $bug = fixer::input('post') + ->add('openedBy', $this->app->user->account) + ->add('openedDate', $now) + ->setDefault('project,story,task', 0) + ->setDefault('openedBuild', '') + ->setIF($this->post->assignedTo != '', 'assignedDate', $now) + ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->specialChars('title,steps,keyword') + ->cleanInt('product, module, severity') + ->join('openedBuild', ',') + ->remove('files, labels') + ->get(); + $this->dao->insert(TABLE_BUG)->data($bug)->autoCheck()->batchCheck($this->config->bug->create->requiredFields, 'notempty')->exec(); + if(!dao::isError()) + { + $bugID = $this->dao->lastInsertID(); + $this->loadModel('file')->saveUpload('bug', $bugID); + return $bugID; + } + return false; + } + + /* 鑾峰緱鏌愪竴涓骇鍝侊紝鏌愪竴涓ā鍧椾笅闈㈢殑鎵鏈塨ug銆*/ + public function getModuleBugs($productID, $moduleIds = 0, $orderBy = 'id_desc', $pager = null) + { + return $this->dao->select('*')->from(TABLE_BUG) + ->where('product')->eq((int)$productID) + ->onCaseOf(!empty($moduleIds))->andWhere('module')->in($moduleIds)->endCase() + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + + /* 鑾峰彇涓涓猙ug鐨勮缁嗕俊鎭*/ + public function getById($bugID) + { + $bug = $this->dao->select('t1.*, t2.name AS projectName, t3.title AS storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion, t4.name AS taskName') + ->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id') + ->leftJoin(TABLE_TASK)->alias('t4')->on('t1.task = t4.id') + ->where('t1.id')->eq((int)$bugID)->fetch(); + if(!$bug) return false; + foreach($bug as $key => $value) if(strpos($key, 'Date') !== false and !(int)substr($value, 0, 4)) $bug->$key = ''; + if($bug->mailto) + { + $bug->mailto = ltrim(trim($bug->mailto), ','); // 鍘绘帀寮濮嬬殑锛屻 + $bug->mailto = str_replace(' ', '', $bug->mailto); + $bug->mailto = rtrim($bug->mailto, ',') . ','; + $bug->mailto = str_replace(',', ', ', $bug->mailto); + } + if($bug->duplicateBug) $bug->duplicateBugTitle = $this->dao->findById($bug->duplicateBug)->from(TABLE_BUG)->fields('title')->fetch('title'); + if($bug->case) $bug->caseTitle = $this->dao->findById($bug->case)->from(TABLE_CASE)->fields('title')->fetch('title'); + if($bug->linkBug) $bug->linkBugTitles = $this->dao->select('id,title')->from(TABLE_BUG)->where('id')->in($bug->linkBug)->fetchPairs(); + $bug->files = $this->loadModel('file')->getByObject('bug', $bugID); + return $bug; + } + + /* 鏇存柊bug淇℃伅銆*/ + public function update($bugID) + { + $oldBug = $this->getById($bugID); + $now = helper::now(); + $bug = fixer::input('post') + ->cleanInt('product,module,severity,project,story,task') + ->specialChars('title,steps,keyword') + ->remove('comment,fiels,labels') + ->setDefault('project,module,project,story,task,duplicateBug', 0) + ->setDefault('openedBuild', '') + ->add('lastEditedBy', $this->app->user->account) + ->add('lastEditedDate', $now) + ->join('openedBuild', ',') + ->setIF($this->post->assignedTo != $oldBug->assignedTo, 'assignedDate', $now) + ->setIF($this->post->resolvedBy != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) + ->setIF($this->post->resolution != '' and $this->post->resolvedDate == '', 'resolvedDate', $now) + ->setIF($this->post->resolution != '' and $this->post->resolvedBy == '', 'resolvedBy', $this->app->user->account) + ->setIF($this->post->closedBy != '' and $this->post->closedDate == '', 'closedDate', $now) + ->setIF($this->post->closedDate != '' and $this->post->closedBy == '', 'closedBy', $this->app->user->account) + ->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'assignedTo', 'closed') + ->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'assignedDate', $now) + ->setIF($this->post->resolution != '' or $this->post->resolvedDate != '', 'status', 'resolved') + ->setIF($this->post->closedBy != '' or $this->post->closedDate != '', 'status', 'closed') + ->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedTo', $oldBug->openedBy) + ->setIF(($this->post->resolution != '' or $this->post->resolvedDate != '') and $this->post->assignedTo == '', 'assignedDate', $now) + ->setIF($this->post->resolution == '' and $this->post->resolvedDate =='', 'status', 'active') + ->setIF($this->post->story != false and $this->post->story != $oldBug->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->get(); + + $this->dao->update(TABLE_BUG)->data($bug) + ->autoCheck() + ->batchCheck($this->config->bug->edit->requiredFields, 'notempty') + ->checkIF($bug->resolvedBy, 'resolution', 'notempty') + ->checkIF($bug->closedBy, 'resolution', 'notempty') + ->checkIF($bug->resolution == 'duplicate', 'duplicateBug', 'notempty') + ->where('id')->eq((int)$bugID) + ->exec(); + if(!dao::isError()) return common::createChanges($oldBug, $bug); + } + + /* 瑙e喅Bug銆*/ + public function resolve($bugID) + { + $oldBug = $this->getById($bugID); + $now = helper::now(); + $bug = fixer::input('post') + ->add('resolvedBy', $this->app->user->account) + ->add('resolvedDate', $now) + ->add('status', 'resolved') + ->add('assignedDate', $now) + ->add('lastEditedBy', $this->app->user->account) + ->add('lastEditedDate', $now) + ->setDefault('duplicateBug', 0) + ->setDefault('assignedTo', $oldBug->openedBy) + ->remove('comment') + ->get(); + + $this->dao->update(TABLE_BUG)->data($bug) + ->autoCheck() + ->batchCheck($this->config->bug->resolve->requiredFields, 'notempty') + ->checkIF($bug->resolution == 'duplicate', 'duplicateBug', 'notempty') + ->where('id')->eq((int)$bugID) + ->exec(); + } + + /* 婵娲籅ug銆*/ + public function activate($bugID) + { + $oldBug = $this->getById($bugID); + $now = helper::now(); + $bug = fixer::input('post') + ->setDefault('assignedTo', $oldBug->resolvedBy) + ->add('assignedDate', $now) + ->add('resolution', '') + ->add('status', 'active') + ->add('resolvedDate', '0000-00-00') + ->add('resolvedBy', '') + ->add('resolvedBuild', '') + ->add('closedBy', '') + ->add('closedDate', '0000-00-00') + ->add('duplicateBug', 0) + ->add('lastEditedBy', $this->app->user->account) + ->add('lastEditedDate', $now) + ->remove('comment,files,labels') + ->get(); + + $this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec(); + } + + /* 鍏抽棴Bug銆*/ + public function close($bugID) + { + $oldBug = $this->getById($bugID); + $now = helper::now(); + $bug = fixer::input('post') + ->add('assignedTo', 'closed') + ->add('assignedDate', $now) + ->add('status', 'closed') + ->add('closedBy', $this->app->user->account) + ->add('closedDate', $now) + ->add('lastEditedBy', $this->app->user->account) + ->add('lastEditedDate', $now) + ->remove('comment') + ->get(); + + $this->dao->update(TABLE_BUG)->data($bug)->autoCheck()->where('id')->eq((int)$bugID)->exec(); + } + + /* 浠巄ug鍒楄〃涓彁鍙栨墍鏈夊嚭鐜拌繃鐨勮处鎴枫*/ + public function extractAccountsFromList($bugs) + { + $accounts = array(); + foreach($bugs as $bug) + { + if(!empty($bug->openedBy)) $accounts[] = $bug->openedBy; + if(!empty($bug->assignedTo)) $accounts[] = $bug->assignedTo; + if(!empty($bug->resolvedBy)) $accounts[] = $bug->resolvedBy; + if(!empty($bug->closedBy)) $accounts[] = $bug->closedBy; + if(!empty($bug->lastEditedBy)) $accounts[] = $bug->lastEditedBy; + } + return array_unique($accounts); + } + + /* 浠庝竴鏉ug涓彁鍙栨墍鏈夊嚭鐜拌繃鐨勮处鎴枫*/ + public function extractAccountsFromSingle($bug) + { + $accounts = array(); + if(!empty($bug->openedBy)) $accounts[] = $bug->openedBy; + if(!empty($bug->assignedTo)) $accounts[] = $bug->assignedTo; + if(!empty($bug->resolvedBy)) $accounts[] = $bug->resolvedBy; + if(!empty($bug->closedBy)) $accounts[] = $bug->closedBy; + if(!empty($bug->lastEditedBy)) $accounts[] = $bug->lastEditedBy; + return array_unique($accounts); + } + + /* 鑾峰緱鐢ㄦ埛鐨凚ug id=>title鍒楄〃銆*/ + public function getUserBugPairs($account) + { + $bugs = array(); + $stmt = $this->dao->select('t1.id, t1.title, t2.name as product') + ->from(TABLE_BUG)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2') + ->on('t1.product=t2.id') + ->where('t1.assignedTo')->eq($account) + ->andWhere('t1.deleted')->eq(0) + ->query(); + while($bug = $stmt->fetch()) + { + $bug->title = $bug->product . ' / ' . $bug->title; + $bugs[$bug->id] = $bug->title; + } + return $bugs; + } + + /* 鑾峰緱鏌愪釜椤圭洰鐨刡ug鍒楄〃銆*/ + public function getProjectBugs($projectID, $orderBy = 'id_desc', $pager = null) + { + return $this->dao->select('*')->from(TABLE_BUG) + ->where('project')->eq((int)$projectID) + ->andWhere('deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + + /* 閫氳繃鏌愪竴娆℃祴璇曠粨鏋滆幏寰梑ug鐨勬爣棰樺拰姝ラ銆*/ + public function getBugInfoFromResult($resultID) + { + $title = ''; + $bugSteps = ''; + + $result = $this->dao->findById($resultID)->from(TABLE_TESTRESULT)->fetch(); + $run = $this->loadModel('testtask')->getRunById($result->run); + if($result and $result->caseResult == 'fail') + { + $title = $run->case->title; + $caseSteps = $run->case->steps; + $stepResults = unserialize($result->stepResults); + $bugSteps = $this->lang->bug->tblStep; + foreach($caseSteps as $key => $step) + { + $bugSteps .= ($key + 1) . '. ' .$step->desc . "\n"; + if($stepResults[$step->id]['result'] == 'fail') + { + $bugSteps .= $this->lang->bug->tblResult; + $bugSteps .= $stepResults[$step->id]['real'] . "\n"; + $bugSteps .= $this->lang->bug->tblExpect; + $bugSteps .= $step->expect; + break; + } + } + } + return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story); + } + + /* 鎸夐」鐩粺璁ug鏁般*/ + public function getDataOfBugsPerProject() + { + $datas = $this->dao->select('project as name, count(project) as value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('project')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + $projects = $this->loadModel('project')->getPairs(); + foreach($datas as $projectID => $data) $data->name = isset($projects[$projectID]) ? $projects[$projectID] : $this->lang->report->undefined; + return $datas; + } + + /* 鎸変骇鍝佹ā鍧楃粺璁ug鏁般*/ + public function getDataOfBugsPerModule() + { + $datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('module')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + $modules = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in(array_keys($datas))->fetchPairs(); + foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/'; + return $datas; + } + + /* 鎸塨ug鍒涘缓鏃ユ湡缁熻銆*/ + public function getDataOfOpenedBugsPerDay() + { + return $this->dao->select('DATE_FORMAT(openedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('openedDate')->fetchAll(); + } + + /* 鎸塨ug瑙e喅鏃ユ湡缁熻銆*/ + public function getDataOfResolvedBugsPerDay() + { + return $this->dao->select('DATE_FORMAT(resolvedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG) + ->where($this->session->bugReportCondition)->groupBy('name') + ->having('name != 0000-00-00') + ->orderBy('resolvedDate') + ->fetchAll(); + } + + /* 鎸塨ug鍏抽棴鏃ユ湡缁熻銆*/ + public function getDataOfClosedBugsPerDay() + { + return $this->dao->select('DATE_FORMAT(closedDate, "%Y-%m-%d") AS name, COUNT(*) AS value')->from(TABLE_BUG) + ->where($this->session->bugReportCondition)->groupBy('name') + ->having('name != 0000-00-00') + ->orderBy('closedDate')->fetchAll(); + } + + /* 鎸塨ug鍒涘缓鑰呯粺璁°*/ + public function getDataOfOpenedBugsPerUser() + { + $datas = $this->dao->select('openedBy AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); + foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; + return $datas; + } + + /* 鎸塨ug瑙e喅鑰呯粺璁°*/ + public function getDataOfResolvedBugsPerUser() + { + $datas = $this->dao->select('resolvedBy AS name, COUNT(*) AS value') + ->from(TABLE_BUG)->where($this->session->bugReportCondition) + ->andWhere('resolvedBy')->ne('') + ->groupBy('name') + ->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); + foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; + return $datas; + } + + /* 鎸塨ug鍏抽棴鑰呯粺璁°*/ + public function getDataOfClosedBugsPerUser() + { + $datas = $this->dao->select('closedBy AS name, COUNT(*) AS value') + ->from(TABLE_BUG) + ->where($this->session->bugReportCondition) + ->andWhere('closedBy')->ne('') + ->groupBy('name') + ->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + if(!isset($this->users)) $this->users = $this->loadModel('user')->getPairs('noletter'); + foreach($datas as $account => $data) if(isset($this->users[$account])) $data->name = $this->users[$account]; + return $datas; + } + + /* 鎸塨ug涓ラ噸绋嬪害缁熻銆*/ + public function getDataOfBugsPerSeverity() + { + $datas = $this->dao->select('severity AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + foreach($datas as $severity => $data) if(isset($this->lang->bug->severityList[$severity])) $data->name = $this->lang->bug->severityList[$severity]; + return $datas; + } + + /* 鎸塨ug瑙e喅鏂规缁熻銆*/ + public function getDataOfBugsPerResolution() + { + $datas = $this->dao->select('resolution AS name, COUNT(*) AS value') + ->from(TABLE_BUG) + ->where($this->session->bugReportCondition) + ->andWhere('resolution')->ne('') + ->groupBy('name')->orderBy('value DESC') + ->fetchAll('name'); + if(!$datas) return array(); + foreach($datas as $resolution => $data) if(isset($this->lang->bug->resolutionList[$resolution])) $data->name = $this->lang->bug->resolutionList[$resolution]; + return $datas; + } + + /* 鎸塨ug鐘舵佺粺璁°*/ + public function getDataOfBugsPerStatus() + { + $datas = $this->dao->select('status AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + foreach($datas as $status => $data) if(isset($this->lang->bug->statusList[$status])) $data->name = $this->lang->bug->statusList[$status]; + return $datas; + } + + /* 鎸塨ug绫诲瀷缁熻銆*/ + public function getDataOfBugsPerType() + { + $datas = $this->dao->select('type AS name, COUNT(*) AS value')->from(TABLE_BUG)->where($this->session->bugReportCondition)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + if(!$datas) return array(); + foreach($datas as $type => $data) if(isset($this->lang->bug->typeList[$type])) $data->name = $this->lang->bug->typeList[$type]; + return $datas; + } + + + /* 鍚堝苟鍏叡鐨刢hart璁剧疆鍜屽綋鍓峜hart鐨勮缃*/ + public function mergeChartOption($chartType) + { + $chartOption = $this->lang->bug->report->$chartType; + $commonOption = $this->lang->bug->report->options; + + /* 璁剧疆鍥捐〃鐨勬爣棰樺拰灞曠ず鏂瑰紡銆*/ + $chartOption->graph->caption = $this->lang->bug->report->charts[$chartType]; + if(!isset($chartOption->swf)) $chartOption->swf = $commonOption->swf; + if(!isset($chartOption->width)) $chartOption->width = $commonOption->width; + if(!isset($chartOption->height)) $chartOption->height = $commonOption->height; + + /* 鍚堝苟閰嶇疆銆*/ + foreach($commonOption->graph as $key => $value) if(!isset($chartOption->graph->$key)) $chartOption->graph->$key = $value; + } +} diff --git a/trunk/module/bug/view/activate.html.php b/trunk/module/bug/view/activate.html.php index c2bd8015b6..84f00ea023 100644 --- a/trunk/module/bug/view/activate.html.php +++ b/trunk/module/bug/view/activate.html.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang * @package bug * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ ?> diff --git a/trunk/module/bug/view/browse.html.php b/trunk/module/bug/view/browse.html.php index 404e6f20cc..aa8e586004 100644 --- a/trunk/module/bug/view/browse.html.php +++ b/trunk/module/bug/view/browse.html.php @@ -1,149 +1,149 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - - - - - - -
-
-
- " . $lang->bug->moduleBugs . " "; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToMe¶m=0"), $lang->bug->assignToMe) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=openedByMe¶m=0"), $lang->bug->openedByMe) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=resolvedByMe¶m=0"), $lang->bug->resolvedByMe) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToNull¶m=0"), $lang->bug->assignToNull) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs¶m=0"), $lang->bug->postponedBugs) . ""; - echo "{$lang->bug->byQuery} "; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . ""; - echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->bug->needConfirm) . ""; - ?> -
-
- exportCSV, $lang->setFileName);?> - bug->report->common); ?> - bug->create); ?> -
-
-
'>
-
- -
' id='mainbox'> - -
-
- recTotal}&recPerPage={$pager->recPerPage}"; ?> - - - - - - - - - - - - - - - - - - - - - - id");?> - - - - - - - - - - - - - - - - - - -
idAB);?>bug->severityAB);?> priAB);?>bug->title);?>bug->story);?>actions;?>openedByAB);?>assignedToAB);?>bug->resolvedBy);?>bug->resolutionAB);?>actions;?>
bug->severityList[$bug->severity]?>bug->priList[$bug->pri]?>title);?>createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?>id"), $lang->confirm, 'hiddenwin')?>openedBy];?>assignedTo == $this->app->user->account) echo 'class="red"';?>>assignedTo];?>resolvedBy];?>bug->resolutionList[$bug->resolution];?> - id"; - if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' '; - if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' '; - common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit); - ?> -
- show();?> -
-
- -
' id='treebox'> -
-
- -
- createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manage);?> -
-
-
- -
- - +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + + + + + + +
+
+
+ " . $lang->bug->moduleBugs . " "; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToMe¶m=0"), $lang->bug->assignToMe) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=openedByMe¶m=0"), $lang->bug->openedByMe) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=resolvedByMe¶m=0"), $lang->bug->resolvedByMe) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToNull¶m=0"), $lang->bug->assignToNull) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs¶m=0"), $lang->bug->longLifeBugs) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs¶m=0"), $lang->bug->postponedBugs) . ""; + echo "{$lang->bug->byQuery} "; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . ""; + echo "" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->bug->needConfirm) . ""; + ?> +
+
+ exportCSV, $lang->setFileName);?> + bug->report->common); ?> + bug->create); ?> +
+
+
'>
+
+ +
' id='mainbox'> + +
+
+ recTotal}&recPerPage={$pager->recPerPage}"; ?> + + + + + + + + + + + + + + + + + + + + + + id");?> + + + + + + + + + + + + + + + + + + +
idAB);?>bug->severityAB);?> priAB);?>bug->title);?>bug->story);?>actions;?>openedByAB);?>assignedToAB);?>bug->resolvedBy);?>bug->resolutionAB);?>actions;?>
bug->severityList[$bug->severity]?>bug->priList[$bug->pri]?>title);?>createLink('story', 'view', "stoyID=$bug->story"), $bug->storyTitle, '_blank');?>id"), $lang->confirm, 'hiddenwin')?>openedBy];?>assignedTo == $this->app->user->account) echo 'class="red"';?>>assignedTo];?>resolvedBy];?>bug->resolutionList[$bug->resolution];?> + id"; + if(!($bug->status == 'active' and common::printLink('bug', 'resolve', $params, $lang->bug->buttonResolve))) echo $lang->bug->buttonResolve . ' '; + if(!($bug->status == 'resolved' and common::printLink('bug', 'close', $params, $lang->bug->buttonClose))) echo $lang->bug->buttonClose . ' '; + common::printLink('bug', 'edit', $params, $lang->bug->buttonEdit); + ?> +
+ show();?> +
+
+ +
' id='treebox'> +
+
+ +
+ createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manage);?> +
+
+
+ +
+ + diff --git a/trunk/module/bug/view/close.html.php b/trunk/module/bug/view/close.html.php index a471cd946d..50cae3464e 100644 --- a/trunk/module/bug/view/close.html.php +++ b/trunk/module/bug/view/close.html.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang * @package bug * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ ?> diff --git a/trunk/module/bug/view/create.html.php b/trunk/module/bug/view/create.html.php index 5c61cf805d..77c4a61c59 100644 --- a/trunk/module/bug/view/create.html.php +++ b/trunk/module/bug/view/create.html.php @@ -1,192 +1,192 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bug->create;?>
bug->lblProductAndModule;?> - - -
bug->lblProjectAndTask;?> - - -
bug->lblStory;?> - -
bug->openedBuild;?> - -
bug->lblTypeAndSeverity;?> - bug->typeList, 'codeerror', 'class=select-2');?> - bug->severityList, '', 'class=select-2');?> -
bug->lblSystemBrowserAndHardware;?> - bug->osList, '', 'class=select-2');?> - bug->browserList, '', 'class=select-2');?> -
bug->lblAssignedTo;?>
bug->lblMailto;?>
bug->title;?>
bug->steps;?>
bug->keywords;?>
bug->files;?>fetch('file', 'buildform');?>
- -
-
-
- +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->create;?>
bug->lblProductAndModule;?> + + +
bug->lblProjectAndTask;?> + + +
bug->lblStory;?> + +
bug->openedBuild;?> + +
bug->lblTypeAndSeverity;?> + bug->typeList, 'codeerror', 'class=select-2');?> + bug->severityList, '', 'class=select-2');?> +
bug->lblSystemBrowserAndHardware;?> + bug->osList, '', 'class=select-2');?> + bug->browserList, '', 'class=select-2');?> +
bug->lblAssignedTo;?>
bug->lblMailto;?>
bug->title;?>
bug->steps;?>
bug->keywords;?>
bug->files;?>fetch('file', 'buildform');?>
+ +
+
+
+ diff --git a/trunk/module/bug/view/edit.html.php b/trunk/module/bug/view/edit.html.php index 5e259c022f..a326486eb0 100644 --- a/trunk/module/bug/view/edit.html.php +++ b/trunk/module/bug/view/edit.html.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang * @package bug * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ ?> diff --git a/trunk/module/bug/view/index.html.php b/trunk/module/bug/view/index.html.php index 96b72107b0..cb4cb2c979 100644 --- a/trunk/module/bug/view/index.html.php +++ b/trunk/module/bug/view/index.html.php @@ -1,28 +1,28 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - -
-
+. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + +
+
\ No newline at end of file diff --git a/trunk/module/bug/view/report.html.php b/trunk/module/bug/view/report.html.php index 2ae72a4031..117e9002cc 100644 --- a/trunk/module/bug/view/report.html.php +++ b/trunk/module/bug/view/report.html.php @@ -1,77 +1,77 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package bug - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - - -
-
-
bug->report->common;?>
-
goback); ?>
-
-
- -
-
-
bug->report->select;?>
-
-
- bug->report->charts, $checkedCharts);?> -
bug->report->create);?>
-
-
-
- -
-
- - - $chartContent):?> - - - - - -
bug->report->common;?>
- - - - - - - $data):?> - - - - - - -
report->item;?>report->value;?>report->percent;?>
name;?>value;?>percent * 100) . '%';?>
-
-
-
-
- - +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + + +
+
+
bug->report->common;?>
+
goback); ?>
+
+
+ +
+
+
bug->report->select;?>
+
+
+ bug->report->charts, $checkedCharts);?> +
bug->report->create);?>
+
+
+
+ +
+
+ + + $chartContent):?> + + + + + +
bug->report->common;?>
+ + + + + + + $data):?> + + + + + + +
report->item;?>report->value;?>report->percent;?>
name;?>value;?>percent * 100) . '%';?>
+
+
+
+
+ + diff --git a/trunk/module/bug/view/resolve.html.php b/trunk/module/bug/view/resolve.html.php index 7a1bd04ab2..c57073bdf4 100644 --- a/trunk/module/bug/view/resolve.html.php +++ b/trunk/module/bug/view/resolve.html.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang * @package bug * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ ?> diff --git a/trunk/module/bug/view/sendmail.html.php b/trunk/module/bug/view/sendmail.html.php index 617eb8b1de..519fe374b3 100644 --- a/trunk/module/bug/view/sendmail.html.php +++ b/trunk/module/bug/view/sendmail.html.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang * @package bug * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ ?> diff --git a/trunk/module/bug/view/view.html.php b/trunk/module/bug/view/view.html.php index 1ace0a05c0..bc7a1b7efc 100644 --- a/trunk/module/bug/view/view.html.php +++ b/trunk/module/bug/view/view.html.php @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * along with ZenTaoMS. If not, see . * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang * @package bug * @version $Id$ - * @link http://www.zentao.cn + * @link http://www.zentaoms.com */ ?> diff --git a/trunk/module/build/control.php b/trunk/module/build/control.php index 19c992a6ce..04337fdd41 100644 --- a/trunk/module/build/control.php +++ b/trunk/module/build/control.php @@ -1,122 +1,122 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -class build extends control -{ - /* 娣诲姞build銆*/ - public function create($projectID) - { - if(!empty($_POST)) - { - $buildID = $this->build->create($projectID); - if(dao::isError()) die(js::error(dao::getError())); - $this->loadModel('action')->create('build', $buildID, 'opened'); - die(js::locate($this->createLink('project', 'build', "project=$projectID"), 'parent')); - } - - /* 璁剧疆鑿滃崟銆*/ - $this->loadModel('project')->setMenu($this->project->getPairs(), $projectID); - - /* 璧嬪笺*/ - $this->view->header->title = $this->lang->build->create; - $this->view->products = $this->project->getProducts($projectID); - $this->view->users = $this->loadModel('user')->getPairs(); - $this->display(); - } - - /* 缂栬緫build銆*/ - public function edit($buildID) - { - if(!empty($_POST)) - { - $changes = $this->build->update($buildID); - if(dao::isError()) die(js::error(dao::getError())); - if($changes) - { - $actionID = $this->loadModel('action')->create('build', $buildID, 'edited'); - $this->action->logHistory($actionID, $changes); - } - die(js::locate(inlink('view', "buildID=$buildID"), 'parent')); - } - - /* 璁剧疆鑿滃崟銆*/ - $build = $this->build->getById((int)$buildID); - $this->loadModel('project')->setMenu($this->project->getPairs(), $build->project); - - /* 璧嬪笺*/ - $this->view->header->title = $this->lang->build->edit; - $this->view->position[] = $this->lang->build->edit; - $this->view->products = $this->project->getProducts($build->project); - $this->view->users = $this->loadModel('user')->getPairs(); - $this->view->build = $build; - $this->display(); - } - - /* 鏌ョ湅build銆*/ - public function view($buildID) - { - /* 璁剧疆鑿滃崟銆*/ - $build = $this->build->getById((int)$buildID); - if(!$build) die(js::error($this->lang->notFound) . js::locate('back')); - - $this->loadModel('project')->setMenu($this->project->getPairs(), $build->project); - - /* 璧嬪笺*/ - $this->view->header->title = $this->lang->build->view; - $this->view->position[] = $this->lang->build->view; - $this->view->products = $this->project->getProducts($build->project); - $this->view->users = $this->loadModel('user')->getPairs(); - $this->view->build = $build; - $this->view->actions = $this->loadModel('action')->getList('build', $buildID); - $this->display(); - } - - /* 鍒犻櫎build銆*/ - public function delete($buildID, $confirm = 'no') - { - if($confirm == 'no') - { - die(js::confirm($this->lang->build->confirmDelete, $this->createLink('build', 'delete', "buildID=$buildID&confirm=yes"))); - } - else - { - $build = $this->build->getById($buildID); - $this->build->delete(TABLE_BUILD, $buildID); - die(js::locate($this->createLink('project', 'build', "projectID=$build->project"), 'parent')); - } - } - - /* AJAX鎺ュ彛锛氳幏寰椾骇鍝佺殑build鍒楄〃銆*/ - public function ajaxGetProductBuilds($productID, $varName, $build = '') - { - if($varName == 'openedBuild') die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, 'noempty'), $build, 'size=4 class=select-3 multiple')); - if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, 'noempty'), $build, 'class=select-3')); - } - - /* AJAX鎺ュ彛锛氳幏寰楅」鐩殑build鍒楄〃銆*/ - public function ajaxGetProjectBuilds($projectID, $varName, $build = '') - { - if($varName == 'openedBuild') die(html::select($varName . '[]', $this->build->getProjectBuildPairs($projectID, 'noempty'), $build, 'size=4 class=select-3 multiple')); - if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, 'noempty'), $build, 'class=select-3')); - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +class build extends control +{ + /* 娣诲姞build銆*/ + public function create($projectID) + { + if(!empty($_POST)) + { + $buildID = $this->build->create($projectID); + if(dao::isError()) die(js::error(dao::getError())); + $this->loadModel('action')->create('build', $buildID, 'opened'); + die(js::locate($this->createLink('project', 'build', "project=$projectID"), 'parent')); + } + + /* 璁剧疆鑿滃崟銆*/ + $this->loadModel('project')->setMenu($this->project->getPairs(), $projectID); + + /* 璧嬪笺*/ + $this->view->header->title = $this->lang->build->create; + $this->view->products = $this->project->getProducts($projectID); + $this->view->users = $this->loadModel('user')->getPairs(); + $this->display(); + } + + /* 缂栬緫build銆*/ + public function edit($buildID) + { + if(!empty($_POST)) + { + $changes = $this->build->update($buildID); + if(dao::isError()) die(js::error(dao::getError())); + if($changes) + { + $actionID = $this->loadModel('action')->create('build', $buildID, 'edited'); + $this->action->logHistory($actionID, $changes); + } + die(js::locate(inlink('view', "buildID=$buildID"), 'parent')); + } + + /* 璁剧疆鑿滃崟銆*/ + $build = $this->build->getById((int)$buildID); + $this->loadModel('project')->setMenu($this->project->getPairs(), $build->project); + + /* 璧嬪笺*/ + $this->view->header->title = $this->lang->build->edit; + $this->view->position[] = $this->lang->build->edit; + $this->view->products = $this->project->getProducts($build->project); + $this->view->users = $this->loadModel('user')->getPairs(); + $this->view->build = $build; + $this->display(); + } + + /* 鏌ョ湅build銆*/ + public function view($buildID) + { + /* 璁剧疆鑿滃崟銆*/ + $build = $this->build->getById((int)$buildID); + if(!$build) die(js::error($this->lang->notFound) . js::locate('back')); + + $this->loadModel('project')->setMenu($this->project->getPairs(), $build->project); + + /* 璧嬪笺*/ + $this->view->header->title = $this->lang->build->view; + $this->view->position[] = $this->lang->build->view; + $this->view->products = $this->project->getProducts($build->project); + $this->view->users = $this->loadModel('user')->getPairs(); + $this->view->build = $build; + $this->view->actions = $this->loadModel('action')->getList('build', $buildID); + $this->display(); + } + + /* 鍒犻櫎build銆*/ + public function delete($buildID, $confirm = 'no') + { + if($confirm == 'no') + { + die(js::confirm($this->lang->build->confirmDelete, $this->createLink('build', 'delete', "buildID=$buildID&confirm=yes"))); + } + else + { + $build = $this->build->getById($buildID); + $this->build->delete(TABLE_BUILD, $buildID); + die(js::locate($this->createLink('project', 'build', "projectID=$build->project"), 'parent')); + } + } + + /* AJAX鎺ュ彛锛氳幏寰椾骇鍝佺殑build鍒楄〃銆*/ + public function ajaxGetProductBuilds($productID, $varName, $build = '') + { + if($varName == 'openedBuild') die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, 'noempty'), $build, 'size=4 class=select-3 multiple')); + if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, 'noempty'), $build, 'class=select-3')); + } + + /* AJAX鎺ュ彛锛氳幏寰楅」鐩殑build鍒楄〃銆*/ + public function ajaxGetProjectBuilds($projectID, $varName, $build = '') + { + if($varName == 'openedBuild') die(html::select($varName . '[]', $this->build->getProjectBuildPairs($projectID, 'noempty'), $build, 'size=4 class=select-3 multiple')); + if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, 'noempty'), $build, 'class=select-3')); + } +} diff --git a/trunk/module/build/lang/en.php b/trunk/module/build/lang/en.php index 7f7d7e674b..b6b8f4dc6d 100644 --- a/trunk/module/build/lang/en.php +++ b/trunk/module/build/lang/en.php @@ -1,42 +1,42 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->build->common = 'Build'; -$lang->build->create = "鍒涘缓Build"; -$lang->build->edit = "缂栬緫Build"; -$lang->build->delete = "鍒犻櫎Build"; -$lang->build->view = "Build璇︽儏"; -$lang->build->ajaxGetProductBuilds = '鎺ュ彛:浜у搧Build鍒楄〃'; -$lang->build->ajaxGetProjectBuilds = '鎺ュ彛:椤圭洰Build鍒楄〃'; - -$lang->build->confirmDelete = "鎮ㄧ‘璁ゅ垹闄よbuild鍚楋紵"; - -$lang->build->id = 'ID'; -$lang->build->product = '浜у搧'; -$lang->build->project = '椤圭洰'; -$lang->build->name = '鍚嶇О缂栧彿'; -$lang->build->date = 'Build鏃ユ湡'; -$lang->build->builder = '鏋勫缓鑰'; -$lang->build->scmPath = '婧愪唬鐮佸湴鍧'; -$lang->build->filePath = '瀛樺偍鍦板潃'; -$lang->build->desc = '鎻忚堪'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->build->common = 'Build'; +$lang->build->create = "鍒涘缓Build"; +$lang->build->edit = "缂栬緫Build"; +$lang->build->delete = "鍒犻櫎Build"; +$lang->build->view = "Build璇︽儏"; +$lang->build->ajaxGetProductBuilds = '鎺ュ彛:浜у搧Build鍒楄〃'; +$lang->build->ajaxGetProjectBuilds = '鎺ュ彛:椤圭洰Build鍒楄〃'; + +$lang->build->confirmDelete = "鎮ㄧ‘璁ゅ垹闄よbuild鍚楋紵"; + +$lang->build->id = 'ID'; +$lang->build->product = '浜у搧'; +$lang->build->project = '椤圭洰'; +$lang->build->name = '鍚嶇О缂栧彿'; +$lang->build->date = 'Build鏃ユ湡'; +$lang->build->builder = '鏋勫缓鑰'; +$lang->build->scmPath = '婧愪唬鐮佸湴鍧'; +$lang->build->filePath = '瀛樺偍鍦板潃'; +$lang->build->desc = '鎻忚堪'; diff --git a/trunk/module/build/lang/zh-cn.php b/trunk/module/build/lang/zh-cn.php index 2ab6428ce6..52be59c910 100644 --- a/trunk/module/build/lang/zh-cn.php +++ b/trunk/module/build/lang/zh-cn.php @@ -1,42 +1,42 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -$lang->build->common = 'Build'; -$lang->build->create = "鍒涘缓Build"; -$lang->build->edit = "缂栬緫Build"; -$lang->build->delete = "鍒犻櫎Build"; -$lang->build->view = "Build璇︽儏"; -$lang->build->ajaxGetProductBuilds = '鎺ュ彛:浜у搧Build鍒楄〃'; -$lang->build->ajaxGetProjectBuilds = '鎺ュ彛:椤圭洰Build鍒楄〃'; - -$lang->build->confirmDelete = "鎮ㄧ‘璁ゅ垹闄よbuild鍚楋紵"; - -$lang->build->id = 'ID'; -$lang->build->product = '浜у搧'; -$lang->build->project = '椤圭洰'; -$lang->build->name = '鍚嶇О缂栧彿'; -$lang->build->date = 'Build鏃ユ湡'; -$lang->build->builder = '鏋勫缓鑰'; -$lang->build->scmPath = '婧愪唬鐮佸湴鍧'; -$lang->build->filePath = '瀛樺偍鍦板潃'; -$lang->build->desc = '鎻忚堪'; +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +$lang->build->common = 'Build'; +$lang->build->create = "鍒涘缓Build"; +$lang->build->edit = "缂栬緫Build"; +$lang->build->delete = "鍒犻櫎Build"; +$lang->build->view = "Build璇︽儏"; +$lang->build->ajaxGetProductBuilds = '鎺ュ彛:浜у搧Build鍒楄〃'; +$lang->build->ajaxGetProjectBuilds = '鎺ュ彛:椤圭洰Build鍒楄〃'; + +$lang->build->confirmDelete = "鎮ㄧ‘璁ゅ垹闄よbuild鍚楋紵"; + +$lang->build->id = 'ID'; +$lang->build->product = '浜у搧'; +$lang->build->project = '椤圭洰'; +$lang->build->name = '鍚嶇О缂栧彿'; +$lang->build->date = 'Build鏃ユ湡'; +$lang->build->builder = '鏋勫缓鑰'; +$lang->build->scmPath = '婧愪唬鐮佸湴鍧'; +$lang->build->filePath = '瀛樺偍鍦板潃'; +$lang->build->desc = '鎻忚堪'; diff --git a/trunk/module/build/model.php b/trunk/module/build/model.php index ea8d9cd7f0..10ab118557 100644 --- a/trunk/module/build/model.php +++ b/trunk/module/build/model.php @@ -1,116 +1,116 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -?> -dao->select('t1.*, t2.name as projectName, t3.name as productName') - ->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') - ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') - ->where('t1.id')->eq((int)$buildID) - ->orderBy('t1.id DESC') - ->fetch(); - } - - /* 鏌ユ壘椤圭洰涓殑build鍒楄〃銆*/ - public function getProjectBuilds($projectID) - { - return $this->dao->select('t1.*, t2.name as projectName, t3.name as productName') - ->from(TABLE_BUILD)->alias('t1') - ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') - ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') - ->where('t1.project')->eq((int)$projectID) - ->andWhere('t1.deleted')->eq(0) - ->orderBy('t1.id DESC') - ->fetchAll(); - } - - /* 鏌ユ壘椤圭洰涓殑build鍒楄〃銆俻arams='noempty|notrunk' */ - public function getProjectBuildPairs($projectID, $params = '') - { - $sysBuilds = array(); - if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); - if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); - - $builds = $this->dao->select('id,name')->from(TABLE_BUILD) - ->where('project')->eq((int)$projectID) - ->andWhere('deleted')->eq(0) - ->orderBy('id desc')->fetchPairs(); - if(!$builds) return $sysBuilds; - $releases = $this->dao->select('build,name')->from(TABLE_RELEASE) - ->where('build')->in(array_keys($builds)) - ->andWhere('deleted')->eq(0) - ->fetchPairs(); - foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName; - return $sysBuilds + $builds; - } - - /* 鏌ユ壘浜у搧涓殑build鍒楄〃銆俻arams='noempty|notrunk' */ - public function getProductBuildPairs($productID, $params = '') - { - $sysBuilds = array(); - if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); - if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); - - $builds = $this->dao->select('id,name')->from(TABLE_BUILD) - ->where('product')->eq((int)$productID) - ->andWhere('deleted')->eq(0) - ->orderBy('id desc')->fetchPairs(); - if(!$builds) return $sysBuilds; - $releases = $this->dao->select('build,name')->from(TABLE_RELEASE) - ->where('build')->in(array_keys($builds)) - ->andWhere('deleted')->eq(0) - ->fetchPairs(); - foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName; - return $sysBuilds + $builds; - } - - /* 鍒涘缓銆*/ - public function create($projectID) - { - $build = fixer::input('post') - ->stripTags('name') - ->specialChars('desc') - ->add('project', (int)$projectID) - ->get(); - $this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->exec(); - if(!dao::isError()) return $this->dao->lastInsertID(); - } - - /* 缂栬緫銆*/ - public function update($buildID) - { - $oldBuild = $this->getByID($buildID); - $build = fixer::input('post') - ->stripTags('name') - ->specialChars('desc') - ->get(); - $this->dao->update(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->edit->requiredFields, 'notempty')->where('id')->eq((int)$buildID)->exec(); - if(!dao::isError()) return common::createChanges($oldBuild, $build); - } -} +. + * + * @copyright Copyright 2009-2010 闈掑矝鏄撹蒋澶╁垱缃戠粶绉戞妧鏈夐檺鍏徃(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> +dao->select('t1.*, t2.name as projectName, t3.name as productName') + ->from(TABLE_BUILD)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') + ->where('t1.id')->eq((int)$buildID) + ->orderBy('t1.id DESC') + ->fetch(); + } + + /* 鏌ユ壘椤圭洰涓殑build鍒楄〃銆*/ + public function getProjectBuilds($projectID) + { + return $this->dao->select('t1.*, t2.name as projectName, t3.name as productName') + ->from(TABLE_BUILD)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') + ->where('t1.project')->eq((int)$projectID) + ->andWhere('t1.deleted')->eq(0) + ->orderBy('t1.id DESC') + ->fetchAll(); + } + + /* 鏌ユ壘椤圭洰涓殑build鍒楄〃銆俻arams='noempty|notrunk' */ + public function getProjectBuildPairs($projectID, $params = '') + { + $sysBuilds = array(); + if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); + if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); + + $builds = $this->dao->select('id,name')->from(TABLE_BUILD) + ->where('project')->eq((int)$projectID) + ->andWhere('deleted')->eq(0) + ->orderBy('id desc')->fetchPairs(); + if(!$builds) return $sysBuilds; + $releases = $this->dao->select('build,name')->from(TABLE_RELEASE) + ->where('build')->in(array_keys($builds)) + ->andWhere('deleted')->eq(0) + ->fetchPairs(); + foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName; + return $sysBuilds + $builds; + } + + /* 鏌ユ壘浜у搧涓殑build鍒楄〃銆俻arams='noempty|notrunk' */ + public function getProductBuildPairs($productID, $params = '') + { + $sysBuilds = array(); + if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); + if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk'); + + $builds = $this->dao->select('id,name')->from(TABLE_BUILD) + ->where('product')->eq((int)$productID) + ->andWhere('deleted')->eq(0) + ->orderBy('id desc')->fetchPairs(); + if(!$builds) return $sysBuilds; + $releases = $this->dao->select('build,name')->from(TABLE_RELEASE) + ->where('build')->in(array_keys($builds)) + ->andWhere('deleted')->eq(0) + ->fetchPairs(); + foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName; + return $sysBuilds + $builds; + } + + /* 鍒涘缓銆*/ + public function create($projectID) + { + $build = fixer::input('post') + ->stripTags('name') + ->specialChars('desc') + ->add('project', (int)$projectID) + ->get(); + $this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->exec(); + if(!dao::isError()) return $this->dao->lastInsertID(); + } + + /* 缂栬緫銆*/ + public function update($buildID) + { + $oldBuild = $this->getByID($buildID); + $build = fixer::input('post') + ->stripTags('name') + ->specialChars('desc') + ->get(); + $this->dao->update(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->edit->requiredFields, 'notempty')->where('id')->eq((int)$buildID)->exec(); + if(!dao::isError()) return common::createChanges($oldBuild, $build); + } +} diff --git a/trunk/module/build/view/create.html.php b/trunk/module/build/view/create.html.php index 42fc412d4c..da4429a737 100644 --- a/trunk/module/build/view/create.html.php +++ b/trunk/module/build/view/create.html.php @@ -1,63 +1,63 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
build->create;?>
build->product;?>
build->name;?>
build->builder;?>user->account, 'class="select-3"');?>
build->date;?>
build->scmPath;?>
build->filePath;?>
build->desc;?>
- - - +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
build->create;?>
build->product;?>
build->name;?>
build->builder;?>user->account, 'class="select-3"');?>
build->date;?>
build->scmPath;?>
build->filePath;?>
build->desc;?>
+
+
+ diff --git a/trunk/module/build/view/edit.html.php b/trunk/module/build/view/edit.html.php index 4fb43704e2..d001763e0d 100644 --- a/trunk/module/build/view/edit.html.php +++ b/trunk/module/build/view/edit.html.php @@ -1,63 +1,63 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
build->edit;?>
build->product;?>product, "class='select-3'");?>
build->name;?>name, "class='text-3'");?>
build->builder;?>user->account, 'class="select-3"');?>
build->date;?>date, "class='text-3 date'");?>
build->scmPath;?>scmPath, "class='text-1'");?>
build->filePath;?>filePath, "class='text-1'");?>
build->desc;?>desc, "rows='5' class='area-1'");?>
project);?>
-
-
- +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
build->edit;?>
build->product;?>product, "class='select-3'");?>
build->name;?>name, "class='text-3'");?>
build->builder;?>user->account, 'class="select-3"');?>
build->date;?>date, "class='text-3 date'");?>
build->scmPath;?>scmPath, "class='text-1'");?>
build->filePath;?>filePath, "class='text-1'");?>
build->desc;?>desc, "rows='5' class='area-1'");?>
project);?>
+
+
+ diff --git a/trunk/module/build/view/view.html.php b/trunk/module/build/view/view.html.php index c7d4c4afd7..59aab08f10 100644 --- a/trunk/module/build/view/view.html.php +++ b/trunk/module/build/view/view.html.php @@ -1,72 +1,72 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package build - * @version $Id$ - * @link http://www.zentao.cn - */ -?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
build->view;?>
build->product;?>productName;?>
build->name;?>'>name;?>
build->builder;?>builder];?>
build->date;?>date;?>
build->scmPath;?>scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?>
build->filePath;?>filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?>
build->desc;?>desc);?>
-
- session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project"); - if(!$build->deleted) - { - common::printLink('build', 'edit', "buildID=$build->id", $lang->edit); - common::printLink('build', 'delete', "buildID=$build->id", $lang->delete, 'hiddenwin'); - } - echo html::a($browseLink, $lang->goback); - ?> -
- -
- +. + * + * @copyright Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com) + * @author Chunsheng Wang + * @package build + * @version $Id$ + * @link http://www.zentaoms.com + */ +?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
build->view;?>
build->product;?>productName;?>
build->name;?>'>name;?>
build->builder;?>builder];?>
build->date;?>date;?>
build->scmPath;?>scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?>
build->filePath;?>filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?>
build->desc;?>desc);?>
+
+ session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project"); + if(!$build->deleted) + { + common::printLink('build', 'edit', "buildID=$build->id", $lang->edit); + common::printLink('build', 'delete', "buildID=$build->id", $lang->delete, 'hiddenwin'); + } + echo html::a($browseLink, $lang->goback); + ?> +
+ +
+ diff --git a/trunk/module/common/control.php b/trunk/module/common/control.php index f5aabcdb4d..14e4cc9419 100644 --- a/trunk/module/common/control.php +++ b/trunk/module/common/control.php @@ -1,472 +1,472 @@ -. - * - * @copyright Copyright 2009-2010 Chunsheng Wang - * @author Chunsheng Wang - * @package common - * @version $Id$ - * @link http://www.zentao.cn - */ -class common extends control -{ - /** - * 构造函数:启动会话,加载公司模块,并设置公司信息。 - * - * @access public - * @return void - */ - public function __construct() - { - parent::__construct(); - session_start(); - $this->sendHeader(); - $this->loadModel('company'); - $this->setCompany(); - $this->setUser(); - } - - /** - * 检查用户对当前的请求有没有权限。如果没有权限,则跳转到登陆界面。 - * - * @access public - * @return void - */ - public function checkPriv() - { - $module = $this->app->getModuleName(); - $method = $this->app->getMethodName(); - if($module == 'user') - { - if($method == 'login' or $method == 'logout' or $method == 'deny') return true; - } - elseif($module == 'api' and $method == 'getsessionid') - { - return true; - } - elseif($module == 'misc' and $method == 'about') - { - return true; - } - - if(isset($this->app->user)) - { - if(!common::hasPriv($module, $method)) - { - $vars = "module=$module&method=$method"; - if(isset($_SERVER['HTTP_REFERER'])) - { - $referer = helper::safe64Encode($_SERVER['HTTP_REFERER']); - $vars .= "&referer=$referer"; - } - $denyLink = $this->createLink('user', 'deny', $vars); - - /* Fix the bug of IE: use js locate, can't get the referer. */ - if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) - { - echo <<