From e00d2da1551854523056342e8528a5181ccc207f Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Sun, 25 Oct 2009 12:27:50 +0000 Subject: [PATCH] + import from my local subversion server. --- Makefile | 21 + VERSION | 1 + bin/convertfrombugfree.php | 156 + bin/exportactions.php | 31 + bin/updaterevision.php | 14 + config/config.php | 93 + db/zentao.sql | 608 +++ doc/COPYING | 674 ++++ doc/COPYING.LESSER | 165 + doc/README | 46 + doc/THANKS | 6 + lib/front/front.class.php | 411 ++ lib/front/tests/html_checkbox.expect | 21 + lib/front/tests/html_checkbox.php | 31 + lib/front/tests/html_radio.expect | 13 + lib/front/tests/html_radio.php | 29 + lib/front/tests/html_select.expect | 31 + lib/front/tests/html_select.php | 34 + module/action/model.php | 75 + module/admin/control.php | 99 + module/admin/lang/zh-cn.php | 33 + module/admin/model.php | 44 + module/admin/view/browsecompany.html.php | 69 + module/admin/view/browsegroup.html.php | 67 + module/admin/view/browseuser.html.php | 72 + module/admin/view/index.html.php | 41 + module/admin/view/menu.html.php | 29 + module/bug/control.php | 193 + module/bug/lang/en.php | 63 + module/bug/lang/zh-cn.php | 151 + module/bug/model.php | 161 + module/bug/view/browse.html.php | 105 + module/bug/view/create.html.php | 98 + module/bug/view/edit.html.php | 215 + module/bug/view/index.html.php | 28 + module/bug/view/view.html.php | 233 ++ module/common/action.html.php | 28 + module/common/control.php | 208 + module/common/footer.html.php | 6 + module/common/header.html.php | 138 + module/common/lang/en.php | 25 + module/common/lang/zh-cn.php | 112 + module/common/tablesorter.html.php | 9 + module/common/treeview.html.php | 13 + module/company/control.php | 113 + module/company/lang/en.php | 39 + module/company/lang/zh-cn.php | 46 + module/company/model.php | 81 + module/company/view/browse.html.php | 98 + module/company/view/create.html.php | 72 + module/company/view/edit.html.php | 72 + module/dept/control.php | 93 + module/dept/lang/zh-cn.php | 35 + module/dept/model.php | 246 ++ module/dept/view/browse.html.php | 82 + module/dept/view/create.html.php | 51 + module/dept/view/edit.html.php | 52 + module/group/control.php | 138 + module/group/lang/lang.php | 84 + module/group/lang/zh-cn.php | 137 + module/group/model.php | 115 + module/group/view/create.html.php | 44 + module/group/view/edit.html.php | 44 + module/group/view/index.html.php | 58 + module/group/view/managemember.html.php | 43 + module/group/view/managepriv.html.php | 50 + module/index/control.php | 48 + module/index/lang/en.php | 24 + module/index/lang/zh-cn.php | 27 + module/index/model.php | 36 + module/index/view/index.html.php | 90 + module/my/control.php | 136 + module/my/lang/zh-cn.php | 11 + module/my/model.php | 28 + module/my/view/bug.html.php | 52 + module/my/view/editprofile.html.php | 58 + module/my/view/footer.html.php | 4 + module/my/view/header.html.php | 102 + module/my/view/index.html.php | 96 + module/my/view/project.html.php | 54 + module/my/view/story.html.php | 27 + module/my/view/task.html.php | 54 + module/my/view/team.html.php | 26 + module/my/view/todo.html.php | 69 + module/product/control.php | 141 + module/product/lang/zh-cn.php | 47 + module/product/model.php | 89 + module/product/view/browse.html.php | 155 + module/product/view/create.html.php | 51 + module/product/view/edit.html.php | 52 + module/product/view/index.html.php | 113 + module/project/control.php | 309 ++ module/project/lang/zh-cn.php | 81 + module/project/model.php | 196 + module/project/view/browse.html.php | 166 + module/project/view/bug.html.php | 0 module/project/view/burn.html.php | 0 module/project/view/create.html.php | 74 + module/project/view/edit.html.php | 74 + module/project/view/index.html.php | 28 + module/project/view/linkstory.html.php | 61 + module/project/view/managechilds.html.php | 41 + module/project/view/managemembers.html.php | 69 + module/project/view/manageproducts.html.php | 41 + module/project/view/story.html.php | 53 + module/project/view/task.html.php | 58 + module/qa/control.php | 30 + module/qa/lang/zh-cn.php | 25 + module/qa/view/index.html.php | 28 + module/release/control.php | 73 + module/release/lang/en.php | 36 + module/release/lang/zh-cn.php | 40 + module/release/model.php | 66 + module/release/view/browse.html.php | 53 + module/release/view/create.html.php | 54 + module/release/view/delete.html.php | 28 + module/release/view/index.html.php | 29 + module/release/view/read.html.php | 28 + module/release/view/update.html.php | 32 + module/story/control.php | 145 + module/story/lang/en.php | 51 + module/story/lang/zh-cn.php | 93 + module/story/model.php | 140 + module/story/view/create.html.php | 83 + module/story/view/edit.html.php | 93 + module/story/view/view.html.php | 182 + module/task/control.php | 118 + module/task/lang/zh-cn.php | 48 + module/task/model.php | 94 + module/task/view/browse.html.php | 48 + module/task/view/create.html.php | 62 + module/task/view/edit.html.php | 73 + module/testcase/control.php | 175 + module/testcase/lang/en.php | 48 + module/testcase/lang/zh-cn.php | 120 + module/testcase/model.php | 72 + module/testcase/view/browse.html.php | 97 + module/testcase/view/create.html.php | 80 + module/testcase/view/edit.html.php | 151 + module/testcase/view/index.html.php | 28 + module/testcase/view/view.html.php | 153 + module/todo/control.php | 103 + module/todo/lang/zh-cn.php | 63 + module/todo/model.php | 181 + module/todo/view/create.html.php | 95 + module/todo/view/edit.html.php | 97 + module/tree/control.php | 139 + module/tree/lang/zh-cn.php | 38 + module/tree/model.php | 252 ++ module/tree/view/browse.html.php | 82 + module/tree/view/create.html.php | 51 + module/tree/view/edit.html.php | 52 + module/user/control.php | 313 ++ module/user/lang/en.php | 54 + module/user/lang/zh-cn.php | 82 + module/user/model.php | 187 + module/user/view/bug.html.php | 52 + module/user/view/create.html.php | 67 + module/user/view/deny.html.php | 57 + module/user/view/edit.html.php | 67 + module/user/view/footer.html.php | 4 + module/user/view/header.html.php | 98 + module/user/view/index.html.php | 28 + module/user/view/login.html.php | 63 + module/user/view/project.html.php | 54 + module/user/view/story.html.php | 27 + module/user/view/task.html.php | 54 + module/user/view/team.html.php | 26 + module/user/view/todo.html.php | 61 + module/user/view/view.html.php | 86 + www/index.php | 122 + www/js/jquery/lib.js | 3455 +++++++++++++++++ www/js/jquery/tablesorter/min.js | 2 + www/js/jquery/treeview/min.js | 15 + www/js/misc/sorttable.js | 493 +++ www/myrouter.class.php | 45 + www/theme/default/images/tablesorter/asc.gif | Bin 0 -> 54 bytes www/theme/default/images/tablesorter/bg.gif | Bin 0 -> 64 bytes www/theme/default/images/tablesorter/desc.gif | Bin 0 -> 54 bytes www/theme/default/images/treeview/file.gif | Bin 0 -> 110 bytes .../default/images/treeview/folder-closed.gif | Bin 0 -> 105 bytes www/theme/default/images/treeview/folder.gif | Bin 0 -> 106 bytes www/theme/default/images/treeview/minus.gif | Bin 0 -> 837 bytes www/theme/default/images/treeview/plus.gif | Bin 0 -> 841 bytes .../images/treeview/treeview-black-line.gif | Bin 0 -> 1877 bytes .../images/treeview/treeview-black.gif | Bin 0 -> 1216 bytes .../images/treeview/treeview-default-line.gif | Bin 0 -> 1993 bytes .../images/treeview/treeview-default.gif | Bin 0 -> 1222 bytes .../treeview/treeview-famfamfam-line.gif | Bin 0 -> 807 bytes .../images/treeview/treeview-famfamfam.gif | Bin 0 -> 1280 bytes .../images/treeview/treeview-gray-line.gif | Bin 0 -> 1877 bytes .../default/images/treeview/treeview-gray.gif | Bin 0 -> 1230 bytes .../images/treeview/treeview-red-line.gif | Bin 0 -> 1877 bytes .../default/images/treeview/treeview-red.gif | Bin 0 -> 1230 bytes www/theme/default/style.css | 142 + www/theme/default/tablesorter.css | 10 + www/theme/default/treeview.css | 68 + www/theme/default/yui.css | 10 + www/theme/firefox.css | 3 + www/theme/ie.6.css | 3 + 200 files changed, 18911 insertions(+) create mode 100644 Makefile create mode 100644 VERSION create mode 100644 bin/convertfrombugfree.php create mode 100644 bin/exportactions.php create mode 100644 bin/updaterevision.php create mode 100644 config/config.php create mode 100644 db/zentao.sql create mode 100644 doc/COPYING create mode 100644 doc/COPYING.LESSER create mode 100644 doc/README create mode 100644 doc/THANKS create mode 100644 lib/front/front.class.php create mode 100644 lib/front/tests/html_checkbox.expect create mode 100644 lib/front/tests/html_checkbox.php create mode 100644 lib/front/tests/html_radio.expect create mode 100644 lib/front/tests/html_radio.php create mode 100644 lib/front/tests/html_select.expect create mode 100644 lib/front/tests/html_select.php create mode 100644 module/action/model.php create mode 100644 module/admin/control.php create mode 100644 module/admin/lang/zh-cn.php create mode 100644 module/admin/model.php create mode 100644 module/admin/view/browsecompany.html.php create mode 100644 module/admin/view/browsegroup.html.php create mode 100644 module/admin/view/browseuser.html.php create mode 100644 module/admin/view/index.html.php create mode 100644 module/admin/view/menu.html.php create mode 100644 module/bug/control.php create mode 100644 module/bug/lang/en.php create mode 100644 module/bug/lang/zh-cn.php create mode 100644 module/bug/model.php create mode 100644 module/bug/view/browse.html.php create mode 100644 module/bug/view/create.html.php create mode 100644 module/bug/view/edit.html.php create mode 100644 module/bug/view/index.html.php create mode 100644 module/bug/view/view.html.php create mode 100644 module/common/action.html.php create mode 100644 module/common/control.php create mode 100644 module/common/footer.html.php create mode 100644 module/common/header.html.php create mode 100644 module/common/lang/en.php create mode 100644 module/common/lang/zh-cn.php create mode 100644 module/common/tablesorter.html.php create mode 100644 module/common/treeview.html.php create mode 100644 module/company/control.php create mode 100644 module/company/lang/en.php create mode 100644 module/company/lang/zh-cn.php create mode 100644 module/company/model.php create mode 100644 module/company/view/browse.html.php create mode 100644 module/company/view/create.html.php create mode 100644 module/company/view/edit.html.php create mode 100644 module/dept/control.php create mode 100644 module/dept/lang/zh-cn.php create mode 100644 module/dept/model.php create mode 100644 module/dept/view/browse.html.php create mode 100644 module/dept/view/create.html.php create mode 100644 module/dept/view/edit.html.php create mode 100644 module/group/control.php create mode 100644 module/group/lang/lang.php create mode 100644 module/group/lang/zh-cn.php create mode 100644 module/group/model.php create mode 100644 module/group/view/create.html.php create mode 100644 module/group/view/edit.html.php create mode 100644 module/group/view/index.html.php create mode 100644 module/group/view/managemember.html.php create mode 100644 module/group/view/managepriv.html.php create mode 100644 module/index/control.php create mode 100644 module/index/lang/en.php create mode 100644 module/index/lang/zh-cn.php create mode 100644 module/index/model.php create mode 100644 module/index/view/index.html.php create mode 100644 module/my/control.php create mode 100644 module/my/lang/zh-cn.php create mode 100644 module/my/model.php create mode 100644 module/my/view/bug.html.php create mode 100644 module/my/view/editprofile.html.php create mode 100644 module/my/view/footer.html.php create mode 100644 module/my/view/header.html.php create mode 100644 module/my/view/index.html.php create mode 100644 module/my/view/project.html.php create mode 100644 module/my/view/story.html.php create mode 100644 module/my/view/task.html.php create mode 100644 module/my/view/team.html.php create mode 100644 module/my/view/todo.html.php create mode 100644 module/product/control.php create mode 100644 module/product/lang/zh-cn.php create mode 100644 module/product/model.php create mode 100644 module/product/view/browse.html.php create mode 100644 module/product/view/create.html.php create mode 100644 module/product/view/edit.html.php create mode 100644 module/product/view/index.html.php create mode 100644 module/project/control.php create mode 100644 module/project/lang/zh-cn.php create mode 100644 module/project/model.php create mode 100644 module/project/view/browse.html.php create mode 100644 module/project/view/bug.html.php create mode 100644 module/project/view/burn.html.php create mode 100644 module/project/view/create.html.php create mode 100644 module/project/view/edit.html.php create mode 100644 module/project/view/index.html.php create mode 100644 module/project/view/linkstory.html.php create mode 100644 module/project/view/managechilds.html.php create mode 100644 module/project/view/managemembers.html.php create mode 100644 module/project/view/manageproducts.html.php create mode 100644 module/project/view/story.html.php create mode 100644 module/project/view/task.html.php create mode 100644 module/qa/control.php create mode 100644 module/qa/lang/zh-cn.php create mode 100644 module/qa/view/index.html.php create mode 100644 module/release/control.php create mode 100644 module/release/lang/en.php create mode 100644 module/release/lang/zh-cn.php create mode 100644 module/release/model.php create mode 100644 module/release/view/browse.html.php create mode 100644 module/release/view/create.html.php create mode 100644 module/release/view/delete.html.php create mode 100644 module/release/view/index.html.php create mode 100644 module/release/view/read.html.php create mode 100644 module/release/view/update.html.php create mode 100644 module/story/control.php create mode 100644 module/story/lang/en.php create mode 100644 module/story/lang/zh-cn.php create mode 100644 module/story/model.php create mode 100644 module/story/view/create.html.php create mode 100644 module/story/view/edit.html.php create mode 100644 module/story/view/view.html.php create mode 100644 module/task/control.php create mode 100644 module/task/lang/zh-cn.php create mode 100644 module/task/model.php create mode 100644 module/task/view/browse.html.php create mode 100644 module/task/view/create.html.php create mode 100644 module/task/view/edit.html.php create mode 100644 module/testcase/control.php create mode 100644 module/testcase/lang/en.php create mode 100644 module/testcase/lang/zh-cn.php create mode 100644 module/testcase/model.php create mode 100644 module/testcase/view/browse.html.php create mode 100644 module/testcase/view/create.html.php create mode 100644 module/testcase/view/edit.html.php create mode 100644 module/testcase/view/index.html.php create mode 100644 module/testcase/view/view.html.php create mode 100644 module/todo/control.php create mode 100644 module/todo/lang/zh-cn.php create mode 100644 module/todo/model.php create mode 100644 module/todo/view/create.html.php create mode 100644 module/todo/view/edit.html.php create mode 100644 module/tree/control.php create mode 100644 module/tree/lang/zh-cn.php create mode 100644 module/tree/model.php create mode 100644 module/tree/view/browse.html.php create mode 100644 module/tree/view/create.html.php create mode 100644 module/tree/view/edit.html.php create mode 100644 module/user/control.php create mode 100644 module/user/lang/en.php create mode 100644 module/user/lang/zh-cn.php create mode 100644 module/user/model.php create mode 100644 module/user/view/bug.html.php create mode 100644 module/user/view/create.html.php create mode 100644 module/user/view/deny.html.php create mode 100644 module/user/view/edit.html.php create mode 100644 module/user/view/footer.html.php create mode 100644 module/user/view/header.html.php create mode 100644 module/user/view/index.html.php create mode 100644 module/user/view/login.html.php create mode 100644 module/user/view/project.html.php create mode 100644 module/user/view/story.html.php create mode 100644 module/user/view/task.html.php create mode 100644 module/user/view/team.html.php create mode 100644 module/user/view/todo.html.php create mode 100644 module/user/view/view.html.php create mode 100644 www/index.php create mode 100644 www/js/jquery/lib.js create mode 100644 www/js/jquery/tablesorter/min.js create mode 100644 www/js/jquery/treeview/min.js create mode 100644 www/js/misc/sorttable.js create mode 100644 www/myrouter.class.php create mode 100644 www/theme/default/images/tablesorter/asc.gif create mode 100644 www/theme/default/images/tablesorter/bg.gif create mode 100644 www/theme/default/images/tablesorter/desc.gif create mode 100644 www/theme/default/images/treeview/file.gif create mode 100644 www/theme/default/images/treeview/folder-closed.gif create mode 100644 www/theme/default/images/treeview/folder.gif create mode 100644 www/theme/default/images/treeview/minus.gif create mode 100644 www/theme/default/images/treeview/plus.gif create mode 100644 www/theme/default/images/treeview/treeview-black-line.gif create mode 100644 www/theme/default/images/treeview/treeview-black.gif create mode 100644 www/theme/default/images/treeview/treeview-default-line.gif create mode 100644 www/theme/default/images/treeview/treeview-default.gif create mode 100644 www/theme/default/images/treeview/treeview-famfamfam-line.gif create mode 100644 www/theme/default/images/treeview/treeview-famfamfam.gif create mode 100644 www/theme/default/images/treeview/treeview-gray-line.gif create mode 100644 www/theme/default/images/treeview/treeview-gray.gif create mode 100644 www/theme/default/images/treeview/treeview-red-line.gif create mode 100644 www/theme/default/images/treeview/treeview-red.gif create mode 100644 www/theme/default/style.css create mode 100644 www/theme/default/tablesorter.css create mode 100644 www/theme/default/treeview.css create mode 100644 www/theme/default/yui.css create mode 100644 www/theme/firefox.css create mode 100644 www/theme/ie.6.css diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..4e02caf71e --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +VERSION=$(shell head -n 1 VERSION) + +all: tgz + +clean: + rm -fr pms + rm -fr *.tar.gz +tgz: + mkdir -p pms/lib + mkdir -p pms/doc + cp doc/zentao.mysql4.sql pms/doc/zentao.sql + cp doc/COPY* pms + cp -fr lib/front pms/lib + cp -fr config pms/ + cp -fr www pms/ + cp -fr module pms/ + find pms -name .svn |xargs rm -fr + find pms -name tests |xargs rm -fr + mkdir pms/cache + tar czvf ZenTaoPMS.$(VERSION).tar.gz pms + rm -fr pms diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000..b4e47cabb5 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.2.ALPHA diff --git a/bin/convertfrombugfree.php b/bin/convertfrombugfree.php new file mode 100644 index 0000000000..50c400de6c --- /dev/null +++ b/bin/convertfrombugfree.php @@ -0,0 +1,156 @@ + $value) + { + if(strpos($key, 'Date')) $bug[$key] = strtotime($value); + } + extract($bug); + $sql = "INSERT INTO zt_bug(id, product, module, title, severity, type, os,status, mailto, + openedby, openedDate,openedBuild, assignedTo,assignedDate, + resolvedBy, resolution, resolvedBuild, resolvedDate, + closedBy, closedDate, lastEditedBy, lastEditedDate + ) values($BugID, '$ProjectID', '$ModuleID', '$BugTitle', '$BugSeverity', '$BugType', '$BugOS', '$BugStatus', '$MailTo', + '$OpenedBy', '$OpenedDate', '$OpenedBuild', '$AssignedTo', '$AssignedDate', + '$ResolvedBy', '$Resolution', '$ResolvedBuild', '$ResolvedDate', + '$ClosedBy', '$ClosedDate', '$LastEditedBy', '$LastEditedDate')"; + mysql_query($sql) or die(mysql_error()); + } +} + +function convertAction() +{ + global $myLink, $companyID; + $sql = "SELECT * FROM BugHistory ORDER BY BugID, HistoryID"; + $result = mysql_query($sql, $myLink); + while($history = mysql_fetch_assoc($result)) + { + $historys[$history['BugID']][] = $history; + } + foreach($historys as $bugID => $bugHistorys) + { + foreach($bugHistorys as $key => $history) + { + $history['FullInfo'] = addslashes($history['FullInfo']); + $history['ActionDate'] = strtotime($history['ActionDate']); + if($key == 0) + { + $sql = "UPDATE zt_bug SET steps = \"$history[FullInfo]\" WHERE id='$bugID'"; + mysql_query($sql) or die(mysql_error()); + $history['FullInfo'] = ''; + } + + extract($history); + $sql = "INSERT INTO zt_action values($HistoryID, $companyID, 'bug', $BugID, '$UserName', '$Action', $ActionDate, '$FullInfo')"; + mysql_query($sql) or die(mysql_error()); + } + } + +} + +function fixModulePath() +{ + global $myLink, $companyID; + + $sql = "SELECT * FROM zt_module ORDER BY grade"; + $result = mysql_query($sql, $myLink); + while($module = mysql_fetch_assoc($result)) + { + if($module['grade'] == 1) + { + $sql = "UPDATE zt_module set path = ',$module[id],' WHERE id=$module[id]"; + mysql_query($sql) or die(mysql_error()); + } + else + { + $sql = "SELECT path FROM zt_module WHERE id = $module[parent]"; + $result2 = mysql_query($sql); + $parent = mysql_fetch_assoc($result2); + $sql = "UPDATE zt_module set path = '$parent[path]$module[id],' WHERE id=$module[id]"; + mysql_query($sql) or die(mysql_error()); + } + } +} +function clear() +{ + global $myLink; + $sqls[] = "TRUNCATE TABLE zt_user"; + $sqls[] = "TRUNCATE TABLE zt_product"; + $sqls[] = "TRUNCATE TABLE zt_module"; + $sqls[] = "TRUNCATE TABLE zt_bug"; + $sqls[] = "TRUNCATE TABLE zt_action"; + foreach($sqls as $sql) mysql_query($sql, $myLink); +} +?> diff --git a/bin/exportactions.php b/bin/exportactions.php new file mode 100644 index 0000000000..a2d042a036 --- /dev/null +++ b/bin/exportactions.php @@ -0,0 +1,31 @@ +getMethods(); + foreach($methods as $method) + { + $methodRef = new ReflectionMethod($method->class, $method->name); + if($methodRef->isPublic() and strpos($method->name, '__') === false) + { + echo "\$lang['action']['$moduleName']['$method->name'] = '$method->name';\n"; + } + } + echo "\n"; + } + } +} +?> + + diff --git a/bin/updaterevision.php b/bin/updaterevision.php new file mode 100644 index 0000000000..03dd603d83 --- /dev/null +++ b/bin/updaterevision.php @@ -0,0 +1,14 @@ +#!/usr/bin/env php +(.*)<|', $date, $result); +$date = $result[1]; +$date = date('Y-m-d H:i:s', strtotime($date)); +file_put_contents('../cache/revision.txt', "$revision\n$date"); +?> diff --git a/config/config.php b/config/config.php new file mode 100644 index 0000000000..1999a523a1 --- /dev/null +++ b/config/config.php @@ -0,0 +1,93 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package ZenTaoMS + * @version $Id: config.test.php 1428 2009-10-20 03:37:53Z wwccss $ + * @link http://www.zentao.cn + */ +$config->version = '0.1 alpha'; // 版本号,切勿修改。 +$config->debug = true; // 是否打开debug功能。 +$config->webRoot = '/'; // web网站的根目录。 +$config->encoding = 'UTF-8'; // 网站的编码。 +$config->cookiePath = '/'; // cookie的有效路径。 +$config->cookieLife = time() + 2592000; // cookie的生命周期。 + +$config->requestType = 'PATH_INFO'; // 如何获取当前请求的信息,可选值:PATH_INFO|GET +$config->pathType = 'clean'; // requestType=PATH_INFO: 请求url的格式,可选值为full|clean,full格式会带有参数名称,clean则只有取值。 +$config->strictParams= false; // 传递参数的名称是否与方法定义中名称完全一致。如果设为false,则需要保证顺序一致。 +$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,xml,json,txt,csv,doc,pdf,'; // 支持的视图列表。 +$config->langs = 'zh-cn,zh-tw,zh-hk,en'; // 支持的语言列表。 +$config->themes = 'default'; // 支持的主题列表。 + +$config->super2OBJ = true; // 是否通过对象来访问全局变量。 + +$config->default->view = 'html'; // 默认的视图格式。 +$config->default->lang = 'zh-cn'; // 默认的语言。 +$config->default->theme = 'default'; // 默认的主题。 +$config->default->module = 'index'; // 默认的模块。当请求中没有指定模块时,加载该模块。 +$config->default->method = 'index'; // 默认的方法。当请求中没有指定方法或者指定的方法不存在时,调用该方法。 +$config->default->domain = 'pms.easysoft.com'; // 默认的域名,当请求中的域名没有对应的记录时,使用此默认域名对应的公司信息。 + +$config->db->errorMode = PDO::ERRMODE_EXCEPTION; // PDO的错误模式: PDO::ERRMODE_SILENT|PDO::ERRMODE_WARNING|PDO::ERRMODE_EXCEPTION +$config->db->persistant = false; // 是否打开持久连接。 +$config->db->driver = 'mysql'; // pdo的驱动类型,目前暂时只支持mysql。 +$config->db->host = '127.0.0.1'; // mysql主机。 +$config->db->port = '3306'; // mysql主机端口号。 +$config->db->name = 'zentao'; // 数据库名称。 +$config->db->user = 'root'; // 数据库用户名。 +$config->db->password = ''; // 密码。 +$config->db->encoding = 'UTF8'; // 数据库的编码。 +$config->db->prefix = 'zt_'; // 数据表前缀。 +$config->db->dao = true; // 是否使用DAO。 +define('TABLE_ACTION', $config->db->prefix . 'action'); +define('TABLE_BUG', $config->db->prefix . 'bug'); +define('TABLE_BUILD', $config->db->prefix . 'build'); +define('TABLE_CASE', $config->db->prefix . 'case'); +define('TABLE_CASERESULT', $config->db->prefix . 'caseResult'); +define('TABLE_CASESTEP', $config->db->prefix . 'caseStep'); +define('TABLE_COMPANY', $config->db->prefix . 'company'); +define('TABLE_CONFIG', $config->db->prefix . 'config'); +define('TABLE_DEPT', $config->db->prefix . 'dept'); +define('TABLE_EFFORT', $config->db->prefix . 'effort'); +define('TABLE_FILE', $config->db->prefix . 'file'); +define('TABLE_HISTORY', $config->db->prefix . 'history'); +define('TABLE_MODULE', $config->db->prefix . 'module'); +define('TABLE_USER', $config->db->prefix . 'user'); +define('TABLE_GROUP', $config->db->prefix . 'group'); +define('TABLE_USERGROUP', $config->db->prefix . 'userGroup'); +define('TABLE_GROUPPRIV', $config->db->prefix . 'groupPriv'); +define('TABLE_PLANCASE', $config->db->prefix . 'planCase'); +define('TABLE_PRODUCT', $config->db->prefix . 'product'); +define('TABLE_RELEASE', $config->db->prefix . 'release'); +define('TABLE_RELEATION', $config->db->prefix . 'releation'); +define('TABLE_RESULTSTEP', $config->db->prefix . 'resultStep'); +define('TABLE_PROJECT', $config->db->prefix . 'project'); +define('TABLE_TEAM', $config->db->prefix . 'team'); +define('TABLE_STORY', $config->db->prefix . 'story'); +define('TABLE_PROJECTSTORY', $config->db->prefix . 'projectStory'); +define('TABLE_TASK', $config->db->prefix . 'task'); +define('TABLE_TASKESTIMATE', $config->db->prefix . 'taskEstimate'); +define('TABLE_TESTPLAN', $config->db->prefix . 'testPlan'); +define('TABLE_PROJECTPRODUCT', $config->db->prefix . 'projectProduct'); +define('TABLE_TODO', $config->db->prefix . 'todo'); diff --git a/db/zentao.sql b/db/zentao.sql new file mode 100644 index 0000000000..5aa8e112c0 --- /dev/null +++ b/db/zentao.sql @@ -0,0 +1,608 @@ +-- phpMyAdmin SQL Dump +-- version 3.1.3.1 +-- http://www.phpmyadmin.net +-- +-- 涓绘満: 127.0.0.1 +-- 鐢熸垚鏃ユ湡: 2009 骞 09 鏈 10 鏃 10:22 +-- 鏈嶅姟鍣ㄧ増鏈: 5.0.67 +-- PHP 鐗堟湰: 5.2.9 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- 鏁版嵁搴: `zentao` +-- + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_action` +-- + +CREATE TABLE IF NOT EXISTS `zt_action` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `objectType` varchar(30) NOT NULL default '', + `objectID` mediumint(8) unsigned NOT NULL default '0', + `actor` varchar(30) NOT NULL default '', + `action` varchar(30) NOT NULL default '', + `date` int(10) unsigned NOT NULL default '0', + `comment` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_bug` +-- + +CREATE TABLE IF NOT EXISTS `zt_bug` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `product` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `path` varchar(255) NOT NULL default '', + `project` mediumint(8) unsigned NOT NULL default '0', + `sprint` mediumint(8) unsigned NOT NULL default '0', + `story` mediumint(8) unsigned NOT NULL default '0', + `task` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(150) NOT NULL default '', + `severity` tinyint(4) NOT NULL default '0', + `type` varchar(30) NOT NULL default '', + `os` varchar(30) NOT NULL default '', + `browser` varchar(30) NOT NULL default '', + `machine` varchar(30) NOT NULL default '', + `found` varchar(30) NOT NULL default '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL default 'active', + `mailto` varchar(255) NOT NULL default '', + `openedBy` varchar(30) NOT NULL default '', + `openedDate` int(10) unsigned NOT NULL default '0', + `openedBuild` varchar(30) NOT NULL default '', + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` int(10) unsigned NOT NULL default '0', + `resolvedBy` varchar(30) NOT NULL default '', + `resolution` varchar(30) NOT NULL default '', + `resolvedBuild` varchar(30) NOT NULL default '', + `resolvedDate` int(10) unsigned NOT NULL default '0', + `closedBy` varchar(30) NOT NULL default '', + `closedDate` int(11) NOT NULL default '0', + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` int(10) unsigned NOT NULL default '0', + `field1` varchar(255) NOT NULL default '', + `field2` varchar(255) NOT NULL default '', + `feild3` varchar(255) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_build` +-- + +CREATE TABLE IF NOT EXISTS `zt_build` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `sprintprj` mediumint(8) unsigned NOT NULL default '0', + `name` char(30) NOT NULL default '', + `scmPath` char(255) NOT NULL default '', + `buildDate` int(10) unsigned NOT NULL default '0', + `builder` char(30) NOT NULL default '', + `tasks` char(255) NOT NULL default '', + `desc` char(255) NOT NULL default '' +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_case` +-- + +CREATE TABLE IF NOT EXISTS `zt_case` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `path` mediumint(8) unsigned NOT NULL default '0', + `story` mediumint(30) unsigned NOT NULL default '0', + `title` char(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '0', + `type` enum('1','2','3') NOT NULL default '1', + `status` enum('1','2','3') NOT NULL default '1', + `frequency` enum('1','2','3') NOT NULL default '1', + `order` tinyint(30) unsigned NOT NULL default '0', + `openedBy` char(30) NOT NULL default '', + `openedDate` int(30) unsigned NOT NULL default '0', + `lastEditedBy` char(30) NOT NULL default '', + `lastEditedDate` int(30) unsigned NOT NULL default '0', + `field1` char(30) NOT NULL default '', + `field2` char(30) NOT NULL default '', + `feidl3` char(30) NOT NULL default '', + `version` tinyint(3) unsigned NOT NULL default '0' +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_caseResult` +-- + +CREATE TABLE IF NOT EXISTS `zt_caseResult` ( + `id` mediumint(8) unsigned NOT NULL default '0', + `plan` mediumint(30) unsigned NOT NULL default '0', + `build` mediumint(30) unsigned NOT NULL default '0', + `case` mediumint(30) unsigned NOT NULL default '0', + `result` enum('pass','fail','skip') NOT NULL default 'pass', + `status` enum('finished','blocked') NOT NULL default 'finished', + `executedBy` char(30) NOT NULL default '', + `executedDate` int(30) unsigned NOT NULL default '0', + `os` char(30) NOT NULL default '', + `browser` char(30) NOT NULL default '', + `hardware` char(30) NOT NULL default '' +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_caseStep` +-- + +CREATE TABLE IF NOT EXISTS `zt_caseStep` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `case` mediumint(8) unsigned NOT NULL default '0', + `caseVersion` tinyint(3) unsigned NOT NULL default '0', + `step` char(255) NOT NULL default '', + `expect` char(255) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_company` +-- + +CREATE TABLE IF NOT EXISTS `zt_company` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `name` char(120) NOT NULL default '', + `phone` char(20) NOT NULL, + `fax` char(20) NOT NULL default '', + `address` char(120) NOT NULL default '', + `zipcode` char(10) NOT NULL default '', + `website` char(120) NOT NULL default '', + `backyard` char(120) NOT NULL default '', + `pms` char(120) NOT NULL default '', + `guest` enum('1','0') NOT NULL default '0', + `admins` char(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_config` +-- + +CREATE TABLE IF NOT EXISTS `zt_config` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `owner` char(30) NOT NULL default '', + `section` char(30) NOT NULL default '', + `key` char(30) NOT NULL default '', + `value` char(255) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_division` +-- + +CREATE TABLE IF NOT EXISTS `zt_division` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `name` char(30) NOT NULL default '', + `parent` mediumint(8) unsigned NOT NULL default '0', + `path` char(255) NOT NULL default '', + `grade` tinyint(3) unsigned NOT NULL default '0', + `order` tinyint(3) unsigned NOT NULL default '0', + `position` char(30) NOT NULL default '', + `function` char(255) NOT NULL default '', + `manager` char(30) NOT NULL default '', + PRIMARY KEY (`id`), + KEY `company` (`company`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_effort` +-- + +CREATE TABLE IF NOT EXISTS `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `user` char(30) NOT NULL default '', + `todo` enum('1','0') NOT NULL default '1', + `date` date NOT NULL default '0000-00-00', + `begin` datetime NOT NULL default '0000-00-00 00:00:00', + `end` datetime NOT NULL default '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL default '1', + `idvalue` mediumint(8) unsigned NOT NULL default '0', + `name` char(30) NOT NULL default '', + `desc` char(255) NOT NULL default '', + `status` enum('1','2','3') NOT NULL default '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_file` +-- + +CREATE TABLE IF NOT EXISTS `zt_file` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `file` char(30) NOT NULL default '', + `type` char(30) NOT NULL default '', + `size` mediumint(8) unsigned NOT NULL default '0', + `addedBy` char(30) NOT NULL default '', + `addedDate` int(10) unsigned NOT NULL default '0', + `downloads` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_group` +-- + +CREATE TABLE IF NOT EXISTS `zt_group` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL, + `name` char(30) NOT NULL, + `desc` char(255) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_groupPriv` +-- + +CREATE TABLE IF NOT EXISTS `zt_groupPriv` ( + `group` mediumint(8) unsigned NOT NULL default '0', + `module` char(30) NOT NULL default '', + `method` char(30) NOT NULL default '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_history` +-- + +CREATE TABLE IF NOT EXISTS `zt_history` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `action` mediumint(8) unsigned NOT NULL default '0', + `field` varchar(30) NOT NULL default '', + `old` text NOT NULL, + `new` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_module` +-- + +CREATE TABLE IF NOT EXISTS `zt_module` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `product` mediumint(8) unsigned NOT NULL default '0', + `name` char(30) NOT NULL default '', + `parent` mediumint(8) unsigned NOT NULL default '0', + `path` char(255) NOT NULL default '', + `grade` tinyint(3) unsigned NOT NULL default '0', + `order` tinyint(3) unsigned NOT NULL default '0', + `view` char(30) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_planCase` +-- + +CREATE TABLE IF NOT EXISTS `zt_planCase` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `plan` mediumint(8) unsigned NOT NULL default '0', + `case` mediumint(8) unsigned NOT NULL default '0', + `caseVersion` tinyint(3) unsigned NOT NULL default '0', + `assignedTo` char(30) NOT NULL default '', + `assignedDate` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_product` +-- + +CREATE TABLE IF NOT EXISTS `zt_product` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `name` varchar(30) NOT NULL default '', + `code` varchar(10) NOT NULL default '', + `order` tinyint(3) unsigned NOT NULL default '0', + `status` varchar(30) NOT NULL default '', + `desc` text NOT NULL, + PRIMARY KEY (`id`), + KEY `company` (`company`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_project` +-- + +CREATE TABLE IF NOT EXISTS `zt_project` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `isCat` enum('1','0') NOT NULL default '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` enum('sprint','project') NOT NULL default 'sprint', + `parent` mediumint(8) unsigned NOT NULL default '0', + `name` varchar(30) NOT NULL default '', + `code` varchar(10) NOT NULL default '', + `begin` date NOT NULL, + `end` date NOT NULL, + `status` enum('1','2','3','4') NOT NULL default '1', + `statge` enum('1','2','3','4','5') NOT NULL default '1', + `pri` enum('1','2','3','4') NOT NULL default '1', + `desc` text NOT NULL, + `goal` text NOT NULL, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` int(10) unsigned NOT NULL default '0', + `closedBy` varchar(30) NOT NULL default '', + `closedDate` int(10) unsigned NOT NULL default '0', + `canceledBy` varchar(30) NOT NULL default '', + `canceledDate` int(10) unsigned NOT NULL default '0', + `PO` varchar(30) NOT NULL default '', + `PM` varchar(30) NOT NULL default '', + `QM` varchar(30) NOT NULL default '', + `team` varchar(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `company` (`company`,`type`,`parent`,`begin`,`end`,`status`,`statge`,`pri`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_projectProduct` +-- + +CREATE TABLE IF NOT EXISTS `zt_projectProduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_projectStory` +-- + +CREATE TABLE IF NOT EXISTS `zt_projectStory` ( + `project` mediumint(8) unsigned NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL default '0', + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_release` +-- + +CREATE TABLE IF NOT EXISTS `zt_release` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `product` mediumint(8) unsigned NOT NULL default '0', + `name` varchar(30) NOT NULL default '', + `desc` text NOT NULL, + `status` varchar(30) NOT NULL default '', + `planDate` date NOT NULL default '0000-00-00', + `releaseDate` datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `product` (`product`,`status`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_releation` +-- + +CREATE TABLE IF NOT EXISTS `zt_releation` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL default '', + `id1` mediumint(8) unsigned NOT NULL default '0', + `id2` mediumint(8) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_resultStep` +-- + +CREATE TABLE IF NOT EXISTS `zt_resultStep` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `result` mediumint(8) unsigned NOT NULL default '0', + `step` mediumint(8) unsigned NOT NULL default '0', + `stepResult` enum('pass','fail','block','n/a') NOT NULL default 'pass', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_story` +-- + +CREATE TABLE IF NOT EXISTS `zt_story` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `product` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `replease` mediumint(8) unsigned NOT NULL default '0', + `bug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(90) NOT NULL default '', + `spec` text NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '0', + `estimate` tinyint(3) unsigned NOT NULL default '0', + `status` varchar(30) NOT NULL default '', + `mailto` varchar(255) NOT NULL default '', + `openedBy` varchar(30) NOT NULL default '', + `openedDate` int(10) unsigned NOT NULL default '0', + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` int(10) unsigned NOT NULL default '0', + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` int(10) unsigned NOT NULL default '0', + `closedBy` varchar(30) NOT NULL default '', + `closedDate` int(10) unsigned NOT NULL default '0', + `version` float(4,1) NOT NULL default '0.0', + `attatchment` varchar(30) NOT NULL default '', + PRIMARY KEY (`id`), + KEY `product` (`product`,`module`,`replease`,`type`,`pri`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_task` +-- + +CREATE TABLE IF NOT EXISTS `zt_task` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `project` mediumint(8) unsigned NOT NULL default '0', + `story` mediumint(8) unsigned NOT NULL default '0', + `name` char(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '0', + `owner` char(30) NOT NULL default '', + `estimate` tinyint(3) unsigned NOT NULL default '0', + `consumed` tinyint(3) unsigned NOT NULL default '0', + `status` enum('wait','doing','done') NOT NULL default 'wait', + `desc` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_taskEstimate` +-- + +CREATE TABLE IF NOT EXISTS `zt_taskEstimate` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `task` mediumint(8) unsigned NOT NULL default '0', + `date` int(10) unsigned NOT NULL default '0', + `estimate` tinyint(3) unsigned NOT NULL default '0', + `estimater` char(30) NOT NULL default '', + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_team` +-- + +CREATE TABLE IF NOT EXISTS `zt_team` ( + `project` mediumint(8) unsigned NOT NULL default '0', + `account` char(30) NOT NULL default '', + `role` char(30) NOT NULL default '', + `joinDate` date NOT NULL default '0000-00-00', + `workingHour` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`project`,`account`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_testPlan` +-- + +CREATE TABLE IF NOT EXISTS `zt_testPlan` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `name` char(30) NOT NULL default '', + `sprintprj` mediumint(8) unsigned NOT NULL default '0', + `planBegin` int(10) unsigned NOT NULL default '0', + `planEnd` int(10) unsigned NOT NULL default '0', + `realBegin` int(10) unsigned NOT NULL default '0', + `realEnd` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_user` +-- + +CREATE TABLE IF NOT EXISTS `zt_user` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', + `division` mediumint(8) unsigned NOT NULL default '0', + `account` char(30) NOT NULL default '', + `password` char(32) NOT NULL default '', + `realname` char(30) NOT NULL default '', + `nickname` char(60) NOT NULL default '', + `avatar` char(30) NOT NULL default '', + `birthyear` smallint(5) unsigned NOT NULL default '0', + `birthday` date NOT NULL default '0000-00-00', + `gendar` enum('f','m') NOT NULL default 'f', + `email` char(90) NOT NULL default '', + `msn` char(90) NOT NULL default '', + `qq` char(20) NOT NULL default '', + `yahoo` char(90) NOT NULL default '', + `gtalk` char(90) NOT NULL default '', + `wangwang` char(90) NOT NULL default '', + `mobile` char(11) NOT NULL default '', + `phone` char(20) NOT NULL default '', + `address` char(120) NOT NULL default '', + `zipcode` char(10) NOT NULL default '', + `join` date NOT NULL default '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL default '0', + `ip` char(15) NOT NULL, + `last` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `company` (`company`,`division`) +) ENGINE=MyISAM ; + +-- -------------------------------------------------------- + +-- +-- 琛ㄧ殑缁撴瀯 `zt_userGroup` +-- + +CREATE TABLE IF NOT EXISTS `zt_userGroup` ( + `account` char(30) NOT NULL default '', + `group` mediumint(8) unsigned NOT NULL default '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM ; diff --git a/doc/COPYING b/doc/COPYING new file mode 100644 index 0000000000..94a9ed024d --- /dev/null +++ b/doc/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/doc/COPYING.LESSER b/doc/COPYING.LESSER new file mode 100644 index 0000000000..fc8a5de7ed --- /dev/null +++ b/doc/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/doc/README b/doc/README new file mode 100644 index 0000000000..2834145e19 --- /dev/null +++ b/doc/README @@ -0,0 +1,46 @@ +涓銆佷粈涔堟槸绂呴亾椤圭洰绠$悊杞欢 + +绂呴亾椤圭洰绠$悊杞欢(ZenTaoPMS)鏄竴娆惧浗浜х殑锛屽熀浜嶭GPL鍗忚锛屽紑婧愬厤璐圭殑椤圭洰绠$悊杞欢锛屽畠闆嗕骇鍝佺鐞嗐侀」鐩鐞嗐佹祴璇曠鐞嗕簬涓浣擄紝鍚屾椂杩樺寘鍚簡浜嬪姟绠$悊銆佺粍缁囩鐞嗙瓑璇稿鍔熻兘锛屾槸涓皬鍨嬩紒涓氶」鐩鐞嗙殑棣栭夈傚畼鏂圭綉绔欙細www.zentao.cn + +绂呴亾椤圭洰绠$悊杞欢浣跨敤PHP + MySQL寮鍙戯紝鍩轰簬鑷富鐨凱HP寮鍙戞鏋垛攢鈹ZenTaoPHP鑰屾垚銆傜涓夋柟寮鍙戣呮垨鑰呬紒涓氬彲浠ラ潪甯告柟渚跨殑寮鍙戞彃浠舵垨鑰呰繘琛屽畾鍒躲 + +绂呴亾鍦ㄦ墜锛岄」鐩棤蹇э紒 + +浜屻佺閬撶殑鍚箟 + +Zen鏄滅鈥濈殑鎰忔濓紝Tao鏄滈亾鈥濈殑鎰忔濄俍enTao鍚堟剰涓虹涓庨亾銆傝繖涓悕绉版槸鎴戝湪璇汇婄紪绋嬩箣绂呫嬪拰銆婄紪绋嬩箣閬撱嬬殑鏃跺欏彈鍒板惎鍙戯紝鍐冲畾閲囩敤杩欎釜姣旇緝鏈変腑鍥藉懗閬撶殑鍚嶅瓧銆 + +涓夈佺閬撻」鐩鐞嗚蒋浠剁殑鏉ョ敱锛 + +璇村埌杩欎釜闂锛岃浠嶣ugFree璋堣捣銆傝嚜浠04骞村彂甯傿ugFree浠ユ潵鍒2007骞达紝BugFree闄嗙画鍙戝竷浜嗕簲鍏釜鐗堟湰锛屽湪Bug绠$悊鏂归潰鍩烘湰涓婂凡缁忓畬澶囥備絾杩欎釜鏃跺欎骇鐢熶簡涓浜涙柊鐨勯棶棰樸傚緢澶氱綉鍙嬫嬁鐫BugFree杩涜鏀瑰姩锛屾敼閫犱负鍏朵粬鐨勭鐞嗙郴缁熴傝繕缁忓父鏈夌綉鍙嬮棶锛孊ugFree鍙互涓嶅彲浠ュ姞鍏ラ」鐩鐞嗙殑鍔熻兘銆傛垜涔熶竴鐩村湪鎬濊冭繖浜涢棶棰樸傚悗鏉ユ垜鍔犲叆浜嗛樋閲屽反宸达紝鍦ㄤ腑鍥介泤铏庘樸侀樋閲屽濡堛佹窐瀹濅笁骞寸殑宸ヤ綔缁忓巻涓紝鍙傚姞浜嗗ぇ澶у皬灏忕殑椤圭洰銆備篃娣变负椤圭洰绠$悊鎵鍥版儜銆備簬鏄氨浜х敓浜嗗仛涓涓伐鍏锋潵瑙e喅椤圭洰绠$悊鐨勯棶棰樸 + +鐢变簬绉嶇鍘熷洜锛屾垜杩欎釜鎰挎湜鍦ㄩ樋閲屽反宸村苟娌℃湁瀹炵幇銆傝鏉ヤ篃鏄竴浠跺垢浜嬶紝杩欐牱鎴戝彲浠ユ妸瀹冨紑婧愭潵鍙戝竷銆備粠浠婂勾鍒濇垜灏卞紑濮嬬潃鎵嬭冭檻杩欏绠$悊杞欢鐨勮璁°傛暣鏁磋姳浜嗗崐骞寸殑鏃堕棿鍦ㄨ冭檻銆7鏈堜唤浠庨樋閲屽反宸磋緸鑱屼箣鍚庯紝鎴戝紑濮嬫湁鏈変簡鐩稿姣旇緝澶氱殑涓鐐规椂闂存潵杩涜杩欏绯荤粺鐨勫紑鍙戙傚悓鏃朵篃闈炲父鎰熻阿鐜板湪鐨勮繖瀹跺崟浣嶏紝涓烘垜寮鍙戠閬撻」鐩鐞嗚蒋浠舵彁渚涗簡澶у姏鐨勬敮鎸併 + +鍥涖佷负浠涔堣繕瑕佸仛绂呴亾椤圭洰绠$悊杞欢锛 + +寰堝鏈嬪弸浼氶棶锛屽凡缁忔湁寰堝鐨勫紑婧愰」鐩鐞嗚蒋浠舵垨鑰呯郴缁熶簡锛屼负浠涔堣繕瑕佽嚜宸卞仛涓涓憿锛熶富瑕佸師鍥犳槸鎴戣涓虹幇鍦ㄧ殑寮婧愰」鐩鐞嗚蒋浠跺杩欎釜闂瑙e喅鐨勫苟涓嶅ソ锛屾瘮濡傜己涔忛渶姹傜鐞嗭紝bug绠$悊绛夊姛鑳姐傝屼笖寰堝寮婧愮殑椤圭洰绠$悊杞欢浣跨敤璧锋潵涔熶笉鏂逛究銆 + +甯傚満涓婁篃鏈夊緢澶氬晢涓氱殑杞欢锛屼絾鏀惰垂閮戒笉鑿诧紝鑰屼笖涔熸湭蹇呰寰楀ソ鐢ㄣ + +鐜板湪涔熸湁寰堝鍦ㄧ嚎鐨勯」鐩鐞嗘湇鍔★紝姣斿鍥藉鐨刡asecamp锛屽浗鍐呯殑鏄撳害锛屽繖鍚х瓑銆備絾鎴戠殑瑙傜偣锛岃繖浜涘湪绾跨殑椤圭洰绠$悊杞欢鍔熻兘鏈夐檺锛岀己涔忓畾鍒讹紝璁块棶閫熷害鏃犳硶淇濊瘉锛岃屼笖缂轰箯淇濆瘑銆 + +浜斻佺閬撻」鐩鐞嗚蒋浠剁殑鐗圭偣锛 + +闆嗘垚浜嗕骇鍝佺鐞嗐侀」鐩鐞嗐佹祴璇曠鐞嗐佷汉鍛樼鐞嗐佸彂甯冪鐞嗐佷簨鍔$鐞嗙瓑鍔熻兘浜庝竴浣撱備綘鍙渶瑕佷竴涓蒋浠跺氨鍙互瀹屾垚椤圭洰绠$悊鐨勬渶鏍稿績鐨勪换鍔° +寮婧愬厤璐癸紝闄嶄綆浼佷笟閮ㄧ讲鐨勬垚鏈 +鍔熻兘娉ㄩ噸瀹炴晥锛屼娇鐢ㄦ柟渚匡紝娌℃湁澶澶嶆潅鐨勬蹇点傛垜璁捐鐨勭悊蹇垫槸涓涓病鏈夊仛杩囬」鐩鐞嗙殑浜虹粡杩10鍒嗛挓鐨勫煿璁彲浠ヤ娇鐢ㄥ畠杩涜椤圭洰绠$悊銆:) +鍩轰簬PHP+MySQL寮鍙戯紝浼佷笟鑷富鏀瑰姩鏂逛究銆傚苟涓斿熀浜嶼enTaoPHP妗嗘灦锛屼负绗笁鏂瑰紑鍙戣呯殑鍔犲叆鎵撲笅浜嗗潥瀹炵殑鍩虹銆 +涓昏鐞嗗康鍩轰簬scrum锛屽悓鏃剁粨鍚堜簡PMP閲岄潰鐨勫緢澶氭蹇点 +鏀寔澶氬叕鍙革紝澶氶」鐩紝澶氫骇鍝侊紝澶氬洟闃熺殑寮鍙戙 +鐏垫椿鐨勬潈闄愯缃 +鏀寔浜у搧涓庨」鐩箣闂寸殑鐭╅樀鍏崇郴銆 + +鍏佺閬撻」鐩鐞嗚蒋浠剁殑鐜扮姸鍙婂紑鍙戣鍒掞細 + +绂呴亾椤圭洰绠$悊杞欢鐩墠姝e湪绱у瘑寮鍙戜腑锛屽凡缁忓彂甯冧簡鍑犱釜alpha鐗堟湰銆備絾杩欏嚑涓増鏈殑鍔熻兘杩樹粎浠呮槸鍐板北涓瑙掋傛垜浠鍒掑湪浠婂勾骞村簳鐨勬椂鍊欐帹鍑篵eta鐗堟湰锛屾槑骞寸涓瀛e害鐨勬椂鍊欐帹鍑虹涓涓猻table鐨勭増鏈 + +涓冦佺閬撻」鐩鐞嗚蒋浠堕渶瑕佹偍鐨勫府鍔 + +绂呴亾椤圭洰绠$悊杞欢闇瑕佹偍鐨勫府鍔╋紝鏃犺鎮ㄦ槸寮鍙戜汉鍛橈紝鎶戞垨鏄」鐩粡鐞嗭紝鎴栬呮槸浜у搧缁忕悊锛岃繕鏄祴璇曚汉鍛橈紝鍙堟垨鑰呮槸寮婧愮埍濂借咃紝鎮ㄩ兘鍙互鍦ㄧ閬撻」鐩鐞嗚蒋浠舵壘鍒板弬涓庣殑鍦版柟銆傛垜浠細浠ラ潪甯竜pen鐨勫績鎬佹墦閫犱竴涓閬撻」鐩鐞嗚蒋浠剁殑绀惧尯銆傛垜鐩镐俊锛岀閬撶ぞ鍖虹殑鎴愬姛锛屾墠鏄閬撻」鐩鐞嗚蒋浠剁殑鎴愬姛銆 + +澶у鐜板湪鍙互璁块棶http://pms.zentao.cn鏉ユ煡鐪嬭繖涓」鐩鐞嗚蒋浠惰嚜韬殑杩涘睍鎯呭喌銆傚ぇ瀹跺鏋滄兂鍔犲叆锛屽彲浠ュ拰鎴戣仈绯伙細wwccss#gmail.com銆 diff --git a/doc/THANKS b/doc/THANKS new file mode 100644 index 0000000000..8ffdcb85f9 --- /dev/null +++ b/doc/THANKS @@ -0,0 +1,6 @@ +楦h阿 + +绂呴亾椤圭洰绠$悊杞欢鍦ㄥ紑鍙戣繃绋嬩腑寰楀埌浜嗘櫘鍔犵綉锛堥潚宀涙櫘鍔犳櫤鑳戒俊鎭湁闄愬叕鍙)鐨勫ぇ鍔涙敮鎸侊紝鍦ㄦ琛ㄧず鎰熻阿锛 娆㈣繋澶у璁块棶鏅姞缃 www.pojaa.com 锛岃幏鍙栨渶閰风殑姘戠敓淇℃伅锛 + + 鐜嬫槬鐢 鏄撹蒋寮婧愯蒋浠剁爺鍙戜腑蹇 + 2009-10-25 diff --git a/lib/front/front.class.php b/lib/front/front.class.php new file mode 100644 index 0000000000..22cfe89c7f --- /dev/null +++ b/lib/front/front.class.php @@ -0,0 +1,411 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package ZenTaoMS + * @version $Id: front.class.php 1439 2009-10-22 01:26:23Z wwccss $ + * @link http://www.zentao.cn + */ +class html +{ + /** + * create tags like text + * + * @param string $href the link url. + * @param string $title the link title. + * @param string $target the target window + */ + static public function a($href = '', $title = '', $target = "_self") + { + if(empty($title)) $title = $href; + if($target == '_self') return "$title\n"; + return "$title\n"; + } + + /** + * create tags like text + * + * @param string $mail the email address + * @param string $title the email title. + */ + static public function mailto($mail = '', $title = '') + { + if(empty($title)) $title = $mail; + return "$title\n"; + } + + /** + * create tags like "" + * + * @param string $name the name of the select tag. + * @param array $options the array to create select tag from. + * @param string $selectedItems the item(s) to be selected, can like item1,item2. + * @param string $attrib other params such as multiple, size and style. + */ + static public function select($name = '', $options = array(), $selectedItems = "", $attrib = "") + { + $options = (array)($options); + if(!is_array($options) or empty($options)) return false; + + /* The begin. */ + $id = $name; + if($pos = strpos($name, '[')) $id = substr($name, 0, $pos); + $string = "\n"; + } + + /** + * Create tags like "" + * + * @param string $name the name of the radio tag. + * @param array $options the array to create radio tag from. + * @param string $checked the value to checked by default. + * @param string $attrib other attribs. + */ + static public function radio($name = '', $options = array(), $checked = "", $attrib = "") + { + $options = (array)($options); + if(!is_array($options) or empty($options)) return false; + + $string = ''; + foreach($options as $key => $value) + { + + $key = str_replace('item', '', $key); // 鍥犱负瀵硅薄鐨勫厓绱犱笉鑳戒负鏁板瓧锛屾墍浠ラ渶瑕佸湪閰嶇疆閲岄潰浼氬湪鏁板瓧鍓嶉潰娣诲姞item锛岃繖涓湴鏂瑰皢item鍘绘帀銆 + $string .= "" + * + * @param string $name the name of the checkbox tag. + * @param array $options the array to create checkbox tag from. + * @param string $checked the value to checked by default, can be item1,item2 + * @param string $attrib other attribs. + */ + static public function checkbox($name, $options, $checked = "", $attrib = "") + { + $options = (array)($options); + if(!is_array($options) or empty($options)) return false; + $string = ''; + $checked = ",$checked,"; + + foreach($options as $key => $value) + { + $key = str_replace('item', '', $key); // 鍥犱负瀵硅薄鐨勫厓绱犱笉鑳戒负鏁板瓧锛屾墍浠ラ渶瑕佸湪閰嶇疆閲岄潰浼氬湪鏁板瓧鍓嶉潰娣诲姞item锛岃繖涓湴鏂瑰皢item鍘绘帀銆 + $string .= "" + * + * @param string $name the name of the text input tag. + * @param string $value the default value. + * @param string $attrib other attribs. + */ + static public function input($name, $value = "", $attrib = "") + { + return "\n"; + } + + /** + * create tags like "" + * + * @param string $name the name of the textarea tag. + * @param string $value the default value of the textarea tag. + * @param string $attrib other attribs. + */ + static public function textarea($name, $value = "", $attrib = "") + { + return "\n"; + } + + /** + * create tags like "". + * + * @param string $name the name of the file name. + * @param string $attrib other attribs. + */ + static public function file($name, $attrib = "") + { + return "\n"; + } + + /** + * create submit button. + * + * @static + * @access public + * @return string the submit button tag. + */ + public static function submitButton($label = '') + { + if(empty($label)) + { + global $lang; + $label = $lang->save; + } + return " "; + } + + /** + * create reset button. + * + * @static + * @access public + * @return string the reset button tag. + */ + public static function resetButton() + { + global $lang; + return " "; + } + + /** + * create common button. + * + * @static + * @access public + * @return string the reset button tag. + */ + public static function commonButton($label = '', $misc = '') + { + return " "; + } +} + +class js +{ + /* The start of javascript. */ + static private function start() + { + return << + + \n"; + } + + /* Show a alert box. */ + static public function alert($message = '') + { + return self::start() . "alert('" . $message . "')" . self::end(); + } + + /* 寮瑰嚭閿欒銆傚叾涓璵essage鍙互鏄竴鏉″瓧绗︿覆锛屼篃鍙互鏄竴缁存垨鑰呬簩缁存暟缁勩*/ + static public function error($message) + { + $alertMessage = ''; + if(is_array($message)) + { + foreach($message as $item) + { + is_array($item) ? $alertMessage .= join('\n', $item) . '\n' : $alertMessage .= $item . '\n'; + } + } + else + { + $alertMessage = $message; + } + return self::alert($alertMessage); + } + + /** + * show a confirm box, press ok go to okURL, else go to cancleURL. + * + * @param string $message the text to be showed. + * @param string $okURL the url to go to when press 'ok'. + * @param string $cancleURL the url to go to when press 'cancle'. + * @param string $okTarget the target to go to when press 'ok'. + * @param string $cancleTarget the target to go to when press 'cancle'. + */ + static public function confirm($message = '', $okURL = '', $cancleURL = '', $okTarget = "self", $cancleTarget = "self", $Echo = true) + { + $js = self::start(); + + $confirmAction = ''; + if(strtolower($okURL) == "back") + { + $confirmAction = "history.back(-1);"; + } + elseif(!empty($okURL)) + { + $confirmAction = "$okTarget.location = '$okURL';"; + } + + $cancleAction = ''; + if(strtolower($cancleURL) == "back") + { + $cancleAction = "history.back(-1);"; + } + elseif(!empty($cancleURL)) + { + $cancleAction = "$cancleTarget.location = '$cancleURL';"; + } + + $js .= <<getViewType(); + $js = << +function createLink(moduleName, methodName, vars, viewType) +{ + link = '$config->webRoot'; + requestType = '$config->requestType'; + pathType = '$config->pathType'; + requestFix = '$config->requestFix'; + moduleVar = '$config->moduleVar'; + methodVar = '$config->methodVar'; + viewVar = '$config->viewVar'; + viewType = viewType ? viewType : '$defaultViewType'; + + vars = vars.split('&'); + for(i = 0; i < vars.length; i ++) vars[i] = vars[i].split('='); + + if(requestType == 'PATH_INFO') + { + link += moduleName + requestFix + methodName; + + if(pathType == "full") + { + for(i = 0; i < vars.length; i ++) link += requestFix + vars[i][0] + requestFix + vars[i][1]; + } + else + { + for(i = 0; i < vars.length; i ++) link += requestFix + vars[i][1]; + } + link += '.' + viewType; + } + else + { + link += '?' + moduleVar + '=' + moduleName + '&' + methodVar + '=' + methodName + '&' + viewVar + '=' + viewType; + for(i = 0; i < vars.length; i ++) link += '&' + vars[i][0] + '=' + vars[i][1]; + } + return link; +} + +EOT; + return $js; + } +} diff --git a/lib/front/tests/html_checkbox.expect b/lib/front/tests/html_checkbox.expect new file mode 100644 index 0000000000..d7d9f7377b --- /dev/null +++ b/lib/front/tests/html_checkbox.expect @@ -0,0 +1,21 @@ +texta +textb +textc + +texta +textb +textc + +texta +textb +textc + +texta +textb +textc + +texta +textb +textc + +bool(false) diff --git a/lib/front/tests/html_checkbox.php b/lib/front/tests/html_checkbox.php new file mode 100644 index 0000000000..35abd61008 --- /dev/null +++ b/lib/front/tests/html_checkbox.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php + + * @version $Id: html_checkbox.php 1156 2009-04-24 08:53:44Z wwccss $ + */ +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/lib/front/tests/html_radio.expect b/lib/front/tests/html_radio.expect new file mode 100644 index 0000000000..6f4a26ff0f --- /dev/null +++ b/lib/front/tests/html_radio.expect @@ -0,0 +1,13 @@ +texta +textb +textc +texta +textb +textc +texta +textb +textc +texta +textb +textc +bool(false) diff --git a/lib/front/tests/html_radio.php b/lib/front/tests/html_radio.php new file mode 100644 index 0000000000..547998e3bb --- /dev/null +++ b/lib/front/tests/html_radio.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php + + * @version $Id: html_radio.php 1156 2009-04-24 08:53:44Z wwccss $ + */ +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/lib/front/tests/html_select.expect b/lib/front/tests/html_select.expect new file mode 100644 index 0000000000..a1ef188bb4 --- /dev/null +++ b/lib/front/tests/html_select.expect @@ -0,0 +1,31 @@ + + + + + + +bool(false) diff --git a/lib/front/tests/html_select.php b/lib/front/tests/html_select.php new file mode 100644 index 0000000000..16778fdbae --- /dev/null +++ b/lib/front/tests/html_select.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php + + * @version $Id: html_select.php 1156 2009-04-24 08:53:44Z wwccss $ + */ +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/module/action/model.php b/module/action/model.php new file mode 100644 index 0000000000..c70fda88be --- /dev/null +++ b/module/action/model.php @@ -0,0 +1,75 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package action + * @version $Id$ + * @link http://www.zentao.cn + */ +?> +app->company->id; + $actor = $this->app->user->account; + $actionDate = time(); + $sql = "INSERT INTO " . TABLE_ACTION . " VALUES('', '$companyID', '$objectType', '$objectID', '$actor', '$action', '$actionDate', '$comment')"; + $this->dbh->exec($sql); + return $this->dbh->lastInsertID(); + } + + /* 杩斿洖鏌愪竴涓璞$殑鎵鏈塧ction鍒楄〃銆*/ + public function getList($objectType, $objectID) + { + $actions = array(); + $sql = "SELECT * FROM " . TABLE_ACTION . " WHERE objectType = '$objectType' AND objectID = '$objectID' AND company = '{$this->app->company->id}' ORDER BY ID"; + $stmt = $this->dbh->query($sql); + while($action = $stmt->fetch()) + { + $action->date = date('Y-m-d H:i:s', $action->date); + $actions[$action->id] = $action; + } + + $histories = $this->getHistory(array_keys($actions)); + foreach($actions as $actionID => $action) + { + $action->history = isset($histories[$actionID]) ? $histories[$actionID] : array(); + $actions[$actionID] = $action; + } + return $actions; + } + + /* 杩斿洖鏌愪竴涓猘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(); + } + } +} diff --git a/module/admin/control.php b/module/admin/control.php new file mode 100644 index 0000000000..e575eac121 --- /dev/null +++ b/module/admin/control.php @@ -0,0 +1,99 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id: control.php 1280 2009-09-07 05:41:14Z wwccss $ + * @link http://www.zentao.cn + */ +class admin extends control +{ + /* 鏋勯犲嚱鏁帮紝鍔犺浇company, user, group妯″潡銆*/ + public function __construct() + { + parent::__construct(); + $this->loadModel('company'); + $this->loadModel('user'); + $this->loadModel('group'); + } + + /* 棣栭〉銆*/ + public function index($tab = 'index') + { + $header['title'] = $this->lang->admin->index; + $position[] = $header['title']; + $this->assign('header', $header); + $this->assign('position', $position); + $this->display(); + } + + /* 鍏徃鍒楄〃銆*/ + public function browseCompany() + { + $header['title'] = $this->lang->admin->common . $this->lang->colon . $this->lang->company->browse; + $position[] = $this->lang->admin->company; + $position[] = $this->lang->company->browse; + + $companies = $this->company->getList(); + + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('companies', $companies); + + $this->display(); + } + + /* 鐢ㄦ埛鍒楄〃銆*/ + public function browseUser($companyID = 0) + { + if($companyID == 0) $companyID = $this->app->company->id; + + $header['title'] = $this->lang->admin->common . $this->lang->colon . $this->lang->user->browse; + $position[] = $this->lang->admin->user; + $position[] = $this->lang->user->browse; + + $users = $this->user->getList($companyID); + + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('users', $users); + + $this->display(); + } + + /* 鍒嗙粍鍒楄〃銆*/ + public function browseGroup($companyID = 0) + { + if($companyID == 0) $companyID = $this->app->company->id; + + $header['title'] = $this->lang->admin->common . $this->lang->colon . $this->lang->group->browse; + $position[] = $this->lang->admin->user; + $position[] = $this->lang->group->browse; + + $groups = $this->group->getList($companyID); + $groupUsers = array(); + foreach($groups as $group) $groupUsers[$group->id] = $this->group->getUserPairs($group->id); + + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('groups', $groups); + $this->assign('groupUsers', $groupUsers); + + $this->display(); + } +} diff --git a/module/admin/lang/zh-cn.php b/module/admin/lang/zh-cn.php new file mode 100644 index 0000000000..afb7577f16 --- /dev/null +++ b/module/admin/lang/zh-cn.php @@ -0,0 +1,33 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id: zh-cn.php 1363 2009-09-29 01:19:26Z wwccss $ + * @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 = '娴忚鍒嗙粍'; diff --git a/module/admin/model.php b/module/admin/model.php new file mode 100644 index 0000000000..86e76ca350 --- /dev/null +++ b/module/admin/model.php @@ -0,0 +1,44 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id: model.php 1270 2009-09-05 02:40:22Z wwccss $ + * @link http://www.zentao.cn + */ +?> +dbh->query($sql)->fetchALL(); + } + + /* 鑾峰緱鏌愪竴涓叕鍙哥殑缁熻淇℃伅銆*/ + public function getStatOfCompany($companyID) + { + } + + /* 鑾峰緱绯荤粺鐨勮繍琛屼俊鎭*/ + public function getStatOfSys() + { + } +} diff --git a/module/admin/view/browsecompany.html.php b/module/admin/view/browsecompany.html.php new file mode 100644 index 0000000000..2affb89c0f --- /dev/null +++ b/module/admin/view/browsecompany.html.php @@ -0,0 +1,69 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id: browsecompany.html.php 1270 2009-09-05 02:40:22Z wwccss $ + * @link http://www.zentao.cn + */ +?> + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
company->browse;?>
company->id;?>company->name;?>company->phone;?>company->fax;?>company->address;?>company->zipcode;?>company->website;?>company->backyard;?>company->pms;?>company->guest;?>action;?>
id;?>name;?>phone;?>fax;?>address;?>zipcode;?>website, $company->website, '_blank');?>backyard,$company->backyard, '_blank');?>pms, $company->pms, '_blank');?>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/module/admin/view/browsegroup.html.php b/module/admin/view/browsegroup.html.php new file mode 100644 index 0000000000..e26417cac9 --- /dev/null +++ b/module/admin/view/browsegroup.html.php @@ -0,0 +1,67 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id$ + * @link http://www.zentao.cn + */ +?> + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
group->browse;?>
group->id;?>group->name;?>group->desc;?>group->users;?>action;?>
id;?>name;?>desc;?> + id] as $user) + { + echo $user . ' '; + } + ?> + + createLink('group', 'edit', "groupID=$group->id"), $lang->group->edit);?> + createLink('group', 'managepriv', "groupID=$group->id"), $lang->group->managePriv);?> + createLink('group', 'managemember', "groupID=$group->id"), $lang->group->manageMember);?> + createLink('group', 'delete', "groupID=$group->id"), $lang->group->delete, "hiddenwin");?> +
+
createLink('group', 'create'), $lang->group->create);?>
+
+
+
+ diff --git a/module/admin/view/browseuser.html.php b/module/admin/view/browseuser.html.php new file mode 100644 index 0000000000..ed9bba7087 --- /dev/null +++ b/module/admin/view/browseuser.html.php @@ -0,0 +1,72 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id: browseuser.html.php 1270 2009-09-05 02:40:22Z wwccss $ + * @link http://www.zentao.cn + */ +?> + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
user->browse;?>
user->id;?>user->account;?>user->realname;?>user->nickname;?>user->email;?>user->gendar;?>user->phone;?>user->join;?>user->visits;?>action;?>
id;?>realname;?>createLink('user', 'view', "account=$user->account"), $user->account); else echo $user->account;?>nickname;?>email);?>user->gendarList->{$user->gendar})) echo $lang->user->gendarList->{$user->gendar};?>phone;?>join;?>visits;?> + createLink('user', 'edit', "userID=$user->id&from=company"), $lang->user->edit);?> + createLink('user', 'delete', "userID=$user->id"), $lang->user->delete, "hiddenwin");?> +
+
createLink('user', 'create'), $lang->user->create);?>
+
+
+
+ diff --git a/module/admin/view/index.html.php b/module/admin/view/index.html.php new file mode 100644 index 0000000000..c2c2f8f633 --- /dev/null +++ b/module/admin/view/index.html.php @@ -0,0 +1,41 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package admin + * @version $Id: index.html.php 1270 2009-09-05 02:40:22Z wwccss $ + * @link http://www.zentao.cn + */ +?> + +
+
+ +
+
+
+ + + + + +
admin->welcome;?>
admin->welcome;?>
+
+
+
+ diff --git a/module/admin/view/menu.html.php b/module/admin/view/menu.html.php new file mode 100644 index 0000000000..c42ff8837e --- /dev/null +++ b/module/admin/view/menu.html.php @@ -0,0 +1,29 @@ +company->id}";?> + + + + + +
admin->company;?>
+ createLink('admin', 'browsecompany'), $lang->company->browse);?>
+ createLink('company', 'create'), $lang->company->create);?>
+ createLink('company', 'edit', $companyVar ), $lang->company->edit);?>
+
+ + + + + +
admin->user;?>
+ createLink('admin', 'browseuser', $companyVar), $lang->user->browse);?>
+ createLink('user', 'create', $companyVar), $lang->user->create);?>
+
+ + + + +
admin->group;?>
+ createLink('admin', 'browsegroup', $companyVar), $lang->group->browse);?>
+ createLink('group', 'create', $companyVar), $lang->group->create);?>
+
+ diff --git a/module/bug/control.php b/module/bug/control.php new file mode 100644 index 0000000000..98817265c6 --- /dev/null +++ b/module/bug/control.php @@ -0,0 +1,193 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: control.php 1459 2009-10-23 05:50:21Z wwccss $ + * @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->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, $type = 'byModule', $param = 0) + { + $productID = common::saveProductState($productID, key($this->products)); + $currentModuleID = ($type == 'byModule') ? (int)$param : 0; + if($currentModuleID == 0) + { + $currentModuleName = $this->lang->bug->allBugs; + } + else + { + $currentModule = $this->tree->getById($currentModuleID); + $currentModuleName = sprintf($this->lang->bug->moduleBugs, $currentModule->name); + } + + if($type == "byModule") + { + $childModuleIds = $this->tree->getAllChildId($currentModuleID); + $bugs = $this->bug->getModuleBugs($productID, $childModuleIds); + } + + $users = array('' => '', 'Closed' => 'Closed') + $this->user->getRealNames($this->bug->extractAccountsFromList($bugs)); + + $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('type', $type); + $this->assign('bugs', $bugs); + $this->assign('users', $users); + $this->assign('currentModuleID', $currentModuleID); + $this->assign('currentModuleName', $currentModuleName); + + $this->display(); + } + + /* 鍒涘缓Bug銆*/ + public function create($productID, $moduleID = 0) + { + if(!empty($_POST)) + { + $_POST['severity'] = str_replace('item', '', $_POST['severity']); + $bugID = $this->bug->create(); + $this->action->create('bug', $bugID, 'Opened'); + die(js::locate($this->createLink('bug', 'browse', "productID=$_POST[productID]&type=byModule¶m=$_POST[moduleID]"), 'parent')); + } + + if(empty($this->products)) $this->locate($this->createLink('product', 'create')); + + $productID = (int)$productID; + if($productID == 0) $productID = key($this->products); + $currentModuleID = (int)$moduleID; + + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->create; + $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $position[] = $this->lang->bug->create; + + $users = array('' => '') + $this->user->getPairs($this->app->company->id); + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('productID', $productID); + $this->assign('productName', $this->products[$productID]); + $this->assign('moduleOptionMenu', $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0)); + $this->assign('currentModuleID', $currentModuleID); + $this->assign('users', $users); + + $this->display(); + } + + /* 鏌ョ湅涓涓猙ug銆*/ + public function view($bugID) + { + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + $productName = $this->products[$productID]; + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->view; + $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName); + $position[] = $this->lang->bug->view; + + $users = array('' => '') + $this->user->getRealNames($this->bug->extractAccountsFromSingle($bug)); + $actions = $this->action->getList('bug', $bugID); + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('productName', $productName); + $this->assign('modulePath', $this->tree->getParents($bug->module)); + $this->assign('bug', $bug); + $this->assign('users', $users); + $this->assign('actions', $actions); + + $this->display(); + } + + /* 缂栬緫涓涓狟ug銆*/ + public function edit($bugID) + { + /* 鏇存柊bug淇℃伅銆*/ + if(!empty($_POST)) + { + $changes = $this->bug->update($bugID); + $actionID = $this->action->create('bug', $bugID, 'Edited', $_POST['comment']); + $this->action->logHistory($actionID, $changes); + die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + } + + /* 鐢熸垚琛ㄥ崟銆*/ + $bug = $this->bug->getById($bugID); + $productID = $bug->product; + $currentModuleID = $bug->module; + $header['title'] = $this->products[$productID] . $this->lang->colon . $this->lang->bug->edit; + $position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); + $position[] = $this->lang->bug->edit; + + $users = array('' => '') + $this->user->getPairs($this->app->company->id); + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('productID', $productID); + $this->assign('productName', $this->products[$productID]); + $this->assign('moduleOptionMenu', $this->tree->getOptionMenu($productID, $viewType = 'bug', $rooteModuleID = 0)); + $this->assign('currentModuleID', $currentModuleID); + $this->assign('users', $users); + + $this->assign('header', $header); + $this->assign('position', $position); + $this->assign('bug', $bug); + + $this->display(); + } + + public function delete($id) + { + $header['title'] = $this->lang->page->delete; + $this->assign('header', $header); + $this->display(); + } + + public function ajaxGetUserBugs($account = '') + { + if($account == '') $account = $this->app->user->account; + $bugs = $this->bug->getUserBugPairs($account); + die(html::select('bug', $bugs, '', 'class=select-1')); + } +} diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php new file mode 100644 index 0000000000..186090ed73 --- /dev/null +++ b/module/bug/lang/en.php @@ -0,0 +1,63 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: en.php 1145 2009-04-02 11:21:58Z wwccss $ + * @link http://www.zentao.cn + */ +$lang['page']['common'] = 'bug'; +$lang['page']['index'] = "{$lang['page']['common']}/index"; +$lang['page']['create'] = "{$lang['page']['common']}/create"; +$lang['page']['read'] = "{$lang['page']['common']}/read"; +$lang['page']['update'] = "{$lang['page']['common']}/update"; +$lang['page']['delete'] = "{$lang['page']['common']}/delete"; +$lang['bug']['id'] = 'id'; +$lang['bug']['product'] = 'product'; +$lang['bug']['module'] = 'module'; +$lang['bug']['path'] = 'path'; +$lang['bug']['project'] = 'project'; +$lang['bug']['sprint'] = 'sprint'; +$lang['bug']['story'] = 'story'; +$lang['bug']['task'] = 'task'; +$lang['bug']['title'] = 'title'; +$lang['bug']['severity'] = 'severity'; +$lang['bug']['type'] = 'type'; +$lang['bug']['os'] = 'os'; +$lang['bug']['browser'] = 'browser'; +$lang['bug']['machine'] = 'machine'; +$lang['bug']['found'] = 'found'; +$lang['bug']['steps'] = 'steps'; +$lang['bug']['status'] = 'status'; +$lang['bug']['mailto'] = 'mailto'; +$lang['bug']['openedBy'] = 'openedBy'; +$lang['bug']['openedDate'] = 'openedDate'; +$lang['bug']['openedBuild'] = 'openedBuild'; +$lang['bug']['assignedTo'] = 'assignedTo'; +$lang['bug']['assignedDate'] = 'assignedDate'; +$lang['bug']['resolvedBy'] = 'resolvedBy'; +$lang['bug']['resolution'] = 'resolution'; +$lang['bug']['resolvedBuild'] = 'resolvedBuild'; +$lang['bug']['resolvedDate'] = 'resolvedDate'; +$lang['bug']['closedBy'] = 'closedBy'; +$lang['bug']['closedDate'] = 'closedDate'; +$lang['bug']['lastEditedBy'] = 'lastEditedBy'; +$lang['bug']['lastEditedDate'] = 'lastEditedDate'; +$lang['bug']['field1'] = 'field1'; +$lang['bug']['field2'] = 'field2'; +$lang['bug']['feild3'] = 'feild3'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php new file mode 100644 index 0000000000..52eaf24867 --- /dev/null +++ b/module/bug/lang/zh-cn.php @@ -0,0 +1,151 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: zh-cn.php 1406 2009-10-12 07:49:52Z wwccss $ + * @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 = 'ajax:鎴戠殑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 = '%s'; + +$lang->bug->labProductAndModule = '鎵灞炰骇鍝::妯″潡'; +$lang->bug->labProjectAndTask = '鐩稿叧椤圭洰::浠诲姟'; +$lang->bug->labStory = '鐩稿叧闇姹'; +$lang->bug->labBuild = '绋嬪簭缂栬瘧鐗堟湰'; +$lang->bug->labTypeAndSeverity = '绫诲瀷::涓ラ噸绋嬪害'; +$lang->bug->labSystemBrowserAndHardware = '绯荤粺::娴忚鍣'; +$lang->bug->labAssignAndMail = '鎸囨淳缁::鎶勯佺粰'; + +$lang->bug->legendRelated = '鐩稿叧淇℃伅'; +$lang->bug->legendBasicInfo = '鍩烘湰淇℃伅'; +$lang->bug->legendMailto = '鎶勯佺粰'; +$lang->bug->legendAttatch = '闄勪欢'; +$lang->bug->legendLinkBugs = '鐩稿叧Bug'; +$lang->bug->legendOpenInfo = '鍒涘缓淇℃伅'; +$lang->bug->legendResolveInfo = '瑙e喅淇℃伅'; +$lang->bug->legendCloseInfo = '鍏抽棴淇℃伅'; +$lang->bug->legendStoryAndTask= '闇姹::浠诲姟'; +$lang->bug->legendCases = '鐩稿叧鐢ㄤ緥'; +$lang->bug->legendSteps = '閲嶇幇姝ラ'; +$lang->bug->legendAction = '鎿嶄綔'; +$lang->bug->legendHistory = '鍘嗗彶璁板綍'; +$lang->bug->legendComment = '澶囨敞'; + +$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->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 = '鍏朵粬'; + +/* Define the types. */ +$lang->bug->typeList->codeerror = '浠g爜閿欒'; +$lang->bug->typeList->interface = '鐣岄潰浼樺寲'; +$lang->bug->typeList->designchange = '璁捐鍙樻洿'; +$lang->bug->typeList->Others = '鍏朵粬'; + +$lang->bug->statusList->active = 'active'; +$lang->bug->statusList->resolved = 'resolved'; +$lang->bug->statusList->closed = 'closed'; + +$lang->bug->resolutionList->bydesign = 'By Design'; +$lang->bug->resolutionList->duplicate = 'Duplicate'; +$lang->bug->resolutionList->external = 'External'; +$lang->bug->resolutionList->fixed = 'Fixed'; +$lang->bug->resolutionList->notrepro = 'Not Repro'; +$lang->bug->resolutionList->postponed = 'Postponed'; +$lang->bug->resolutionList->willnotfix = "Won not Fix"; + +$lang->bug->id = 'Bug缂栧彿'; +$lang->bug->product = '鎵灞炰骇鍝'; +$lang->bug->module = '鎵灞炴ā鍧'; +$lang->bug->path = '妯″潡璺緞'; +$lang->bug->project = '鎵灞為」鐩'; +$lang->bug->story = '鐩稿叧闇姹'; +$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 = '鍒涘缓Build'; +$lang->bug->assignedTo = '鎸囨淳缁'; +$lang->bug->assignedDate = '鎸囨淳鏃ユ湡'; +$lang->bug->resolvedBy = '瑙e喅鑰'; +$lang->bug->resolution = '瑙e喅鏂规'; +$lang->bug->resolvedBuild = '瑙e喅Build'; +$lang->bug->resolvedDate = '瑙e喅鏃ユ湡'; +$lang->bug->closedBy = '鐢辫皝鍏抽棴'; +$lang->bug->closedDate = '鍏抽棴鏃ユ湡'; +$lang->bug->lastEditedBy = '鏈鍚庝慨鏀硅'; +$lang->bug->lastEditedDate = '鏈鍚庝慨鏀规棩鏈'; +$lang->bug->files = '闄勪欢'; +$lang->bug->field1 = 'field1'; +$lang->bug->field2 = 'field2'; +$lang->bug->feild3 = 'feild3'; diff --git a/module/bug/model.php b/module/bug/model.php new file mode 100644 index 0000000000..1bd0527bdb --- /dev/null +++ b/module/bug/model.php @@ -0,0 +1,161 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: model.php 1455 2009-10-23 01:56:37Z wwccss $ + * @link http://www.zentao.cn + */ +?> +app->user->account; + $openedDate = time(); + $assignedDate = !empty($assignedTo) ? time() : 0; + $sql = "INSERT INTO " . TABLE_BUG . " (product, module, type, severity, os, browser, assignedTo, assignedDate, mailTo, title, steps, openedBy, openedDate) + VALUES('$productID', '$moduleID', '$type', '$severity', '$os', '$browser', '$assignedTo', '$assignedDate', '$mailTo', '$title', '$steps', '$openedBy', '$openedDate' )"; + $this->dbh->exec($sql); + return $this->dbh->lastInsertID(); + } + + /* 鑾峰緱鏌愪竴涓骇鍝侊紝鏌愪竴涓ā鍧椾笅闈㈢殑鎵鏈塨ug銆*/ + public function getModuleBugs($productID, $moduleIds = 0) + { + $where = " WHERE `product` = '$productID'"; + $where .= !empty($moduleIds) ? " AND module " . helper::dbIN($moduleIds) : ''; + $sql = "SELECT * FROM " . TABLE_BUG . $where . " ORDER BY id DESC"; + $stmt = $this->dbh->query($sql); + return $stmt->fetchAll(); + } + + /* 鑾峰彇涓涓猙ug鐨勮缁嗕俊鎭*/ + public function getById($bugID) + { + $bug = $this->dbh->query("SELECT * FROM " . TABLE_BUG . " WHERE id = '$bugID'")->fetch(); + foreach($bug as $key => $value) + { + if(strpos($key, 'Date') !== false) + { + if(empty($value)) + { + $bug->$key = ''; + } + else + { + $bug->$key = date('Y-m-d H:i:s', $value); + } + } + } + return $bug; + } + + /* 鏇存柊bug淇℃伅銆*/ + public function update($bugID) + { + $bug = $this->getById($bugID); + $changes = array(); + foreach($_POST as $key => $value) + { + if($key == 'comment') continue; + if(strpos($key, 'Date') !== false) $_POST[$key] = strtotime($value); + if($key == 'severity') $value = str_replace('item', '', $value); + if($value != $bug->$key) + { + $change['field'] = $key; + $change['old'] = $bug->$key; + $change['new'] = $value; + $changes[] = $change; + } + } + extract($_POST); + $now = time(); + $severity = str_replace('item', '', $severity); + $lastEditedDate = $now; + $assignedDate = $bug->assignedDate; + + if($assignedTo != $bug->assignedTo) $assignedDate = $now; + if($resolution != '' and empty($resolvedDate)) $resolvedDate = $now; + if($closedBy != '' and empty($closedDate)) $closedDate = $now; + + $sql = "UPDATE " . TABLE_BUG . " SET + title = '$title', product='$product', module = '$module', + type='$type', severity = '$severity', os = '$os', status = '$status', + assignedTo='$assignedTo', assignedDate = '$assignedDate', resolvedBy = '$resolvedBy', resolvedDate = '$resolvedDate', resolution='$resolution', + closedBy = '$closedBy', closedDate = '$closedDate', steps = '$steps', + lastEditedBy = '{$this->app->user->account}', lastEditedDate = '$lastEditedDate' + WHERE id ='$bugID' LIMIT 1 "; + $this->dbh->exec($sql); + return $changes; + } + + /* 浠巄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) + ->query(); + while($bug = $stmt->fetch()) + { + $bug->title = $bug->product . ' / ' . $bug->title; + $bugs[$bug->id] = $bug->title; + } + return $bugs; + } +} diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php new file mode 100644 index 0000000000..2080bcf746 --- /dev/null +++ b/module/bug/view/browse.html.php @@ -0,0 +1,105 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: browse.html.php 1369 2009-09-29 05:41:15Z wwccss $ + * @link http://www.zentao.cn + */ +?> + + + + +
+
+ + + + + +
+ bug->selectProduct;?> + +
+
+
+ createLink('bug', 'browse', "productID=$productID"), $lang->bug->allBugs);?> + createLink('tree', 'browse', "productID=$productID&view=bug"), $lang->tree->manageBug);?> +
+
+
+
+
+
+
    + $productName"; + echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=byModule¶m=$currentModuleID"), $currentModuleName) . "
  • "; + //echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToMe"), $lang->bug->assignToMe) . "
  • "; + //echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=openedByMe"), $lang->bug->openedByMe) . "
  • "; + //echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=resolvedByMe"), $lang->bug->resolvedByMe) . "
  • "; + //echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=assignToNull"), $lang->bug->assignToNull) . "
  • "; + //echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=longLifeBugs"), $lang->bug->longLifeBugs) . "
  • "; + //echo "
  • " . html::a($this->createLink('bug', 'browse', "productid=$productID&type=postponedBugs"), $lang->bug->postponedBugs) . "
  • "; + echo << +$("#{$type}Tab").addClass('active'); + +EOT; + ?> +
+ ' . html::a($this->createLink('bug', 'create', "productID=$productID&moduleID=$currentModuleID"), $lang->bug->create) . '
';?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->id;?>bug->severity;?>bug->title;?>bug->openedBy;?>bug->assignedTo;?>bug->resolvedBy;?>bug->resolution;?>
createLink('bug', 'view', "bugID=$bug->id"), $bug->id);?>severity?>title;?>openedBy];?>assignedTo];?>resolvedBy];?>resolution;?>
+
+
+ + diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php new file mode 100644 index 0000000000..6c5c6b2743 --- /dev/null +++ b/module/bug/view/create.html.php @@ -0,0 +1,98 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: create.html.php 1359 2009-09-28 01:52:20Z wwccss $ + * @link http://www.zentao.cn + */ +?> + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->create;?>
bug->labProductAndModule;?> + + +
bug->labTypeAndSeverity;?> + bug->typeList, '', 'class=select-2');?> + bug->severityList, '', 'class=select-2');?> +
bug->labSystemBrowserAndHardware;?> + bug->osList, '', 'class=select-2');?> + bug->browserList, '', 'class=select-2');?> +
bug->labAssignAndMail;?> + + +
bug->title;?>
bug->steps;?>
+ +
+
+
+ diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php new file mode 100644 index 0000000000..1e5dd0434f --- /dev/null +++ b/module/bug/view/edit.html.php @@ -0,0 +1,215 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id$ + * @link http://www.zentao.cn + */ +?> + + +
+
+
+
+ BUG #id . $lang->colon;?> + title, 'class=text-1');?> +
+
+
+
+ +
+
+ +
+
+ bug->legendBasicInfo;?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->labProductAndModule;?> + + +
bug->type;?>bug->typeList, $bug->type, 'class=select-2');?> +
bug->severity;?>bug->severityList, $bug->severity, 'class=select-2');?> +
bug->os;?>bug->osList, $bug->os, 'class=select-2');?>
bug->status;?>bug->statusList, $bug->status, 'class=select-2');?>
bug->assignedTo;?>assignedTo, 'class=select-2');?>
bug->assignedDate;?>assignedDate;?>
bug->lastEditedBy;?>lastEditedBy;?>
bug->lastEditedDate;?>lastEditedDate;?>
+
+ +
+ bug->legendStoryAndTask;?> + + + + + + + + + +
bug->story;?>
bug->task;?>
+
+ +
+ bug->legendMailto;?> +
 
+
+ +
+ bug->legendAttatch;?> +
 
+
+ +
+ +
+
+ bug->legendOpenInfo;?> + + + + + + + + + + + + + +
bug->openedBy;?>openedBy];?>
bug->openedDate;?>openedDate;?>
bug->openedBuild;?>openedBuild, 'class=text-2');?>
+
+ +
+ bug->legendResolveInfo;?> + + + + + + + + + + + + + + + + + +
bug->resolvedBy;?>resolvedBy, 'class=select-2');?>
bug->resolvedDate;?>resolvedDate, 'class=text-2');?>
bug->resolvedBuild;?>resolvedBuild, 'class=text-2');?>
bug->resolution;?> '') + (array)$lang->bug->resolutionList, $bug->resolution, 'class=select-2');?>
+
+ +
+ bug->legendCloseInfo;?> + + + + + + + + + +
bug->closedBy;?>closedBy, 'class=select-2');?>
bug->closedDate;?>closedDate, 'class=text-2');?>
+
+ +
+ bug->legendLinkBugs;?> +
 
+
+ +
+ bug->legendCases;?> +
 
+
+ +
+
+
+ +
+
+ bug->legendComment;?> + + + + + +
+ + "' /> +
+
+ +
+ bug->legendSteps;?> + + + + + +
+
+
+ diff --git a/module/bug/view/index.html.php b/module/bug/view/index.html.php new file mode 100644 index 0000000000..a8bcae58c1 --- /dev/null +++ b/module/bug/view/index.html.php @@ -0,0 +1,28 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: index.html.php 1159 2009-04-26 13:53:11Z wwccss $ + * @link http://www.zentao.cn + */ +?> + +
+
+ \ No newline at end of file diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php new file mode 100644 index 0000000000..5f6cd60e66 --- /dev/null +++ b/module/bug/view/view.html.php @@ -0,0 +1,233 @@ +. + * + * @copyright Copyright: 2009 Chunsheng Wang + * @author Chunsheng Wang + * @package bug + * @version $Id: view.html.php 1314 2009-09-14 06:09:08Z wwccss $ + * @link http://www.zentao.cn + */ +?> + + +
+
+
BUG #id . $lang->colon . $bug->title;?>
+
+ createLink('bug', 'edit', "bugID=$bug->id"), $lang->bug->buttonEdit); + //echo html::a($this->createLink('bug', 'resolve', "bugID=$bug->id"), $lang->bug->buttonResolve); + //echo html::a($this->createLink('bug', 'close', "bugID=$bug->id"), $lang->bug->buttonClose); + //echo html::a($this->createLink('bug', 'activate', "bugID=$bug->id"), $lang->bug->buttonActivate); + echo html::a($this->createLink('bug', 'browse', "productID=$bug->product"), $lang->bug->buttonToList); + ?> +
+
+
+ +
+
+ +
+
+ bug->legendBasicInfo;?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bug->labProductAndModule;?> + arrow; + foreach($modulePath as $key => $module) + { + echo $module->name; + if(isset($modulePath[$key + 1])) echo $lang->arrow; + } + ?> +
bug->type;?>bug->typeList->{$bug->type};?>
bug->os;?>bug->osList->{$bug->os};?>
bug->severity;?>severity;?>
bug->status;?>status;?>
bug->assignedTo;?>assignedTo];?>
bug->assignedDate;?>assignedDate;?>
bug->lastEditedBy;?>lastEditedBy];?>
bug->lastEditedDate;?>lastEditedDate;?>
+
+ +
+ bug->legendStoryAndTask;?> + + + + + + + + + +
bug->story;?>story;?>
bug->task;?>task;?>
+
+ +
+ bug->legendMailto;?> +
+
+ +
+ bug->legendAttatch;?> +
 
+
+ +
+ +
+
+ bug->legendOpenInfo;?> + + + + + + + + + + + + + +
bug->openedBy;?>openedBy];?>
bug->openedDate;?>openedDate;?>
bug->openedBuild;?>openedBuild;?>
+
+ +
+ bug->legendResolveInfo;?> + + + + + + + + + + + + + + + + + +
bug->resolvedBy;?>resolvedBy];?>
bug->resolvedDate;?>resolvedDate;?>
bug->resolvedBuild;?>resolvedBuild;?>
bug->resolution;?>resolution)) echo $lang->bug->resolutionList->{$bug->resolution};?>
+
+ +
+ bug->legendCloseInfo;?> + + + + + + + + + +
bug->closedBy;?>closedBy];?>
bug->closedDate;?>closedDate;?>
+
+ +
+ bug->legendLinkBugs;?> +
 
+
+ +
+ bug->legendCases;?> +
 
+
+ +
+
+
+ +
+
+ bug->legendAction;?> +
+ createLink('bug', 'edit', "bugID=$bug->id"), $lang->bug->buttonEdit); + //echo html::a($this->createLink('bug', 'resolve', "bugID=$bug->id"), $lang->bug->buttonResolve); + //echo html::a($this->createLink('bug', 'close', "bugID=$bug->id"), $lang->bug->buttonClose); + //echo html::a($this->createLink('bug', 'activate', "bugID=$bug->id"), $lang->bug->buttonActivate); + echo html::a($this->createLink('bug', 'browse', "productID=$bug->product"), $lang->bug->buttonToList); + ?> +
+
+
+ bug->legendSteps;?> +
steps);?>
+
+
+ bug->legendHistory;?> +
    + +
  1. + date, $action->action BY $action->actor"; ?> + comment) or !empty($action->history)):?> +
    + history as $history) + { + echo "CHANGE $history->field FROM '$history->old' TO '$history->new' .
    "; + } + echo nl2br($action->comment); + ?> +
    + +
  2. + +
+
+ +
+ diff --git a/module/common/action.html.php b/module/common/action.html.php new file mode 100644 index 0000000000..1340211490 --- /dev/null +++ b/module/common/action.html.php @@ -0,0 +1,28 @@ +
+ history;?> +
    + +
  1. + date, $action->action by $action->actor"; ?> + comment) or !empty($action->history)):?> +
    + history as $history) + { + if($history->diff != '') + { + echo "CHANGE $history->field, the diff is:
    " . nl2br($history->diff) . "
    "; + } + else + { + echo "CHANGE $history->field FROM '$history->old' TO '$history->new' .
    "; + } + } + echo nl2br($action->comment); + ?> +
    + +
  2. + +
+
diff --git a/module/common/control.php b/module/common/control.php new file mode 100644 index 0000000000..c1fc312cf2 --- /dev/null +++ b/module/common/control.php @@ -0,0 +1,208 @@ +. + * + * @copyright Copyright: 2009 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; + } + + if(isset($this->app->user)) + { + if(!common::hasPriv($module, $method)) + { + $referer = helper::safe64Encode($_SERVER['HTTP_REFERER']); + $denyLink = $this->createLink('user', 'deny', "module=$module&method=$method&referer=$referer"); + + /* Fix the bug of IE: use js locate, can't get the referer. */ + if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) + { + echo <<