diff --git a/README.md b/README.md index 3bb3ba9f13..03fba2a8ab 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,27 @@ 1. What is ZenTao for? + ===================== ZenTao is an open source project management software, developed by Qingdao Nature Easy Soft Network Technology Co., Ltd. Combining product management, project management, quality management, document management, organization management and to-do management, ZenTao is a professional R & D project management software, covering the core processes of R & D project management. -ZenTao is practical and pragmatic. It has full features and a beautiful interface, and is easy to operate. Zentao is well structured and can be flexibly extended. It also has powerful search functions, various forms of statistical reports and complete API. +ZenTao is practical and pragmatic. It has full features and a beautiful interface, and is easy to operate. Zentao is well structured and can be flexibly extended. It also has powerful search features, various reports and API. ZenTao focuses on R & D project management! 2. Why called ZenTao? + ============================ Zen(禅) and Tao(道) are the two Chinese characters that have rich meanings in both religion and culture. ZenTao Project Management Software take the cutural meaning of Zen and Tao, and is expected to convey our understanding and thinking on management. Inspired by The Tao of Programming and The Zen of Programming, we named our software ZenTao. 3. Design philosophy of ZenTao Project Management Software + ========================================================== The main management philosophy of ZenTao Project Management Software is based on Scrum, an internationally popular agile management methodology. Scrum is very pragmatic and easy to operate, so it fits in the fast iterative software development projects. However, Scrum only defines the core management framework. There are still many details and processes that need to be extended and developed. Based on the philosophy of Scrum and the observation of the current R&D situation in China, ZenTao integrates bug management, test case management, release management and document management, and it covers the entire life cycle of software R&D. In ZenTao, the concept of product, project and test is clearly defined. Product team, development team and testing team coordinate and check with each other while they function differently. The three teams interact with each other through working on stories, tasks and bugs, and eventually deliver the product with quality. 4. Why choose ZenTao Project Management Software? + =============================================== * ZenTao is a professional R&D project management software and canot be replaced by simple project management software. @@ -26,25 +30,27 @@ The main management philosophy of ZenTao Project Management Software is based on * Open source codes and flexible extension mechanism, convenient for uses and secondary development of companies. * Underlying framework and front-end UI framework developed independently; robust and stable with beautiful interface and friendly interaction. * Perfect community mechanism; you can get technical support and help in time. -* Zero input which means you have no risk for choosing ZenTao compared with other commercial software that cost you tens of thousands of dollars. -* Support various deployments, either private deployment or cloud services. +* Zero input which means you have no risk for choosing ZenTao compared with other commercial software that cost you thousands of dollars. +* Support various deployments, either private deployment or cloud service. 5. Features of ZenTao Project Management Software + ====================================================== * Product management: including products, stories, plans, releases and roadmaps; * Project management: including projects, tasks, teams, versions and burn-down charts; -* Quality management: including bus, test cases, test tasks and test results; +* Quality management: including bugs, test cases, test tasks and test results; * Document management: including product document library, project document library and customized document library; -* Affair management: including to-do management and personal management, such as my tasks, my bugs, my story and my projects; -* Organization management: including department, users, groups and authorities; -* Statistics function: various statistical reports; -* Search function: powerful search functions to help you find the data you need. -* Extension mechanism:extensible almost anywhere in ZenTao; +* Work management: including to-do management and personal management, such as my tasks, my bugs, my story and my projects; +* Organization management: including department, users, groups and privileges; +* Statistics: various reports; +* Search: powerful search features to help you find the data you need. +* Extension mechanism: extensible almost anywhere in ZenTao; * API mechanism, visible API: convenient for integration with other systems. 6. Website + ========== Our website is: [www.zentao.pm](http://www.zentao.pm) diff --git a/Readme_zh.md b/Readme_zh.md new file mode 100644 index 0000000000..b655076313 --- /dev/null +++ b/Readme_zh.md @@ -0,0 +1,41 @@ +一、什么是禅道项目管理软件? + +禅道是第一款国产的开源项目管理软件。它集产品管理、项目管理、质量管理、文档管理、 组织管理和事务管理于一体,是一款专业的研发项目管理软件,完整地覆盖了项目管理的核心流程。禅道管理思想注重实效,软件架构合理,操作简洁高效,代码实现合理,内置灵活的扩展机制和api调用机制,支持多语言。 + +二、为什么用“禅道”这个名字? + +禅和道是中国文化中极具代表意义的两个字,是中国传统文化的结晶。我们之所以选用“禅道”作为我们软件的名字,是希望通过这两个字来传达我们对管理的理解和思考。我们希望通过禅道来进行的管理,可以摒弃繁文缛节,还原管理的本质! + +三、禅道的设计理念 + +禅道项目管理软件的主要管理思想基于国际流行的敏捷项目管理方 式——Scrum。scrum是一种注重实效的敏捷项目管理方式。它规定了核心的管理框架,但具体的细节还需要团队自行扩充。禅道在遵循其管理方式基础上,又融入了国内研发现状的很多需求,比如bug管理,测试用例管理,发布管理,文档管理等。因此禅道不仅仅是一款scrum敏捷项目管理工 具,更是一款完备的项目管理软件。基于scrum,又不局限于scrum。 + +禅道还首次创造性的将产品、项目、测试这三者的概念明确分开,互相配合,又互相制约,通过需求、任务、bug来进行交相互动,终通过项目拿到合格的产品。 + +四、选择禅道的八大理由: +1. 开源的软件,保证了您使用的放心和灵活。 +2. 先进的管理思想,让您在竞争中拔得头筹。 +3. 完备的管理功能,无需再整合其他多个系统。 +4. 国产软件,中文支持,操作习惯更符合国人。 +5. 灵活的扩展机制,可以保证您不局限于禅道自身的功能。 +6. 日趋完善的社区机制,可以获得及时的技术支持和帮助,保证您无后顾之忧。 +7. 几乎为零的投入,禅道作为开源软件,其投入几乎为零,相比动辄十几万的商业软件,您选择禅道没有任何风险。 +8. 开发团队已经公司化运作,保证软件的持久发展。我们从04年从事开源软件开发以来,已经坚持了六年。 + +五、禅道的功能列表: + +1. 产品管理:包括产品、需求、计划、发布、路线图等功能。 +2. 项目管理:包括项目、任务、团队、build、燃尽图等功能。 +3. 质量管理:包括bug、测试用例、测试任务、测试结果等功能。 +4. 文档管理:包括产品文档库、项目文档库、自定义文档库等功能。 +5. 事务管理:包括todo管理,我的任务、我的Bug、我的需求、我的项目等个人事务管理功能。 +6. 组织管理:包括部门、用户、分组、权限等功能。 +7. 统计功能:丰富的统计表。 +8. 搜索功能:强大的搜索,帮助您找到相应的数据。 +9. 灵活的扩展机制,几乎可以对禅道的任何地方进行扩展。 +10. 强大的api机制,方便与其他系统集成。 + + +也许您已经"众里寻她千百度",那么让禅道带给您“蓦然回首,那人却在灯火阑珊处”的惊喜吧!Let's zentao! + +禅道官方网站: [www.zentao.net](http://www.zentao.net) diff --git a/VERSION b/VERSION index 0359f24328..5992115771 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.4 +9.5.stable diff --git a/config/config.php b/config/config.php index 997c8eb030..53475a302a 100644 --- a/config/config.php +++ b/config/config.php @@ -16,20 +16,20 @@ if(!class_exists('config')){class config{}} if(!function_exists('getWebRoot')){function getWebRoot(){}} /* 基本设置。Basic settings. */ -$config->version = '9.4'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. -$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. -$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. +$config->version = '9.5'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. +$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. $config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. $config->webRoot = ''; // URL根目录。 The root path of the url. /* 框架路由相关设置。Routing settings. */ $config->requestType = 'PATH_INFO'; // 请求类型:PATH_INFO|PATHINFO2|GET。 The request type: PATH_INFO|PATH_INFO2|GET. -$config->requestFix = '-'; // PATH_INFO和PATH_INFO2模式的分隔符。 The divider in the url when PATH_INFO|PATH_INFO2. -$config->moduleVar = 'm'; // 请求类型为GET:模块变量名。 requestType=GET: the module var name. -$config->methodVar = 'f'; // 请求类型为GET:模块变量名。 requestType=GET: the method var name. -$config->viewVar = 't'; // 请求类型为GET:视图变量名。 requestType=GET: the view var name. -$config->sessionVar = 'zentaosid'; // 请求类型为GET:session变量名。 requestType=GET: the session var name. -$config->views = ',html,json,mhtml,'; // 支持的视图类型。 Supported view formats. +$config->requestFix = '-'; // PATH_INFO和PATH_INFO2模式的分隔符。 The divider in the url when PATH_INFO|PATH_INFO2. +$config->moduleVar = 'm'; // 请求类型为GET:模块变量名。 requestType=GET: the module var name. +$config->methodVar = 'f'; // 请求类型为GET:模块变量名。 requestType=GET: the method var name. +$config->viewVar = 't'; // 请求类型为GET:视图变量名。 requestType=GET: the view var name. +$config->sessionVar = 'zentaosid'; // 请求类型为GET:session变量名。 requestType=GET: the session var name. +$config->views = ',html,json,mhtml,'; // 支持的视图类型。 Supported view formats. /* 支持的主题和语言。Supported thems and languages. */ $config->themes['default'] = 'default'; diff --git a/config/filter.php b/config/filter.php index 868577e010..99e4c601cd 100644 --- a/config/filter.php +++ b/config/filter.php @@ -158,7 +158,6 @@ $filter->todo->export->cookie['checkedItem'] = 'reg::checked'; $filter->user->login->cookie['keepLogin'] = 'equal::on'; - $filter->block->default->get['hash'] = 'reg::md5'; $filter->block->main->get['blockid'] = 'code'; $filter->block->main->get['blockTitle'] = 'reg::any'; diff --git a/db/update9.5.sql b/db/update9.5.sql new file mode 100644 index 0000000000..41d9aef0af --- /dev/null +++ b/db/update9.5.sql @@ -0,0 +1,3 @@ +ALTER TABLE `zt_bug` ADD `activatedDate` datetime NOT NULL AFTER `activatedCount`; +ALTER TABLE `zt_user` ADD `limitedUser` varchar(8) NOT NULL default 'no' AFTER `role`; +ALTER TABLE `zt_team` ADD `limitedUser` varchar(8) NOT NULL default 'no' AFTER `role`; diff --git a/db/zentao.sql b/db/zentao.sql index f0ca787360..518462e434 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -68,6 +68,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( `color` char(7) NOT NULL, `confirmed` tinyint(1) NOT NULL default '0', `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, `mailto` text, `openedBy` varchar(30) NOT NULL default '', `openedDate` datetime NOT NULL, diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 0de231abec..d105e98637 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,17 +1,29 @@ +2017-08-25 9.5.stable +3124 取消工时记录的255字数限制 +3123 导出增加对个数字段的支持 +3122 文档附件库默认按照时间从新到旧的顺序显示 +3121 测试bug增加批量激活功能 已完成 +3120 测试报告导出功能增加相应的权限 +3119 每日提醒异步邮件列表中的发送人改成后台发信配置中的发信人 +3118 测试-用例 从用例库导入用例的时候增加搜索功能 +3117 已删除用户默认不再列出 +3116 文档库的附件库增加列表展示方式 +以及修改了大量的已知BUG。 + 2017-07-24 9.4 -3078 将跳回然之框架的功能默认设置为关闭 -3077 bug导出增加对 截止日期 字段的支持 -3076 把禅道数据库中所有的mailto字段都修改成 text 类型 -3075 增加bug提交和编辑表单编辑器的高度 -3074 数据库受损修复增加超级管理员验证 -3073 计划列表默认显示全部。 -3071 集成到然之之后右上角个人中心的菜单向左展开 -3070 批量操作的滚动条将选择和编辑按钮的边框去掉 -3069 测试-版本关联用例的时候过滤掉未评审的用例 -3068 发布关联需求的时候给默认的推荐列表 -3067 调整产品发布关联需求页面的排版 -3066 创建计划时提示之前的计划名称 -3065 附件库继承产品或者项目的访问权限 +3078 将跳回然之框架的功能默认设置为关闭 +3077 bug导出增加对 截止日期 字段的支持 +3076 把禅道数据库中所有的mailto字段都修改成 text 类型 +3075 增加bug提交和编辑表单编辑器的高度 +3074 数据库受损修复增加超级管理员验证 +3073 计划列表默认显示全部。 +3071 集成到然之之后右上角个人中心的菜单向左展开 +3070 批量操作的滚动条将选择和编辑按钮的边框去掉 +3069 测试-版本关联用例的时候过滤掉未评审的用例 +3068 发布关联需求的时候给默认的推荐列表 +3067 调整产品发布关联需求页面的排版 +3066 创建计划时提示之前的计划名称 +3065 附件库继承产品或者项目的访问权限 2017-06-21 9.3.beta 3038 修改loadModel改为单例模式,提升性能 diff --git a/framework/helper.class.php b/framework/helper.class.php index a6f142d08e..165ba1bab1 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -124,3 +124,20 @@ function isonlybody() { return helper::inOnlyBodyMode(); } + +/** + * Format time. + * + * @param int $time + * @param string $format + * @access public + * @return void + */ +function formatTime($time, $format = '') +{ + $time = str_replace('0000-00-00', '', $time); + $time = str_replace('00:00:00', '', $time); + if(trim($time) == '') return ; + if($format) return date($format, strtotime($time)); + return trim($time); +} diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index a7afcbbfb5..4200dcb6a8 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -112,7 +112,7 @@ class baseHTML if(empty($title)) $title = $href; $newline = $newline ? "\n" : ''; - + return "$title$newline"; } diff --git a/lib/phpmailer/phpmailer.class.php b/lib/phpmailer/phpmailer.class.php index 7902a07c8a..19613f3828 100644 --- a/lib/phpmailer/phpmailer.class.php +++ b/lib/phpmailer/phpmailer.class.php @@ -1724,16 +1724,16 @@ class PHPMailer { switch (strtolower($position)) { case 'phrase': - $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + $encoded = preg_replace_callback("/([^A-Za-z0-9!*+\/ -])/", array(&$this, 'ordChar'), $encoded); break; case 'comment': - $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded); + $encoded = preg_replace_callback("/([\(\)\"])/", array(&$this, 'ordChar'), $encoded); case 'text': default: // Replace every high ascii, control =, ? and _ characters //TODO using /e (equivalent to eval()) is probably not a good idea - $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e', - "'='.sprintf('%02X', ord('\\1'))", $encoded); + $encoded = preg_replace_callback('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/', + array(&$this, 'ordChar'), $encoded); break; } @@ -2309,6 +2309,11 @@ class PHPMailer { call_user_func_array($this->action_function,$params); } } + + public function ordChar($match) + { + return '=' . sprintf('%02X', ord($match[1])); + } } class phpmailerException extends Exception { diff --git a/module/action/lang/en.php b/module/action/lang/en.php index a5aa9f1920..05fd1dd1cb 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -33,6 +33,13 @@ $lang->action->confirmHideAll = 'Do you want to hide all the records?'; $lang->action->needEdit = '%s you want to restore has already existed. Please edit it.'; $lang->action->historyEdit = 'The history editor cannot be empty.'; +$lang->action->history = new stdclass(); +$lang->action->history->action = 'Bound action'; +$lang->action->history->field = 'Field'; +$lang->action->history->old = 'Old value'; +$lang->action->history->new = 'New value'; +$lang->action->history->diff = 'Diff'; + $lang->action->dynamic = new stdclass(); $lang->action->dynamic->today = 'Today'; $lang->action->dynamic->yesterday = 'Yesterday'; @@ -106,6 +113,7 @@ $lang->action->desc->paused = '$date, paused by $actor. $lang->action->desc->diff1 = '%s has been changed. Its value was "%s" and the new value is "%s".
' . "\n"; $lang->action->desc->diff2 = '%s has been changed. The difference is ' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = 'File Name %s was changed to %s .' . "\n"; +$lang->action->desc->linked2bug = '$date Link to build $extra by $actor'; /* 关联用例和移除用例时的历史操作记录。*/ $lang->action->desc->linkrelatedcase = '$date, $actor linked relevant use case $extra.' . "\n"; @@ -168,6 +176,8 @@ $lang->action->label->suspended = 'Suspended'; $lang->action->label->login = 'Login'; $lang->action->label->logout = "Logout"; $lang->action->label->deleteestimate = "Deleted Man-Hour"; +$lang->action->label->linked2build = "Linked"; +$lang->action->label->linked2bug = "Linked"; /* 用来生成相应对象的链接。*/ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 2a9707252b..78f3a12eb0 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -33,6 +33,13 @@ $lang->action->confirmHideAll = '您确定要全部隐藏这些记录吗?'; $lang->action->needEdit = '要还原%s的名称或代号已经存在,请编辑更改。'; $lang->action->historyEdit = '历史记录编辑不能为空。'; +$lang->action->history = new stdclass(); +$lang->action->history->action = '关联日志'; +$lang->action->history->field = '字段'; +$lang->action->history->old = '旧值'; +$lang->action->history->new = '新值'; +$lang->action->history->diff = '不同'; + $lang->action->dynamic = new stdclass(); $lang->action->dynamic->today = '今天'; $lang->action->dynamic->yesterday = '昨天'; @@ -106,6 +113,7 @@ $lang->action->desc->paused = '$date, 由 $actor 暂停 $lang->action->desc->diff1 = '修改了 %s,旧值为 "%s",新值为 "%s"。
' . "\n"; $lang->action->desc->diff2 = '修改了 %s,区别为:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n"; +$lang->action->desc->linked2bug = '$date 由 $actor 关联到版本 $extra'; /* 关联用例和移除用例时的历史操作记录。*/ $lang->action->desc->linkrelatedcase = '$date, 由 $actor 关联相关用例 $extra。' . "\n"; @@ -168,8 +176,8 @@ $lang->action->label->suspended = '挂起'; $lang->action->label->login = '登录系统'; $lang->action->label->logout = "退出登录"; $lang->action->label->deleteestimate = "删除了工时"; -$lang->action->label->linked2build = "关联版本"; -$lang->action->label->linked2bug = "关联BUG"; +$lang->action->label->linked2build = "关联了"; +$lang->action->label->linked2bug = "关联了"; /* 用来生成相应对象的链接。*/ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; diff --git a/module/action/lang/zh-tw.php b/module/action/lang/zh-tw.php index 4ae7a62869..a5419411b8 100755 --- a/module/action/lang/zh-tw.php +++ b/module/action/lang/zh-tw.php @@ -33,6 +33,13 @@ $lang->action->confirmHideAll = '您確定要全部隱藏這些記錄嗎?'; $lang->action->needEdit = '要還原%s的名稱或代號已經存在,請編輯更改。'; $lang->action->historyEdit = '歷史記錄編輯不能為空。'; +$lang->action->history = new stdclass(); +$lang->action->history->action = '關聯日誌'; +$lang->action->history->field = '欄位'; +$lang->action->history->old = '舊值'; +$lang->action->history->new = '新值'; +$lang->action->history->diff = '不同'; + $lang->action->dynamic = new stdclass(); $lang->action->dynamic->today = '今天'; $lang->action->dynamic->yesterday = '昨天'; @@ -106,6 +113,7 @@ $lang->action->desc->paused = '$date, 由 $actor 暫停 $lang->action->desc->diff1 = '修改了 %s,舊值為 "%s",新值為 "%s"。
' . "\n"; $lang->action->desc->diff2 = '修改了 %s,區別為:' . "\n" . "
%s
" . "\n"; $lang->action->desc->diff3 = '將檔案名 %s 改為 %s 。' . "\n"; +$lang->action->desc->linked2bug = '$date 由 $actor 關聯到版本 $extra'; /* 關聯用例和移除用例時的歷史操作記錄。*/ $lang->action->desc->linkrelatedcase = '$date, 由 $actor 關聯相關用例 $extra。' . "\n"; @@ -168,6 +176,8 @@ $lang->action->label->suspended = '掛起'; $lang->action->label->login = '登錄系統'; $lang->action->label->logout = "退出登錄"; $lang->action->label->deleteestimate = "刪除了工時"; +$lang->action->label->linked2build = "關聯了"; +$lang->action->label->linked2bug = "關聯了"; /* 用來生成相應對象的連結。*/ $lang->action->label->product = $lang->productCommon . '|product|view|productID=%s'; diff --git a/module/action/model.php b/module/action/model.php index a95df52acf..ea71e3097d 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -222,84 +222,91 @@ class actionModel extends model if($actionName == 'svncommited' and isset($commiters[$action->actor])) { $action->actor = $commiters[$action->actor]; + if($this->config->requestType == 'GET') $action->comment = str_replace('+', '%2B', $action->comment); } elseif($actionName == 'gitcommited' and isset($commiters[$action->actor])) { $action->actor = $commiters[$action->actor]; + if($this->config->requestType == 'GET') $action->comment = str_replace('+', '%2B', $action->comment); } elseif($actionName == 'linked2project') { $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('project', 'story', "projectID=$action->extra"), $name); + if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), $name) : $name; } elseif($actionName == 'linked2plan') { $title = $this->dao->select('title')->from(TABLE_PRODUCTPLAN)->where('id')->eq($action->extra)->fetch('title'); - if($title) $action->extra = html::a(helper::createLink('productplan', 'view', "planID=$action->extra"), $title); + if($title) $action->extra = common::hasPriv('productplan', 'view') ? html::a(helper::createLink('productplan', 'view', "planID=$action->extra"), $title) : $title; } elseif($actionName == 'linked2build') { $name = $this->dao->select('name')->from(TABLE_BUILD)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('build', 'view', "builID=$action->extra&type={$action->objectType}"), $name); + if($name) $action->extra = common::hasPriv('build', 'view') ? html::a(helper::createLink('build', 'view', "builID=$action->extra&type={$action->objectType}"), $name) : $name; + } + elseif($actionName == 'linked2bug') + { + $name = $this->dao->select('name')->from(TABLE_BUILD)->where('id')->eq($action->extra)->fetch('name'); + if($name) $action->extra = common::hasPriv('build', 'view') ? html::a(helper::createLink('build', 'view', "builID=$action->extra&type={$action->objectType}"), $name) : $name; } elseif($actionName == 'linked2release') { $name = $this->dao->select('name')->from(TABLE_RELEASE)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('release', 'view', "releaseID=$action->extra&type={$action->objectType}"), $name); + if($name) $action->extra = common::hasPriv('release', 'view') ? html::a(helper::createLink('release', 'view', "releaseID=$action->extra&type={$action->objectType}"), $name) : $name; } elseif($actionName == 'moved') { $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('project', 'task', "projectID=$action->extra"), "#$action->extra " . $name); + if($name) $action->extra = common::hasPriv('project', 'task') ? html::a(helper::createLink('project', 'task', "projectID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name; } - elseif($actionName == 'frombug') + elseif($actionName == 'frombug' and common::hasPriv('bug', 'view')) { $action->extra = html::a(helper::createLink('bug', 'view', "bugID=$action->extra"), $action->extra); } elseif($actionName == 'unlinkedfromproject') { $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('project', 'story', "projectID=$action->extra"), "#$action->extra " . $name); + if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name; } elseif($actionName == 'unlinkedfrombuild') { $name = $this->dao->select('name')->from(TABLE_BUILD)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('build', 'view', "builID=$action->extra&type={$action->objectType}"), $name); + if($name) $action->extra = common::hasPriv('build', 'view') ? html::a(helper::createLink('build', 'view', "builID=$action->extra&type={$action->objectType}"), $name) : $name; } elseif($actionName == 'unlinkedfromrelease') { $name = $this->dao->select('name')->from(TABLE_RELEASE)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('release', 'view', "releaseID=$action->extra&type={$action->objectType}"), $name); + if($name) $action->extra = common::hasPriv('release', 'view') ? html::a(helper::createLink('release', 'view', "releaseID=$action->extra&type={$action->objectType}"), $name) : $name; } elseif($actionName == 'unlinkedfromplan') { $title = $this->dao->select('title')->from(TABLE_PRODUCTPLAN)->where('id')->eq($action->extra)->fetch('title'); - if($title) $action->extra = html::a(helper::createLink('productplan', 'view', "planID=$action->extra"), "#$action->extra " . $title); + if($title) $action->extra = common::hasPriv('productplan', 'view') ? html::a(helper::createLink('productplan', 'view', "planID=$action->extra"), "#$action->extra " . $title) : "#$action->extra " . $title; } elseif($actionName == 'tostory') { $title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title'); - if($title) $action->extra = html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title); + if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title) : "#$action->extra " . $title; } elseif($actionName == 'totask') { $name = $this->dao->select('name')->from(TABLE_TASK)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('task', 'view', "taskID=$action->extra"), "#$action->extra " . $name); + if($name) $action->extra = common::hasPriv('task', 'view') ? html::a(helper::createLink('task', 'view', "taskID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name; } elseif($actionName == 'buildopened') { $name = $this->dao->select('name')->from(TABLE_BUILD)->where('id')->eq($action->objectID)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('build', 'view', "buildID=$action->objectID"), "#$action->objectID " . $name); + if($name) $action->extra = common::hasPriv('build', 'view') ? html::a(helper::createLink('build', 'view', "buildID=$action->objectID"), "#$action->objectID " . $name) : "#$action->objectID " . $name; } elseif($actionName == 'testtaskopened' or $actionName == 'testtaskstarted' or $actionName == 'testtaskclosed') { $name = $this->dao->select('name')->from(TABLE_TESTTASK)->where('id')->eq($action->objectID)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('testtask', 'view', "testtaskID=$action->objectID"), "#$action->objectID " . $name); + if($name) $action->extra = common::hasPriv('testtask', 'view') ? html::a(helper::createLink('testtask', 'view', "testtaskID=$action->objectID"), "#$action->objectID " . $name) : "#$action->objectID " . $name; } elseif($actionName == 'fromlib' and $action->objectType == 'case') { $name = $this->dao->select('name')->from(TABLE_TESTSUITE)->where('id')->eq($action->extra)->fetch('name'); - if($name) $action->extra = html::a(helper::createLink('testsuite', 'library', "libID=$action->extra"), $name); + if($name) $action->extra = common::hasPriv('testsuite', 'library') ? html::a(helper::createLink('testsuite', 'library', "libID=$action->extra"), $name) : $name; } elseif(($actionName == 'closed' and $action->objectType == 'story') or ($actionName == 'resolved' and $action->objectType == 'bug')) { @@ -698,7 +705,13 @@ class actionModel extends model $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; + $action->objectLabel = $objectType; + if(isset($this->lang->action->label->$objectType)) + { + $objectLabel = $this->lang->action->label->$objectType; + if(!is_array($objectLabel)) $action->objectLabel = $objectLabel; + if(is_array($objectLabel) and isset($objectLabel[$actionType])) $action->objectLabel = $objectLabel[$actionType]; + } /* If action type is login or logout, needn't link. */ if($actionType == 'svncommited') @@ -710,8 +723,12 @@ class actionModel extends model if(strpos($action->objectLabel, '|') !== false) { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); - $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); - if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + $action->objectLink = ''; + if(common::hasPriv($moduleName, $methodName)) + { + $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); + if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + } $action->objectLabel = $objectLabel; } else diff --git a/module/api/model.php b/module/api/model.php index 4aae257696..35eba4f407 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -51,7 +51,7 @@ class apiModel extends model */ public function request($moduleName, $methodName, $action) { - $host = common::getSysURL() . $this->config->webRoot; + $host = common::getSysURL(); $param = ''; if($action == 'extendModel') { diff --git a/module/block/control.php b/module/block/control.php index 3366454bf0..2b6c9a5d1d 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -21,7 +21,7 @@ class block extends control { parent::__construct($moduleName, $methodName); /* Mark the call from zentao or ranzhi. */ - $this->selfCall = strpos($this->server->http_referer, common::getSysURL()) === 0 || $this->session->blockModule; + $this->selfCall = strpos($this->server->http_referer, common::getSysURL() . $this->config->webRoot) === 0 || $this->session->blockModule; if($this->methodName != 'admin' and $this->methodName != 'dashboard' and !$this->selfCall and !$this->loadModel('sso')->checkKey()) die(''); } @@ -197,7 +197,7 @@ class block extends control */ public function dashboard($module) { - $this->session->set('blockModule', $module); + if($this->loadModel('user')->isLogon()) $this->session->set('blockModule', $module); $blocks = $this->block->getBlockList($module); $inited = empty($this->config->$module->common->blockInited) ? '' : $this->config->$module->common->blockInited; diff --git a/module/block/lang/en.php b/module/block/lang/en.php index 178f40a75a..db1ae32a0c 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -16,6 +16,14 @@ $lang->block->style = 'Style'; $lang->block->grid = 'Grid'; $lang->block->color = 'Color'; +$lang->block->account = 'Account'; +$lang->block->module = 'Module'; +$lang->block->title = 'Title'; +$lang->block->source = 'Source module'; +$lang->block->block = 'Source block'; +$lang->block->order = 'Order'; +$lang->block->height = 'Height'; + $lang->block->lblModule = 'Module'; $lang->block->lblBlock = 'Widget'; $lang->block->lblNum = 'Number'; diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index 4c7a63691b..0bbfe758ae 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -16,6 +16,14 @@ $lang->block->style = '外观'; $lang->block->grid = '宽度'; $lang->block->color = '颜色'; +$lang->block->account = '所属用户'; +$lang->block->module = '所属模块'; +$lang->block->title = '区块名称'; +$lang->block->source = '来源模块'; +$lang->block->block = '来源区块'; +$lang->block->order = '排序'; +$lang->block->height = '高度'; + $lang->block->lblModule = '模块'; $lang->block->lblBlock = '区块'; $lang->block->lblNum = '条数'; diff --git a/module/block/lang/zh-tw.php b/module/block/lang/zh-tw.php index a29148c939..e4212b3b10 100644 --- a/module/block/lang/zh-tw.php +++ b/module/block/lang/zh-tw.php @@ -16,6 +16,14 @@ $lang->block->style = '外觀'; $lang->block->grid = '寬度'; $lang->block->color = '顏色'; +$lang->block->account = '所屬用戶'; +$lang->block->module = '所屬模組'; +$lang->block->title = '區塊名稱'; +$lang->block->source = '來源模組'; +$lang->block->block = '來源區塊'; +$lang->block->order = '排序'; +$lang->block->height = '高度'; + $lang->block->lblModule = '模組'; $lang->block->lblBlock = '區塊'; $lang->block->lblNum = '條數'; diff --git a/module/branch/lang/en.php b/module/branch/lang/en.php index 2d6f428b19..4e3208250c 100644 --- a/module/branch/lang/en.php +++ b/module/branch/lang/en.php @@ -7,5 +7,10 @@ $lang->branch->delete = 'Delete Branch'; $lang->branch->manageTitle = '%s Management'; $lang->branch->all = 'All'; +$lang->branch->id = 'ID'; +$lang->branch->product = 'Product'; +$lang->branch->name = 'Name'; +$lang->branch->order = 'Order'; + $lang->branch->confirmDelete = 'Do you want to delete this @branch@?'; $lang->branch->canNotDelete = 'There is data in @branch@. It cannot be deleted.'; diff --git a/module/branch/lang/zh-cn.php b/module/branch/lang/zh-cn.php index 3d327f9d12..3f8d2d374d 100644 --- a/module/branch/lang/zh-cn.php +++ b/module/branch/lang/zh-cn.php @@ -7,5 +7,10 @@ $lang->branch->delete = '分支删除'; $lang->branch->manageTitle = '%s管理'; $lang->branch->all = '所有'; +$lang->branch->id = '编号'; +$lang->branch->product = '所属产品'; +$lang->branch->name = '名称'; +$lang->branch->order = '排序'; + $lang->branch->confirmDelete = '是否删除该@branch@?'; $lang->branch->canNotDelete = '该@branch@下已经有数据,不能删除!'; diff --git a/module/branch/lang/zh-tw.php b/module/branch/lang/zh-tw.php index df6d1a0844..32b3cc684d 100644 --- a/module/branch/lang/zh-tw.php +++ b/module/branch/lang/zh-tw.php @@ -7,5 +7,10 @@ $lang->branch->delete = '分支刪除'; $lang->branch->manageTitle = '%s管理'; $lang->branch->all = '所有'; +$lang->branch->id = '編號'; +$lang->branch->product = '所屬產品'; +$lang->branch->name = '名稱'; +$lang->branch->order = '排序'; + $lang->branch->confirmDelete = '是否刪除該@branch@?'; $lang->branch->canNotDelete = '該@branch@下已經有數據,不能刪除!'; diff --git a/module/bug/config.php b/module/bug/config.php index ad1dc49272..5f95ff8482 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -202,6 +202,11 @@ $config->bug->datatable->fieldList['activatedCount']['fixed'] = 'no'; $config->bug->datatable->fieldList['activatedCount']['width'] = '80'; $config->bug->datatable->fieldList['activatedCount']['required'] = 'no'; +$config->bug->datatable->fieldList['activatedDate']['title'] = 'activatedDate'; +$config->bug->datatable->fieldList['activatedDate']['fixed'] = 'no'; +$config->bug->datatable->fieldList['activatedDate']['width'] = '90'; +$config->bug->datatable->fieldList['activatedDate']['required'] = 'no'; + $config->bug->datatable->fieldList['openedBy']['title'] = 'openedByAB'; $config->bug->datatable->fieldList['openedBy']['fixed'] = 'no'; $config->bug->datatable->fieldList['openedBy']['width'] = '80'; diff --git a/module/bug/control.php b/module/bug/control.php index 26461b31f1..3694f79dba 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -147,7 +147,7 @@ class bug extends control $this->view->param = $param; $this->view->orderBy = $orderBy; $this->view->moduleID = $moduleID; - $this->view->memberPairs = $this->user->getPairs('noletter'); + $this->view->memberPairs = $this->user->getPairs('noletter|nodeleted'); $this->view->branch = $branch; $this->view->branches = $this->loadModel('branch')->getPairs($productID); $this->view->setShowModule = true; @@ -205,7 +205,7 @@ class bug extends control */ public function create($productID, $branch = '', $extras = '') { - $this->view->users = $this->user->getPairs('devfirst|noclosed'); + $this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted'); if(empty($this->products)) $this->locate($this->createLink('product', 'create')); $this->app->loadLang('release'); @@ -264,6 +264,8 @@ class bug extends control $keywords = ''; $severity = 3; $type = 'codeerror'; + $pri = ''; + $color = ''; /* Parse the extras. */ $extras = str_replace(array(',', ' '), array('&', ''), $extras); @@ -273,7 +275,7 @@ class bug extends control if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version));// If not set runID but set caseID, get the result info by resultID and case info. /* If bugID setted, use this bug as template. */ - if(isset($bugID)) + if(isset($bugID)) { $bug = $this->bug->getById($bugID); extract((array)$bug); @@ -286,6 +288,7 @@ class bug extends control $type = $bug->type; $assignedTo = $bug->assignedTo; $deadline = $bug->deadline; + $color = $bug->color; } /* If projectID is setted, get builds and stories of this project. */ @@ -302,13 +305,13 @@ class bug extends control /* Set team members of the latest project as assignedTo list. */ $latestProject = $this->product->getLatestProject($productID); - if(!empty($latestProject)) + if(!empty($latestProject)) { $projectMembers = $this->loadModel('project')->getTeamMemberPairs($latestProject->id, 'nodeleted'); } else { - $projectMembers = $this->view->users; + $projectMembers = $this->view->users; } /* Set custom. */ @@ -336,6 +339,7 @@ class bug extends control $this->view->version = $version; $this->view->testtask = $testtask; $this->view->bugTitle = $title; + $this->view->pri = $pri; $this->view->steps = htmlspecialchars($steps); $this->view->os = $os; $this->view->browser = $browser; @@ -348,6 +352,7 @@ class bug extends control $this->view->type = $type; $this->view->branch = $branch; $this->view->branches = $branches; + $this->view->color = $color; $this->display(); } @@ -423,7 +428,7 @@ class bug extends control $this->view->productID = $productID; $this->view->stories = $stories; $this->view->builds = $builds; - $this->view->users = $this->user->getPairs('devfirst'); + $this->view->users = $this->user->getPairs('devfirst|nodeleted'); $this->view->projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : 0, $params = 'nodeleted'); $this->view->projectID = $projectID; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); @@ -513,18 +518,18 @@ class bug extends control } $bug = $this->bug->getById($bugID); - if($bug->toTask != 0) + if($bug->toTask != 0) { foreach($changes as $change) { - if($change['field'] == 'status') + if($change['field'] == 'status') { $confirmURL = $this->createLink('task', 'view', "taskID=$bug->toTask"); $cancelURL = $this->server->HTTP_REFERER; die(js::confirm(sprintf($this->lang->bug->remindTask, $bug->Task), $confirmURL, $cancelURL, 'parent', 'parent')); } } - } + } die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } @@ -576,7 +581,7 @@ class bug extends control $this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product, $bug->branch); $this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); $this->view->tasks = $this->task->getProjectTaskPairs($bug->project); - $this->view->users = $this->user->getPairs('', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy"); + $this->view->users = $this->user->getPairs('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy"); $this->view->openedBuilds = $openedBuilds; $this->view->resolvedBuilds = array('' => '') + $openedBuilds + $oldResolvedBuild; $this->view->actions = $this->action->getList('bug', $bugID); @@ -587,8 +592,8 @@ class bug extends control /** * Batch edit bug. - * - * @param int $productID + * + * @param int $productID * @access public * @return void */ @@ -618,7 +623,7 @@ class bug extends control die(js::confirm(sprintf($this->lang->bug->remindTask, $bug->task), $confirmURL, $cancelURL, 'parent', 'parent')); } } - } + } } die(js::locate($this->session->bugList, 'parent')); } @@ -685,7 +690,7 @@ class bug extends control $appendUsers[$bug->assignedTo] = $bug->assignedTo; $appendUsers[$bug->resolvedBy] = $bug->resolvedBy; } - $users = $this->user->getPairs('devfirst', $appendUsers); + $users = $this->user->getPairs('devfirst|nodeleted', $appendUsers); $users = array('' => '', 'ditto' => $this->lang->bug->ditto) + $users; /* Assign. */ @@ -738,7 +743,7 @@ class bug extends control $this->view->title = $this->products[$bug->product] . $this->lang->colon . $this->lang->bug->assignedTo; $this->view->position[] = $this->lang->bug->assignedTo; - $this->view->users = $this->user->getPairs('', $bug->assignedTo); + $this->view->users = $this->user->getPairs('nodeleted', $bug->assignedTo); $this->view->bug = $bug; $this->view->bugID = $bugID; $this->view->actions = $this->action->getList('bug', $bugID); @@ -828,7 +833,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->confirmBug; $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('', $bug->assignedTo); + $this->view->users = $this->user->getPairs('nodeleted', $bug->assignedTo); $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); } @@ -933,8 +938,8 @@ class bug extends control /** * Activate a bug. - * - * @param int $bugID + * + * @param int $bugID * @access public * @return void */ @@ -960,7 +965,7 @@ class bug extends control $this->view->position[] = $this->lang->bug->activate; $this->view->bug = $bug; - $this->view->users = $this->user->getPairs('', $bug->resolvedBy); + $this->view->users = $this->user->getPairs('nodeleted', $bug->resolvedBy); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty'); $this->view->actions = $this->action->getList('bug', $bugID); @@ -1122,36 +1127,39 @@ class bug extends control } /** - * Batch activate bugs. - * + * Batch activate bugs. + * * @access public * @return void */ - public function batchActivate() + public function batchActivate($productID, $branch = 0) { - if($this->post->bugIDList) + if($this->post->statusList) { - $bugIDList = $this->post->bugIDList; - - /* Reset $_POST. Do not unset that because the function of close need that in model. */ - $_POST = array(); - - $bugs = $this->bug->getByList($bugIDList); - foreach($bugs as $bugID => $bug) + $activateBugs = $this->bug->batchActivate(); + foreach($activateBugs as $bugID => $bug) { - if($bug->status == 'active') - { - continue; - } - - $this->bug->activate($bugID); - - $actionID = $this->action->create('bug', $bugID, 'Activated'); + $actionID = $this->action->create('bug', $bugID, 'Activated', $bug['comment']); $this->bug->sendmail($bugID, $actionID); } + + die(js::locate($this->session->bugList, 'parent')); } - die(js::reload('parent')); + $bugIDList = $this->post->bugIDList ? $this->post->bugIDList : die(js::locate($this->session->bugList, 'parent')); + $bugs = $this->dao->select('id, title, status, resolvedBy, openedBuild')->from(TABLE_BUG)->where('id')->in($bugIDList)->fetchAll('id'); + + $this->bug->setMenu($this->products, $productID, $branch); + + $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->batchActivate; + $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $this->view->position[] = $this->lang->bug->batchActivate; + + $this->view->bugs = $bugs; + $this->view->users = $this->user->getPairs(); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'noempty'); + + $this->display(); } /** @@ -1280,6 +1288,7 @@ class bug extends control * AJAX: get team members of the latest project of a product as assignedTo list. * * @param int $productID + * x * @param string $selectedUser * @access public * @return string @@ -1293,7 +1302,7 @@ class bug extends control } else { - $projectMembers = $this->loadModel('user')->getPairs('devfirst|noclosed'); + $projectMembers = $this->loadModel('user')->getPairs('devfirst|noclosed|nodeleted'); } die(html::select('assignedTo', $projectMembers, $selectedUser, 'class="form-control"')); @@ -1439,7 +1448,7 @@ class bug extends control if(isset($bugLang->statusList[$bug->status])) $bug->status = $bugLang->statusList[$bug->status]; if(isset($bugLang->confirmedList[$bug->confirmed])) $bug->confirmed = $bugLang->confirmedList[$bug->confirmed]; if(isset($bugLang->resolutionList[$bug->resolution])) $bug->resolution = $bugLang->resolutionList[$bug->resolution]; - + if(isset($users[$bug->openedBy])) $bug->openedBy = $users[$bug->openedBy]; if(isset($users[$bug->assignedTo])) $bug->assignedTo = $users[$bug->assignedTo]; if(isset($users[$bug->resolvedBy])) $bug->resolvedBy = $users[$bug->resolvedBy]; diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 7734e9f505..e8dc98b4bf 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -1,4 +1,4 @@ -$(function() +$(function() { setModal4List('iframe', 'bugList'); @@ -12,7 +12,7 @@ $(function() oldStoryID = $('#story').val() || 0; oldProjectID = 0; oldOpenedBuild = ''; - oldTaskID = 0; + oldTaskID = $('#oldTaskID').val() || 0; if(!assignedto) setAssignedTo(moduleID, productID); notice(); } diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index bef495c40a..613c15c005 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -32,6 +32,7 @@ $lang->bug->status = 'Status'; $lang->bug->statusAB = 'Status'; $lang->bug->activatedCount = 'Active'; $lang->bug->activatedCountAB = 'Active'; +$lang->bug->activatedDate = 'Active On'; $lang->bug->confirmed = 'Confirmed'; $lang->bug->toTask = 'Convert to Task'; $lang->bug->toStory = 'Convert to Story'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index b65bf946a1..bdca46ec46 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -32,6 +32,7 @@ $lang->bug->status = 'Bug状态'; $lang->bug->statusAB = '状态'; $lang->bug->activatedCount = '激活次数'; $lang->bug->activatedCountAB = '激活次数'; +$lang->bug->activatedDate = '激活日期'; $lang->bug->confirmed = '是否确认'; $lang->bug->toTask = '转任务'; $lang->bug->toStory = '转需求'; @@ -342,9 +343,9 @@ $lang->bug->report->bugHistories->graph->xAxisName = '处理步骤'; /* 操作记录。*/ $lang->bug->action = new stdclass(); -$lang->bug->action->resolved = array('main' => '$date, 由 $actor 解决,方案为 $extra $appendLink。', 'extra' => 'resolutionList'); -$lang->bug->action->tostory = array('main' => '$date, 由 $actor 转为需求,编号为 $extra。'); -$lang->bug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); +$lang->bug->action->resolved = array('main' => '$date, 由 $actor 解决,方案为 $extra $appendLink。', 'extra' => 'resolutionList'); +$lang->bug->action->tostory = array('main' => '$date, 由 $actor 转为需求,编号为 $extra。'); +$lang->bug->action->totask = array('main' => '$date, 由 $actor 导入为任务,编号为 $extra。'); $lang->bug->action->linked2plan = array('main' => '$date, 由 $actor 关联到计划 $extra。'); $lang->bug->action->unlinkedfromplan = array('main' => '$date, 由 $actor 从计划 $extra 移除。'); $lang->bug->action->linked2build = array('main' => '$date, 由 $actor 关联到版本 $extra。'); diff --git a/module/bug/lang/zh-tw.php b/module/bug/lang/zh-tw.php index f00994e5d8..fbec0b343d 100644 --- a/module/bug/lang/zh-tw.php +++ b/module/bug/lang/zh-tw.php @@ -32,6 +32,7 @@ $lang->bug->status = 'Bug狀態'; $lang->bug->statusAB = '狀態'; $lang->bug->activatedCount = '激活次數'; $lang->bug->activatedCountAB = '激活次數'; +$lang->bug->activatedDate = '激活日期'; $lang->bug->confirmed = '是否確認'; $lang->bug->toTask = '轉任務'; $lang->bug->toStory = '轉需求'; @@ -150,9 +151,9 @@ $lang->bug->applyTemplate = '應用模板'; $lang->bug->confirmDeleteTemplate = '您確認要刪除該模板嗎?'; /* 模板。*/ -$lang->bug->tplStep = "

[步驟]

\n"; -$lang->bug->tplResult = "

[結果]

\n"; -$lang->bug->tplExpect = "

[期望]

"; +$lang->bug->tplStep = "

[步驟]

"; +$lang->bug->tplResult = "

[結果]

"; +$lang->bug->tplExpect = "

[期望]

"; /* 各個欄位取值列表。*/ $lang->bug->severityList[3] = '3'; @@ -342,9 +343,9 @@ $lang->bug->report->bugHistories->graph->xAxisName = '處理步驟'; /* 操作記錄。*/ $lang->bug->action = new stdclass(); -$lang->bug->action->resolved = array('main' => '$date, 由 $actor 解決,方案為 $extra $appendLink。', 'extra' => 'resolutionList'); -$lang->bug->action->tostory = array('main' => '$date, 由 $actor 轉為需求,編號為 $extra。'); -$lang->bug->action->totask = array('main' => '$date, 由 $actor 導入為任務,編號為 $extra。'); +$lang->bug->action->resolved = array('main' => '$date, 由 $actor 解決,方案為 $extra $appendLink。', 'extra' => 'resolutionList'); +$lang->bug->action->tostory = array('main' => '$date, 由 $actor 轉為需求,編號為 $extra。'); +$lang->bug->action->totask = array('main' => '$date, 由 $actor 導入為任務,編號為 $extra。'); $lang->bug->action->linked2plan = array('main' => '$date, 由 $actor 關聯到計劃 $extra。'); $lang->bug->action->unlinkedfromplan = array('main' => '$date, 由 $actor 從計劃 $extra 移除。'); $lang->bug->action->linked2build = array('main' => '$date, 由 $actor 關聯到版本 $extra。'); diff --git a/module/bug/model.php b/module/bug/model.php index 6a0114f9ed..c52e931da7 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -455,7 +455,7 @@ class bugModel extends model */ public function getModuleOwner($moduleID, $productID) { - $users = $this->loadModel('user')->getPairs(); + $users = $this->loadModel('user')->getPairs('nodeleted'); if($moduleID) { @@ -658,6 +658,57 @@ class bugModel extends model return $allChanges; } + /** + * Batch active bugs. + * + * @access public + * @return array + */ + public function batchActivate() + { + $now = helper::now(); + $data = fixer::input('post')->get(); + + $activateBugs = array(); + $bugIDList = $data->bugIDList ? $data->bugIDList : array(); + + if(empty($bugIDList)) return $activateBugs; + + foreach($bugIDList as $bugID) + { + if($data->statusList[$bugID] == 'active') continue; + + $activateBugs[$bugID]['assignedTo'] = $data->assignedToList[$bugID]; + $activateBugs[$bugID]['openedBuild'] = $data->openedBuildList[$bugID]; + $activateBugs[$bugID]['comment'] = $data->commentList[$bugID]; + + $activateBugs[$bugID]['assignedDate'] = $now; + $activateBugs[$bugID]['resolution'] = ''; + $activateBugs[$bugID]['status'] = 'active'; + $activateBugs[$bugID]['resolvedDate'] = '0000-00-00'; + $activateBugs[$bugID]['resolvedBy'] = ''; + $activateBugs[$bugID]['resolvedBuild'] = ''; + $activateBugs[$bugID]['closedBy'] = ''; + $activateBugs[$bugID]['closedDate'] = '0000-00-00'; + $activateBugs[$bugID]['duplicateBug'] = 0; + $activateBugs[$bugID]['toTask'] = 0; + $activateBugs[$bugID]['toStory'] = 0; + $activateBugs[$bugID]['lastEditedBy'] = $this->app->user->account; + $activateBugs[$bugID]['lastEditedDate'] = $now; + } + + /* Update bugs. */ + foreach($activateBugs as $bugID => $bug) + { + $this->dao->update(TABLE_BUG)->data($bug, $skipFields = 'comment')->autoCheck()->where('id')->eq((int)$bugID)->exec(); + if(dao::isError()) die(js::error('bug#' . $bugID . dao::getError(true))); + + $this->dao->update(TABLE_BUG)->set('activatedCount = activatedCount + 1')->where('id')->eq((int)$bugID)->exec(); + } + + return $activateBugs; + } + /** * Assign a bug to a user again. * @@ -925,6 +976,7 @@ class bugModel extends model ->add('toStory', 0) ->add('lastEditedBy', $this->app->user->account) ->add('lastEditedDate', $now) + ->add('activatedDate', $now) ->join('openedBuild', ',') ->remove('comment,files,labels') ->get(); @@ -1506,7 +1558,7 @@ class bugModel extends model { foreach($openBuildIDList as $buildID) { - if(isset($datas[$buildID])) + if(isset($datas[$buildID])) { $datas[$buildID]->value += $data->value; } @@ -1538,7 +1590,7 @@ class bugModel extends model { $datas = $this->dao->select('module as name, count(module) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('module')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - $modules = $this->loadModel('tree')->getModulesName(array_keys($datas),true,true); + $modules = $this->loadModel('tree')->getModulesName(array_keys($datas), true, true); foreach($datas as $moduleID => $data) $data->name = isset($modules[$moduleID]) ? $modules[$moduleID] : '/'; return $datas; } @@ -2191,6 +2243,8 @@ class bugModel extends model { $action = strtolower($action); + if(!common::limitedUser($object)) return false; + if($action == 'confirmbug') return $object->status == 'active' and $object->confirmed == 0; if($action == 'resolve') return $object->status == 'active'; if($action == 'close') return $object->status == 'resolved'; @@ -2249,12 +2303,12 @@ class bugModel extends model /** * Print cell data. - * - * @param object $col - * @param object $bug - * @param array $users - * @param array $builds - * @param array $branches + * + * @param object $col + * @param object $bug + * @param array $users + * @param array $builds + * @param array $branches * @access public * @return void */ @@ -2306,6 +2360,9 @@ class bugModel extends model case 'activatedCount': echo $bug->activatedCount; break; + case 'activatedDate': + echo substr($bug->activatedDate, 5, 11); + break; case 'openedBy': echo zget($users, $bug->openedBy); break; diff --git a/module/bug/view/activate.html.php b/module/bug/view/activate.html.php index 3326acbfe5..d9f5f27db7 100644 --- a/module/bug/view/activate.html.php +++ b/module/bug/view/activate.html.php @@ -37,7 +37,7 @@ bug->files;?> fetch('file', 'buildform');?> - + goback, $this->session->bugList);?> diff --git a/module/bug/view/batchactivate.html.php b/module/bug/view/batchactivate.html.php new file mode 100644 index 0000000000..141f022093 --- /dev/null +++ b/module/bug/view/batchactivate.html.php @@ -0,0 +1,46 @@ + + * @package bug + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+ bug->common . $lang->colon . $lang->bug->batchActivate;?> +
+
+
"> + + + + + + + + + + + + + + + + + + + + + + + + +
idAB;?>bug->title;?>bug->assignedTo;?>bug->openedBuild;?>bug->legendComment;?>
id . html::hidden("bugIDList[$bug->id]", $bug->id);?>title . html::hidden("statusList[$bug->id]", $bug->status);?>id]", $users, $bug->resolvedBy, "class='form-control chosen'");?>id]", $builds, $bug->openedBuild, 'size=4 multiple=multiple class="form-control chosen"');?>id]", '', "class='form-control'");?>
+
+ diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 61cfed72b5..10e72a610e 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -193,15 +193,15 @@ js::set('branch', $branch); createLink('bug', 'batchConfirm'); - $misc = common::hasPriv('bug', 'batchConfirm') ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : $class; + $misc = common::hasPriv('bug', 'batchConfirm') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : $class; if($misc) echo "
  • " . html::a('javascript:;', $lang->bug->confirmBug, '', $misc) . "
  • "; $actionLink = $this->createLink('bug', 'batchClose'); - $misc = common::hasPriv('bug', 'batchClose') ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : $class; + $misc = common::hasPriv('bug', 'batchClose') ? "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"" : $class; if($misc) echo "
  • " . html::a('javascript:;', $lang->bug->close, '', $misc) . "
  • "; - $actionLink = $this->createLink('bug', 'batchActivate'); - $misc = common::hasPriv('bug', 'batchActivate') ? "onclick=\"setFormAction('$actionLink','hiddenwin')\"" : $class; + $actionLink = $this->createLink('bug', 'batchActivate', "productID=$productID&branch=$branch"); + $misc = common::hasPriv('bug', 'batchActivate') ? "onclick=\"setFormAction('$actionLink')\"" : $class; if($misc) echo "
  • " . html::a('javascript:;', $lang->bug->activate, '', $misc) . "
  • "; if(common::hasPriv('bug', 'batchChangeModule')) diff --git a/module/bug/view/browsedata.html.php b/module/bug/view/browsedata.html.php index b20ee586bc..46c59e165b 100644 --- a/module/bug/view/browsedata.html.php +++ b/module/bug/view/browsedata.html.php @@ -48,7 +48,7 @@ id");?> - + id));?> bug->severityList, $bug->severity, $bug->severity);?>'>bug->severityList, $bug->severity, $bug->severity);?> @@ -100,7 +100,7 @@ id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'search', '', 'iframe', true); - common::printIcon('bug', 'assignTo', $params, '', 'list', '', '', 'iframe', true); + common::printIcon('bug', 'assignTo', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'edit', $params, $bug, 'list'); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 8c494ad113..aac784b4ad 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -1,4 +1,4 @@ - bug->confirmDeleteTemplate);
    - +
    @@ -198,14 +198,14 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate); } ?> - bug->priList, '', "class='form-control minw-80px'");?> + bug->priList, $pri, "class='form-control minw-80px'");?> @@ -214,7 +214,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
    - + bug->steps;?> @@ -250,7 +250,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate); bug->task?> - + diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index ff4b27ba10..971a665670 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -31,20 +31,20 @@ ob_start(); echo "
    "; common::printIcon('bug', 'confirmBug', $params, $bug, 'button', 'search', '', 'iframe', true); - common::printIcon('bug', 'assignTo', $params, '', 'button', '', '', 'iframe', true); + common::printIcon('bug', 'assignTo', $params, $bug, 'button', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'button', '', '', 'iframe showinonlybody', true); common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true); common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true); if($this->config->global->flow != 'onlyTest') common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']); - common::printIcon('bug', 'createCase', $convertParams, '', 'button', 'sitemap'); + common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap'); echo '
    '; echo "
    "; - common::printIcon('bug', 'edit', $params); - common::printCommentIcon('bug'); - common::printIcon('bug', 'create', $copyParams, '', 'button', 'copy'); - common::printIcon('bug', 'delete', $params, '', 'button', '', 'hiddenwin'); + common::printIcon('bug', 'edit', $params, $bug); + common::printCommentIcon('bug', $bug); + common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy'); + common::printIcon('bug', 'delete', $params, $bug, 'button', '', 'hiddenwin'); echo '
    '; echo "
    "; @@ -168,6 +168,10 @@ bug->activatedCount;?> activatedCount;?> + + bug->activatedDate;?> + activatedDate;?> + bug->confirmed;?> bug->confirmedList[$bug->confirmed];?> diff --git a/module/build/control.php b/module/build/control.php index cd9828f6b3..c8a5bd1fed 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -77,7 +77,7 @@ class build extends control $this->view->products = $products; $this->view->lastBuild = $this->build->getLast($projectID); $this->view->productGroups = $productGroups; - $this->view->users = $this->user->getPairs(); + $this->view->users = $this->user->getPairs('nodeleted'); $this->display(); } diff --git a/module/build/lang/en.php b/module/build/lang/en.php index 45ec2696d2..a8d85a2806 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -13,7 +13,6 @@ $lang->build->common = "Build"; $lang->build->create = "Create"; $lang->build->edit = "Edit"; $lang->build->linkStory = "Link Story"; -$lang->build->linked2build = "Link build"; $lang->build->linkBug = "Link Bug"; $lang->build->delete = "Delete Build"; $lang->build->deleted = "Deleted"; @@ -30,6 +29,7 @@ $lang->build->basicInfo = 'Basic Info'; $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; +$lang->build->branch = 'Platform/Branch'; $lang->build->project = $lang->projectCommon; $lang->build->name = 'Name'; $lang->build->date = 'Date'; @@ -39,6 +39,7 @@ $lang->build->filePath = 'File Path'; $lang->build->desc = 'Description'; $lang->build->files = 'Upload Files'; $lang->build->last = 'Last Build'; +$lang->build->packageType = 'Package Type'; $lang->build->unlinkStory = 'Unlink Story'; $lang->build->unlinkBug = 'Unlink Bug'; $lang->build->stories = 'Finished Story'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index 4f6709773d..bc941c457d 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -29,6 +29,7 @@ $lang->build->basicInfo = '基本信息'; $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; +$lang->build->branch = '平台/分支'; $lang->build->project = '所属' . $lang->projectCommon; $lang->build->name = '名称编号'; $lang->build->date = '打包日期'; @@ -38,6 +39,7 @@ $lang->build->filePath = '下载地址'; $lang->build->desc = '描述'; $lang->build->files = '上传发行包'; $lang->build->last = '上个版本'; +$lang->build->packageType = '包类型'; $lang->build->unlinkStory = '移除需求'; $lang->build->unlinkBug = '移除Bug'; $lang->build->stories = '完成的需求'; diff --git a/module/build/lang/zh-tw.php b/module/build/lang/zh-tw.php index 396dd52dce..a1b2c948d1 100644 --- a/module/build/lang/zh-tw.php +++ b/module/build/lang/zh-tw.php @@ -13,7 +13,6 @@ $lang->build->common = "版本"; $lang->build->create = "創建版本"; $lang->build->edit = "編輯版本"; $lang->build->linkStory = "關聯需求"; -$lang->build->linked2build = "关联關聯版本"; $lang->build->linkBug = "關聯Bug"; $lang->build->delete = "刪除版本"; $lang->build->deleted = "已刪除"; @@ -30,6 +29,7 @@ $lang->build->basicInfo = '基本信息'; $lang->build->id = 'ID'; $lang->build->product = $lang->productCommon; +$lang->build->branch = '平台/分支'; $lang->build->project = '所屬' . $lang->projectCommon; $lang->build->name = '名稱編號'; $lang->build->date = '打包日期'; @@ -39,6 +39,7 @@ $lang->build->filePath = '下載地址'; $lang->build->desc = '描述'; $lang->build->files = '上傳發行包'; $lang->build->last = '上個版本'; +$lang->build->packageType = '包類型'; $lang->build->unlinkStory = '移除需求'; $lang->build->unlinkBug = '移除Bug'; $lang->build->stories = '完成的需求'; diff --git a/module/build/model.php b/module/build/model.php index c61c3cb791..f6d1cb1999 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -66,7 +66,7 @@ class buildModel extends model ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date DESC, t1.id desc') - ->fetchAll(); + ->fetchAll('id'); } /** @@ -407,4 +407,19 @@ class buildModel extends model $this->loadModel('action')->create('bug', $unlinkBugID, 'unlinkedfrombuild', '', $buildID); } } + + /** + * Judge an action is clickable or not. + * + * @param object $project + * @param string $action + * @access public + * @return bool + */ + public static function isClickable($build, $action) + { + if(!common::limitedUser($build)) return false; + + return true; + } } diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index c0a4059f57..469bec757f 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -46,8 +46,8 @@ tfoot tr td .table-actions .btn{display:none;} echo '
    '; } echo "
    "; - common::printIcon('build', 'edit', "buildID=$build->id"); - common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); + common::printIcon('build', 'edit', "buildID=$build->id", $build); + common::printIcon('build', 'delete', "buildID=$build->id", $build, 'button', '', 'hiddenwin'); echo '
    '; } echo common::printRPN($browseLink); @@ -69,8 +69,8 @@ tfoot tr td .table-actions .btn{display:none;} $browseLink = $this->session->buildList ? $this->session->buildList : $this->createLink('product', 'build', "productID=$build->product"); if(!$build->deleted) { - common::printIcon('build', 'edit', "buildID=$build->id"); - common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin'); + common::printIcon('build', 'edit', "buildID=$build->id", $build); + common::printIcon('build', 'delete', "buildID=$build->id", $build, 'button', '', 'hiddenwin'); } echo common::printRPN($browseLink); ?> diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 4a005913f3..7bfe9b4d5e 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -124,7 +124,7 @@ $lang->searchObjects['release'] = 'Release'; $lang->searchObjects['productplan'] = $lang->productCommon . 'Plan'; $lang->searchObjects['testtask'] = 'Test Task'; $lang->searchObjects['doc'] = 'Document'; -$lang->searchObjects['caselib'] = 'Case Library'; +$lang->searchObjects['testcase'] = 'Case Library'; $lang->searchObjects['testreport'] = 'Test Report'; $lang->searchTips = 'ID (ctrl+g)'; @@ -249,7 +249,7 @@ $lang->bug = new stdclass(); $lang->bug->menu = new stdclass(); $lang->bug->menu->product = array('link' => '%s', 'fixed' => true); -$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,confirmbug,assignto', 'subModule' => 'tree'); +$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto', 'subModule' => 'tree'); $lang->bug->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s'); $lang->bug->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s'); $lang->bug->menu->testsuite = array('link' => 'Suite|testsuite|browse|productID=%s'); @@ -478,7 +478,7 @@ $lang->datepicker->dpText->TEXT_CLOSE = 'Close'; $lang->datepicker->dpText->TEXT_DATE = 'Choose Time'; $lang->datepicker->dpText->TEXT_CHOOSE_DATE = 'Choose Date'; -$lang->datepicker->dayNames = array('Sun', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat'); +$lang->datepicker->dayNames = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); $lang->datepicker->abbrDayNames = array('Sun', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat'); $lang->datepicker->monthNames = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 819b579a13..820f8dfda2 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -249,7 +249,7 @@ $lang->bug = new stdclass(); $lang->bug->menu = new stdclass(); $lang->bug->menu->product = array('link' => '%s', 'fixed' => true); -$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,confirmbug,assignto', 'subModule' => 'tree'); +$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto', 'subModule' => 'tree'); $lang->bug->menu->testcase = array('link' => '用例|testcase|browse|productID=%s'); $lang->bug->menu->testtask = array('link' => '版本|testtask|browse|productID=%s'); $lang->bug->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s'); @@ -478,7 +478,7 @@ $lang->datepicker->dpText->TEXT_CLOSE = '关闭'; $lang->datepicker->dpText->TEXT_DATE = '选择时间段'; $lang->datepicker->dpText->TEXT_CHOOSE_DATE = '选择日期'; -$lang->datepicker->dayNames = array('日', '一', '二', '三', '四', '五', '六'); +$lang->datepicker->dayNames = array('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'); $lang->datepicker->abbrDayNames = array('日', '一', '二', '三', '四', '五', '六'); $lang->datepicker->monthNames = array('一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'); diff --git a/module/common/lang/zh-tw.php b/module/common/lang/zh-tw.php index 20c8c793a1..7c7ac5506e 100644 --- a/module/common/lang/zh-tw.php +++ b/module/common/lang/zh-tw.php @@ -124,7 +124,7 @@ $lang->searchObjects['release'] = '發佈'; $lang->searchObjects['productplan'] = $lang->productCommon . '計劃'; $lang->searchObjects['testtask'] = '測試版本'; $lang->searchObjects['doc'] = '文檔'; -$lang->searchObjects['caselib'] = '用例庫'; +$lang->searchObjects['testcase'] = '用例庫'; $lang->searchObjects['testreport'] = '測試報告'; $lang->searchTips = '編號(ctrl+g)'; @@ -249,7 +249,7 @@ $lang->bug = new stdclass(); $lang->bug->menu = new stdclass(); $lang->bug->menu->product = array('link' => '%s', 'fixed' => true); -$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,confirmbug,assignto', 'subModule' => 'tree'); +$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,batchactivate,confirmbug,assignto', 'subModule' => 'tree'); $lang->bug->menu->testcase = array('link' => '用例|testcase|browse|productID=%s'); $lang->bug->menu->testtask = array('link' => '版本|testtask|browse|productID=%s'); $lang->bug->menu->testsuite = array('link' => '套件|testsuite|browse|productID=%s'); @@ -449,16 +449,16 @@ $lang->browserNotice = '你目前使用的瀏覽器可能無法得到最佳 $lang->noticePasteImg = "可以在編輯器直接貼圖。"; /* 時間格式設置。*/ -define('DT_DATETIME1', 'Y-m-d H:i:s'); -define('DT_DATETIME2', 'y-m-d H:i'); -define('DT_MONTHTIME1', 'n/d H:i'); -define('DT_MONTHTIME2', 'n月d日 H:i'); -define('DT_DATE1', 'Y-m-d'); -define('DT_DATE2', 'Ymd'); -define('DT_DATE3', 'Y年m月d日'); -define('DT_DATE4', 'n月j日'); -define('DT_TIME1', 'H:i:s'); -define('DT_TIME2', 'H:i'); +if(!defined('DT_DATETIME1')) define('DT_DATETIME1', 'Y-m-d H:i:s'); +if(!defined('DT_DATETIME2')) define('DT_DATETIME2', 'y-m-d H:i'); +if(!defined('DT_MONTHTIME1'))define('DT_MONTHTIME1', 'n/d H:i'); +if(!defined('DT_MONTHTIME2'))define('DT_MONTHTIME2', 'n月d日 H:i'); +if(!defined('DT_DATE1')) define('DT_DATE1', 'Y-m-d'); +if(!defined('DT_DATE2')) define('DT_DATE2', 'Ymd'); +if(!defined('DT_DATE3')) define('DT_DATE3', 'Y年m月d日'); +if(!defined('DT_DATE4')) define('DT_DATE4', 'n月j日'); +if(!defined('DT_TIME1')) define('DT_TIME1', 'H:i:s'); +if(!defined('DT_TIME2')) define('DT_TIME2', 'H:i'); /* datepicker 時間*/ $lang->datepicker = new stdclass(); diff --git a/module/common/model.php b/module/common/model.php index d1d1ed2a8b..aa28cb7b24 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -13,7 +13,7 @@ class commonModel extends model { /** * The construc method, to do some auto things. - * + * * @access public * @return void */ @@ -35,7 +35,7 @@ class commonModel extends model /** * Set the header info. - * + * * @access public * @return void */ @@ -54,7 +54,7 @@ class commonModel extends model * @return void */ public function setCompany() - { + { $httpHost = $this->server->http_host; if($this->session->company) @@ -118,7 +118,7 @@ class commonModel extends model /** * Load custom lang from db. - * + * * @access public * @return void */ @@ -134,9 +134,9 @@ class commonModel extends model /** * Juage a method of one module is open or not? - * - * @param string $module - * @param string $method + * + * @param string $module + * @param string $method * @access public * @return bool */ @@ -249,9 +249,7 @@ class commonModel extends model echo "
  • "; } - $isLeft = ($app->company->website and $app->company->backyard) ? '' : ' left'; - - echo "'; - echo "