Skip to content
Renee edited this page Mar 19, 2020 · 1 revision

ZenTao ALM is based on zentaoPHP, a framework developed by our team. The framework has powerful mechanisms of extension, API, and command lines. You can either modify or extend ZenTao with other mechanisms, or integrate it with other systems or deploy automated scripts in ZenTao.

Please read the following documents to get a full understanding of the customization mechanism of zentaoPHP.

Below are what you should know about ZenTao codes.

Index


After understanding the basic principles and customization mechanism of the zentaoPHP framework, you should know the directories of ZenTao.

After understanding the basic principles and customization mechanism of zentaoPHP framework, you should be familiar with the directory of ZenTao.

1. Root

bin command line scripts of ZenTao

config master configuration files and the database configuration files

db database scripts of upgrading and complete database building scripts framework core files of zentaoPHP framework

lib class files, e.g. database access, sending emails and data verification

module module files

tmp temporary files

www table files, js files, images, entry programs of ZenTao and index.php

2. www

data files uploaded

fushioncharts flash files for reports

js jquery extensions and corresponding functions

theme style sheets

install.php installation programs

uprade.php upgrade programs which will be accessed when upgrading

.htaccess and .ztaccess Apache configuration files; configure ZenTao static access when rewrite module is on

3. Module

There are over 30 modules In the Module directory. Each module corresponds to one feature in ZenTao. The features in ZenTao are composed of these modules.

lang language files for the current module. zh-cn is simplified Chinese, zh-tw is traditional Chinese and en is English. If you need to modify the names or configurations of some fields, you should open its relevant files.

view template files for pages, e.g. the corresponding template is browse.html.php if you want to view the bug page.

config.php configuration files for the module

control.php is the entry of all pages of bug module, which means the definition of the method to view bug related pages can be found in this directory.

model.php is the methods for bug related actions in the database

Back to Index

If you want to customize ZenTao, you should know how to find the codes you want to change. Now you have an understanding of ZenTao directory structure, so let’s look at how ZenTao requests can correspond to the codes.

1. Find the control method

The control method is the entry to each page. Look at an example bug-browse-1.html or /?m=bug&f=browse&productID=1&t=html. bug-browse-1.html is the browse method to visit the bug module; 1 is the first parameter and html is the access type of the page. Similarly, /?m=bug&f=browse&productID=1&t=html, m means the name of the module, f is the name of the method and the rest is the parameter list. Then you can find the source code of browse method in module/bug/control.php in ZenTao.

find the control method

2. Invoke in the control method

Now that we have known where the entry function is, let’s look at what is in it.

$this->bug means the invoke model in the bug module. The corresponding file is module/bug/model.php.

$this->loadmodel ('tree')->xxx means to load model of the tree module and its corresponding file is in module/tree/model.php.

$this->app->loadClass('pager') means to load a lib and its corresponding file is in lib/pager/pager.class.php.

$this->lang->bug->xxx is defined in module/bug/lang/zh-cn.php and the zh-cn is the language determined by the operating language of the current user.

$this->display() calls the template file which has the same name as the current method in the directory of View. For example, the corresponding template file to view bugs is module/bug/view/browse.html.php.

Back to Index

The naming of ZenTao databases is quite simple and concise. You can guess the purposes and functions of each table from the names. If it is not clear to you, you can find it in the corresponding language files of tables.

1. Product-related tables

zt_product //product-reated information;

zt_productPlan //product-related plans;

zt_story //an important table recording all the stories; zt_storySpec records the history of stories;

zt_release // records release information of the product. This table is also mutually associated to zt_build.

2. Project-related tables

zt_project //project tables;

zt_projectProduct //the correlations between projects and products;

zt_proejctStory //all the stories that will be done in the projects;

zt_task //task tables;

zt_burn //data lof the Burndown chart, which is generated based on the data in this table;

zt_team // the team members in the project;

zt_build //records the build lists of the products in the project.

3. Test-related tables

zt_bug //bug tables;

zt_case //test case tables; zt_caseStep records the history and steps of cases;

zt_testTask //test task tables;

zt_testRun //executions of test cases corresponded to test tasks;

zt_testResult //the execution results of each test case.

4. Document library related tables

zt_docLib //lists of the custom document libraries;

zt_doc //all the documents.

5. Company related tables

zt_user //user tables;

zt_group //group tables;

zt_userGroup //correlations between users and groups;

zt_groupPriv //group previleges;

zt_dept //department structure tables;

zt_userQuery //custom query tables;

zt_userTPL //custom templates tables;

zt_todo //to-do tables;

5. Common tables

zt_company //a root table recording the information about the company;

zt_module //an important table which maintains the data of the division of modules in ZenTao;

zt_action //action history tables, recording all the change history of each object;

zt_history //records the value changes before and after actions;

zt_file //file tables.

Back to Index

Common modules are something special in ZenTao. Many common features in ZenTao are done in the common modules.

common/control.php, methods applicable to other modules are provided, such as privileges, menu print, etc.

common/view, there is a common template, e.g. header.html.php and footer.html.php. Besides, initializing code templates of jquery extensions are also included in this directory, e.g. colorbox.html.php.

common/lang, common language templates are set.

If you want to modify the language items or the common templates, you can find the code in the common module.

Back to Index


If you need more instruction on how to customize ZenTao, refer to Here.