From df765447e5b5f2a9c0a4d5be172124b038c1f202 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 9 Nov 2016 09:33:06 +0800 Subject: [PATCH 1/3] * adjust for doc. --- module/doc/control.php | 33 +++++++++++++++++++++++---- module/doc/css/index.css | 4 ++-- module/doc/lang/en.php | 3 +++ module/doc/lang/zh-cn.php | 3 +++ module/doc/model.php | 5 ++-- module/doc/view/alllibs.html.php | 3 +-- module/doc/view/browse.html.php | 2 +- module/doc/view/browsebymenu.html.php | 2 +- module/doc/view/browsebytree.html.php | 4 ++-- module/doc/view/diff.html.php | 1 - module/doc/view/edit.html.php | 1 - module/doc/view/footer.html.php | 2 +- module/doc/view/index.html.php | 7 +++--- module/doc/view/objectlibs.html.php | 1 - module/doc/view/showfiles.html.php | 4 ++-- module/doc/view/view.html.php | 1 - module/product/model.php | 3 ++- module/project/model.php | 2 +- module/tree/view/browse.html.php | 3 ++- module/tree/view/browsetask.html.php | 3 ++- module/upgrade/model.php | 5 ++-- 21 files changed, 61 insertions(+), 31 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 77f2d56096..0ff5dfc3aa 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -128,6 +128,7 @@ class doc extends control $pager = new pager($recTotal, $recPerPage, $pageID); /* Append id for secend sort. */ + if($browseType == 'bymenu' and strtolower($orderBy) != 'editeddate_desc' and strtolower($orderBy) != 'addeddate_desc') $orderBy = 'title_asc'; $sort = $this->loadModel('common')->appendOrder($orderBy); /* Get docs by browse type. */ @@ -145,7 +146,7 @@ class doc extends control if($this->cookie->browseType == 'bymenu') { - $this->view->modules = $this->doc->getDocMenu($libID, $moduleID); + $this->view->modules = $this->doc->getDocMenu($libID, $moduleID, $orderBy == 'title_asc' ? 'name_asc' : 'id_desc'); $this->view->parents = $this->loadModel('tree')->getParents($moduleID); } elseif($this->cookie->browseType == 'bytree') @@ -704,23 +705,47 @@ class doc extends control * @access public * @return void */ - public function showFiles($type, $objectID) + public function showFiles($type, $objectID, $recTotal = 0, $recPerPage = 20, $pageID = 1) { $uri = $this->app->getURI(true); $this->app->session->set('taskList', $uri); $this->app->session->set('storyList', $uri); $this->app->session->set('docList', $uri); + /* According the from, set menus. */ + if($this->from == 'product') + { + $this->lang->doc->menu = $this->lang->product->menu; + $this->lang->doc->menuOrder = $this->lang->product->menuOrder; + $this->product->setMenu($this->product->getPairs(), $objectID); + $this->lang->set('menugroup.doc', 'product'); + } + elseif($this->from == 'project') + { + $this->lang->doc->menu = $this->lang->project->menu; + $this->lang->doc->menuOrder = $this->lang->project->menuOrder; + $this->project->setMenu($this->project->getPairs('nocode'), $objectID); + $this->lang->set('menugroup.doc', 'project'); + } + else + { + $this->doc->setMenu(array($this->lang->doclib->files), 0, $type); + } + + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); + $table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT; $object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch(); - $this->doc->setMenu(array($this->lang->doclib->files), 0, $type); $this->view->title = $object->name; $this->view->position[] = $object->name; $this->view->type = $type; $this->view->object = $object; - $this->view->files = $this->doc->getLibFiles($type, $objectID); + $this->view->files = $this->doc->getLibFiles($type, $objectID, $pager); + $this->view->pager = $pager; $this->display(); } diff --git a/module/doc/css/index.css b/module/doc/css/index.css index 674e43389d..3c30337744 100644 --- a/module/doc/css/index.css +++ b/module/doc/css/index.css @@ -2,9 +2,9 @@ .lib-more a.more{font-weight:bold; display:block;} #libs .libs-group-heading{border:1px solid #ddd;} #libs .libs-group{border:1px solid #ddd; border-top:0px; margin-bottom:20px;} -#libs .libs-group.lib-more{border:0px; text-align:center; height:128px; line-height:110px;} +#libs .libs-group.lib-more{border:0px; text-align:center; height:120px; line-height:110px;} #libs .libs-group.lib-more:hover{background-color: #EBF2F9} -#libs .libs-custom-heading{text-align:left; height:128px;} +#libs .libs-custom-heading{text-align:center; height:120px; line-height:110px;} #libs .libs-custom-heading:hover{background-color: #EBF2F9} #libs .libs-custom-heading a{display:block;height:100%;} #libs hr {margin-top:0px;} diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 9e05b61d54..6b88812422 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -115,3 +115,6 @@ $lang->doclib->user = 'User'; $lang->doclib->files = 'Files'; $lang->doclib->all = 'All Libraries'; $lang->doclib->select = 'Select Library'; + +$lang->doclib->main['product'] = $lang->productCommon . ' Library'; +$lang->doclib->main['project'] = $lang->projectCommon . ' Library'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index fdfbd2ccb7..13e9dd7626 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -115,3 +115,6 @@ $lang->doclib->user = '用户'; $lang->doclib->files = '附件库'; $lang->doclib->all = '所有文档库'; $lang->doclib->select = '选择文档库'; + +$lang->doclib->main['product'] = $lang->productCommon . '库'; +$lang->doclib->main['project'] = $lang->projectCommon . '库'; diff --git a/module/doc/model.php b/module/doc/model.php index 5f3e9975ac..7434738de9 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -531,13 +531,14 @@ class docModel extends model * @param int $libID * @param int $parent * @access public - * @return void + * @return array */ - public function getDocMenu($libID, $parent) + public function getDocMenu($libID, $parent, $orderBy = 'name_asc') { return $this->dao->select('*')->from(TABLE_MODULE)->where('root')->eq($libID) ->andWhere('type')->eq('doc') ->andWhere('parent')->eq($parent) + ->orderBy($orderBy) ->fetchAll('id'); } diff --git a/module/doc/view/alllibs.html.php b/module/doc/view/alllibs.html.php index 07c5ec4a14..854bf7ce41 100644 --- a/module/doc/view/alllibs.html.php +++ b/module/doc/view/alllibs.html.php @@ -63,8 +63,7 @@ -
show('left');?>
- +
show();?>
diff --git a/module/doc/view/index.html.php b/module/doc/view/index.html.php index e0b55b6115..b7e99ec4f0 100644 --- a/module/doc/view/index.html.php +++ b/module/doc/view/index.html.php @@ -11,7 +11,6 @@ */ ?> -
doclib->all?>
8 and $objectNum == 8):?>
- more}", '', "title='$lang->more' class='more'")?> + more}{$lang->doc->libTypeList['product']}", '', "title='$lang->more' class='more'")?>
@@ -84,7 +83,7 @@ 8 and $objectNum == 8):?>
- more . "", '', "title='$lang->more' class='more'")?> + more}{$lang->doc->libTypeList['project']}", '', "title='$lang->more' class='more'")?>
@@ -137,7 +136,7 @@ 8 and $objectNum == 8):?>
- more . "", '', "title='$lang->more' class='more'")?> + more}{$lang->doc->libTypeList['custom']}", '', "title='$lang->more' class='more'")?>
diff --git a/module/doc/view/objectlibs.html.php b/module/doc/view/objectlibs.html.php index a9586204ba..e8957796db 100644 --- a/module/doc/view/objectlibs.html.php +++ b/module/doc/view/objectlibs.html.php @@ -32,5 +32,4 @@
- diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index f12fde2095..ae3e6b5563 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -12,7 +12,7 @@ ?>
- id}&from={$this->from}"), $object->name) . $lang->arrow . $lang->doclib->files?> + doclib->files?>
@@ -46,12 +46,12 @@
+
show();?>
diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index 163b510ec6..6a56185354 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -165,6 +165,5 @@ - diff --git a/module/product/model.php b/module/product/model.php index c6aebf417e..a00de27ab1 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -257,9 +257,10 @@ class productModel extends model $this->dao->update(TABLE_PRODUCT)->set('`order`')->eq($productID * 5)->where('id')->eq($productID)->exec(); /* Create doc lib. */ + $this->app->loadLang('doc'); $lib = new stdclass(); $lib->product = $productID; - $lib->name = $product->name; + $lib->name = $this->lang->doclib->main['product']; $lib->main = '1'; $lib->acl = $product->acl == 'open' ? 'open' : 'custom'; $lib->users = $this->app->user->account; diff --git a/module/project/model.php b/module/project/model.php index 01355ae0d6..c160476651 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -271,7 +271,7 @@ class projectModel extends model /* Create doc lib. */ $lib = new stdclass(); $lib->project = $projectID; - $lib->name = $project->name; + $lib->name = $this->lang->doclib->main['project']; $lib->main = '1'; $lib->acl = $project->acl == 'open' ? 'open' : 'custom'; diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index e85420645c..b1c024d8b0 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -94,7 +94,8 @@ session->{$viewType .'List'} ? html::linkButton($this->lang->goback, $this->session->{$viewType .'List'}) : html::backButton(); echo html::hidden('parentModuleID', $currentModuleID); echo html::hidden('maxOrder', $maxOrder); ?> diff --git a/module/tree/view/browsetask.html.php b/module/tree/view/browsetask.html.php index 45e4863b8b..b49a1abf6b 100644 --- a/module/tree/view/browsetask.html.php +++ b/module/tree/view/browsetask.html.php @@ -80,7 +80,8 @@ session->taskList ? html::linkButton($this->lang->goback, $this->session->taskList) : html::backButton(); echo html::hidden('parentModuleID', $currentModuleID); echo html::hidden('maxOrder', $maxOrder); ?> diff --git a/module/upgrade/model.php b/module/upgrade/model.php index a822d74c44..1b1419a5e7 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -1163,6 +1163,7 @@ class upgradeModel extends model */ public function adjustDocModule() { + $this->app->loadLang('doc'); $productDocModules = $this->dao->select('*')->from(TABLE_MODULE)->where('type')->eq('productdoc')->orderBy('grade,id')->fetchAll('id'); $allProductIdList = $this->dao->select('id,name,acl,whitelist,createdBy')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->fetchAll('id'); foreach($allProductIdList as $productID => $product) @@ -1171,7 +1172,7 @@ class upgradeModel extends model $lib = new stdclass(); $lib->product = $productID; - $lib->name = $product->name; + $lib->name = $this->lang->doclib->main['product']; $lib->main = 1; $lib->acl = $product->acl == 'open' ? 'open' : 'custom'; $lib->users = $product->createdBy; @@ -1213,7 +1214,7 @@ class upgradeModel extends model $lib = new stdclass(); $lib->project = $projectID; - $lib->name = $project->name; + $lib->name = $this->lang->doclib->main['project']; $lib->main = 1; $lib->acl = $project->acl == 'open' ? 'open' : 'custom'; From 4983a57ee95647166a98b8b673bf10573495abfd Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 9 Nov 2016 09:33:37 +0800 Subject: [PATCH 2/3] * fix bug for delete. --- framework/model.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/model.class.php b/framework/model.class.php index 678b85047d..2335d5dd18 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -32,7 +32,7 @@ class model extends baseModel public function delete($table, $id) { $this->dao->update($table)->set('deleted')->eq(1)->where('id')->eq($id)->exec(); - $object = ltrim(strstr(trim($table, '`'), '_'), '_'); + $object = preg_replace('/^' . preg_quote($this->config->db->prefix) . '/', '', trim($table, '`')); $this->loadModel('action')->create($object, $id, 'deleted', '', $extra = ACTIONMODEL::CAN_UNDELETED); } } From 4e29668b7a09054a9d4078536c456b8653522771 Mon Sep 17 00:00:00 2001 From: Renee Date: Wed, 9 Nov 2016 09:53:43 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0ded679ac8..dfe9dfcfe0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ZenTao is practical and prgagmatic. It has full functions and a beautiful interf ZenTao focuses on R & D project management! -2. Why are we called ZenTao? +2. Why called ZenTao? ============================ Zen(禅) and Tao(道) are the two Chinese words that have rich meanings in both religion and culture. ZenTao Project Management Software take the cutural meaning of Zen and Tao, and is expected to convey our understanding and thinking on management. Inspired by The Tao of Programming and The Zen of Programming, we named our software ZenTao. @@ -15,14 +15,14 @@ Zen(禅) and Tao(道) are the two Chinese words that have rich meanings in both 3. Design philosophy of ZenTao Project Management Software ========================================================== -The main management philosophy of ZenTao Project Management Software is based on Scrum, an internationally popular agile management methodology. Scrum is very pragmatic and easy to operate, so it fits in the fast iterative software development projects. However, Scrum only defines the core management framework. There are still many details and processes that need to be extended and developed. Based on the philosophy of Scrum and the observation of the current R&D situation in China, ZenTao integrates bug management, test case management, release management and document management, and it covers the entire life cycle of software R&D. In ZenTao, the concept of product, project and test is clearly defined. Product team, development team and testing team coordinate and check with each other while they function differently. The three teams interact with each other through working on requirements, tasks and bugs, and eventually deliver the product with quality. +The main management philosophy of ZenTao Project Management Software is based on Scrum, an internationally popular agile management methodology. Scrum is very pragmatic and easy to operate, so it fits in the fast iterative software development projects. However, Scrum only defines the core management framework. There are still many details and processes that need to be extended and developed. Based on the philosophy of Scrum and the observation of the current R&D situation in China, ZenTao integrates bug management, test case management, release management and document management, and it covers the entire life cycle of software R&D. In ZenTao, the concept of product, project and test is clearly defined. Product team, development team and testing team coordinate and check with each other while they function differently. The three teams interact with each other through working on stories, tasks and bugs, and eventually deliver the product with quality. -4. Why choose ZenTao Project Management Software +4. Why choose ZenTao Project Management Software? =============================================== * ZenTao is a professional R&D project management software and canot be replaced by simple project management software. * ZenTao has precise and pragmatic management philosphy, which will accelerate agile development. -* ZenTao has full functions as a project man: you don’t need to integrate several systems together, like mantisbt + trac + testlink. +* ZenTao has full features as a project management software: you don’t need to integrate several systems together, like mantisbt + trac + testlink. * Open source codes and flexible extension mechanism, convenient for uses and secondary development of companies. * Underlying framework and front-end UI framework developed independently; robust and stable with beautiful interface and friendly interaction. * Perfect community mechanism; you can get technical support and help in time. @@ -30,18 +30,18 @@ The main management philosophy of ZenTao Project Management Software is based on * Support various deployments, either private deployment or cloud services. -5. Function lists of ZenTao Project Management Software +5. Features of ZenTao Project Management Software ====================================================== -* Product management: including products, requirements, plans, releases and roadmaps; +* Product management: including products, stories, plans, releases and roadmaps; * Project management: including projects, tasks, teams, versions and burn-down charts; * Quality management: including bus, test cases, test tasks and test results; -* Document management: including product document library, project document library and user-defined document library; -* Affair management: including to-do management and personal affairs management like my tasks, my bugs, my requirement and my projects; +* Document management: including product document library, project document library and customized document library; +* Affair management: including to-do management and personal management, such as my tasks, my bugs, my story and my projects; * Organization management: including department, users, groups and authorities; * Statistics function: various statistical reports; * Search function: powerful search functions to help you find the data you need. -* Extension mechanism:extensible nearly anywhere in ZenTao; +* Extension mechanism:extensible almost anywhere in ZenTao; * API mechanism, visible API: convenient for integration with other systems. 6. Website