ZenTao ManualBook Info
1 Introduction
1.1 About ZenTao
1.2 Introduction PPT
1.3 Technical Support
1.4 Follow Us
2 Installation
2.1 Choose the right installation
2.2 ZenTao Cloud
2.3 One-click Installation for Windows
2.4 One-click Installation for Linux
2.5 Installation with Lampp
2.6 Source Code Installation (for all Systems)
2.7 Set up Virtualbox for ZenTao
2.8 Softaculous service
2.9 Integrate Zdoo
2.10 Install Ioncube
3 Upgrade
3.1 Upgrade ZenTao
3.2 Upgrade by source code (for all systems)
3.3 Upgrade for one-click installation for Windows (xampp)
3.4 Upgrade for one-click installation package for Linux
4 Users and Groups
4.1 Company Structure
4.2 Add a User
4.3 Batch Manage Users
4.4 Groups and Privileges
5 Quick Start
5.1 Project and Task Management
5.2 Bug Tracking
5.3 Product Management
5.4 Individual Task Management
6 Basic Application
6.1 Basic Workflow
6.2 Agile and Scrum
6.3 ZenTao and Scrum
6.4 ZenTao Tutorial for Rookies
6.5 Create a Product
6.6 Create a Story
6.7 Create a Project
6.8 Confirm a Story
6.9 Task Breakdown
6.10 Report a Bug
6.11 Manage Contacts
6.12 Customization
6.13 Import Excel, CSV files
6.14 Document Management
6.15 Operation Mode
6.16 Points
6.17 Customize Required Field
6.18 Access Control
7 Advanced Application
7.1 Workflow
7.1.1 ZenTao Workflow
7.2 Personal management
7.2.1 My Todo
7.2.2 My Task, Story and Bug
7.2.3 My Profile
7.3 For Product Owner
7.3.1 Manage a Product
7.3.2 Manage a Product Line
7.3.3 Create and Review a Story
7.3.4 Change and Review a Story
7.3.5 Story Status
7.3.6 Notes for Writing a Story
7.3.7 Product Module
7.3.8 Release Plan
7.3.9 Create a Release
7.3.10 Roadmap
7.3.11 Documents
7.3.12 Planning Meetings
7.3.13 Daily Scrum, Review and Retrospective Meetings
7.3.14 Story Reports
7.4 For Project Manager
7.4.1 Create a Project
7.4.2 Set up a Team
7.4.3 Confirm a Story
7.4.4 Story Breakdown
7.4.5 Daily Standup Meetings
7.4.6 Check Project Progress via Burndown Chart
7.4.7 Check Project Progress via Lists
7.4.8 Review and Retrospective Meetings
7.4.9 Basic reports on tasks
7.5 For Development Team
7.5.1 Project planning meeting and task breakdown
7.5.2 Claim tasks and update efforts
7.5.3 Kanban and Tree Diagram
7.5.4 Build
7.5.5 Test Task
7.5.6 Resolve a Bug
7.5.7 Documents
7.5.8 Confirm Bugs
7.6 For QA Team
7.6.1 Defect Management
7.6.2 Report a Bug
7.6.3 Verify and Close a Bug
7.6.4 Activate a Bug
7.6.5 Find a Bug
7.6.6 Test Case
7.6.7 Create and Review Test Cases
7.6.8 Test Suites, Public Case Libs and Reports
7.6.9 Manage Test Tasks
7.6.10 Execute Cases and Report Bugs
7.6.11 Reports
8 Configuration
8.1 Maintain ZenTao
8.1.1 Initialize scripts
8.1.2 Back up ZenTao
8.1.3 Recover the Deleted
8.1.4 Update Burndown charts
8.1.5 ZenTao remote host
8.2 Deploy ZenTao
8.2.1 Guest Login
8.2.2 Email Notification
8.2.3 Set Super Admin
8.2.4 Static Access
8.2.5 Delete "zentao" from URL
8.2.6 Integrate ZenTao with SVN
8.2.7 Integrate ZenTao with Git
8.2.8 Integrate webhook
8.2.9 Integrate Xuan.im
8.2.10 Integrate Zdoo
9 Customization
9.1 ZenTao customization
9.2 ZenTao Directory
9.3 Locate and Change Files
9.4 ZenTao Database Structure
9.5 Common Modules
9.6 Add Features to Menu
9.7 Set Privileges to Modules
9.8 Examples: modify language prompt
9.9 Examples: set priority when creating bugs
9.10 Web Editor
9.11 ZenTao Packaging Standards 1.1
10 Relevant Issues
10.1 About third-party code
10.2 Support ZenTao
10.3 ZenTao Commercial Service
10.4 Acknowledgement

Add Features to Menu

2015-09-14 15:07:15
azalea
3902
Last edited by Renee on 2018-11-16 14:47:12

One of the problems you might have when customizing ZenTao is how to add the customized features to the navigation bar. In this chapter, we will talk about how to do it.


1. Menu

The menu in ZenTao includes three level, the top menu, the module menu and the function module.


2. Menu definition

The code of menu definition is saved in the language files in zentao/module/common/lang/en. Now let’s look at the definition of the main menu.


2.1 Define the main menu


80 $lang->menu->my  = 'Dashboard|my|index';
81 $lang->menu->product = 'Product|product|index';
82 $lang->menu->project = 'Project|project|index';

83 $lang->menu->qa = 'Testing|index';


Let’s look at the definition of codes 83 $lang->menu->qa = 'Testing|qa|index';


It defines the code of the Testing module. menu->qa defines the key value of the menu, which can be defined according to the actual definition of modules. The three parameters separated by the vertical lines are the text of the menu, the corresponding module and the method. This code is to define a top menu, the text of which is Testing, and link its index method to qa module.


2.2 Define a module menu
Take the module menu of Product as an example.


144 $lang->product->menu->list = '%s';
145 $lang->product->menu->story = array('link' =>'Story|product|browse|productID=%s',     'subModule' =>'story');
155 $lang->product->menu->create = array('link' =>' Newly added product|product|create', 'float' =>'right');
158 $lang->productplan->menu = $lang->product->menu;
159 $lang->release->menu = $lang->product->menu; 


These codes define the module menu in the Product and there are some new definitions.


    2.2.1 Define links with arrays
145 $lang->product->menu->story  = array('link' =>'Story|product|browse|productID=%s', 'subModule' =>'story');


It defines two elements, link and subModule, with array, when defining the link. One parameter field is added, productID=%s, which means the browse method used when linking the "Story" menu to the Product. The parameter passed is productID=%s, and %s will be changed into the actual product ID.


    2.2.2 Define submodules
145 $lang->product->menu->story = array('link' => 'Story|product|browse|productID=%s', 'subModule' =>'story');


It is used to define submodules and highlight it. When you are in story module, the defined menu Product will be highlighted.


    2.2.3 Define alias of methods with alias
151 $lang->product->menu->view  = array('link' =>'Overview|product|view|productID=%s', 'alias' =>'edit');


Alias means that the edit page and view page of the product are the same. Therefore, when you go to edit products, the Overview is still highlighted.

    2.2.4 Define the settings of menu

Every menu is displayed on the left by default. If you want to move it to the right, you have to define its float parameter.


155 $lang->product->menu->create  = array('link' =>'newly added product|product|create', 'float' =>'right');


By setting the float parameter, you define that the link of the newly added product will be displayed on the right.



2.3 Define a function menu
Function module is printed in each module. Its extension method is the same as that of Views, which we will touch later.


3. Define the order of a menu

What has been mentioned above is how to define a menu in ZenTao. Now we will talk about how to define the order of a menu in ZenTao. In the directory of common/lang/, there is menuOrder.php which is used to define the display order of each menu.


/* Sort of main menu. */
$lang->menuOrder[5]  = 'my';
$lang->menuOrder[10] = 'product';
$lang->menuOrder[15] = 'project';
$lang->menuOrder[20] = 'qa';
$lang->menuOrder[25] = 'doc';
$lang->menuOrder[30] = 'report';
$lang->menuOrder[35] = 'company';
$lang->menuOrder[40] = 'admin';
/* index menu order. */
$lang->index->menuOrder[5] = 'product';

$lang->index->menuOrder[10] = 'project';


4. How to add your pages to the menu

Once you understand the menu mechanism in ZenTao, it will be very easy to extend. Let’s look at the steps to add pages to menu.


4.1 Create a file in the directory of module/common/ext/lang/en/. It can be abc.php and you can name it at your wish.


4.2 Add your own menu to the file, e.g. the build repository menu in the ZenTao Pro. 

$lang->menu->repo = ' build repo |repo|browse';
$lang->menuOrder[21]  = 'repo';
$lang->repo->menu->list = '%s' . $lang->arrow;
$lang->repo->menu->browse = array('link' =>'browse|repo|browse|repoID=%s', 'alias' =>'diff, log, view, revision, showsynccomment');
$lang->repo->menu->settings = 'settings|repo|settings|repoID=%s';
$lang->repo->menu->delete = array('link' =>'delete|repo|delete|repoID=%s', 'target' =>'hiddenwin');
$lang->repo->menu->create = array('link' =>' newly added build repo |repo|create|', 'float' =>'right');


    Write a Comment
    Comment will be posted once reviewed.