Changes

Line 14: Line 14:  
{{TemplateMainPageZh}}
 
{{TemplateMainPageZh}}
   −
= Dolibarr选项卡 =
+
=Dolibarr选项卡系统=
Dolibarr通过'''选项卡'''来显示元素的信息。
+
Dolibarr在由多个选项卡组成的视图中显示元素(发票、仓库、用户等)的信息。
   −
可以添加、删除或替换现存的选项卡
+
您可以添加自己的选项卡、删除选项卡或替换现有选项卡。
   −
= 添加选项卡 =
+
=添加您自己的选项卡=
1) 首先, 必须标识选项卡所涉及的对象类型及其对象类型代码。这是完整的列表:
+
1) 首先,您需要确定要添加、删除或修改的选项卡所指向的对象类型及其代码“objectType”。以下是完整清单:
* 'thirdparty'       to add a tab in third party view
+
 
* 'intervention'     to add a tab in intervention view
+
*'thirdparty' --------- 要在合作方视图中添加选项卡
* 'supplier_order'   to add a tab in supplier order view
+
*'intervention' ------ 要在现场服务视图中添加选项卡
* 'supplier_invoice' to add a tab in supplier invoice view
+
*'supplier_order' --- 要在供应商订单视图中添加选项卡
* 'invoice'          to add a tab in customer invoice view
+
*'supplier_invoice' - 要在供应商发票视图中添加选项卡
* 'order'            to add a tab in customer order view
+
*'invoice'          to add a tab in customer invoice view
* 'product'          to add a tab in product view
+
*'order'            to add a tab in customer order view
* 'stock'            to add a tab in stock view
+
*'product'          to add a tab in product view
* 'propal'          to add a tab in propal view
+
*'stock'            to add a tab in stock view
* 'member'          to add a tab in fundation member view
+
*'propal'          to add a tab in propal view
* 'contract'        to add a tab in contract view
+
*'member'          to add a tab in fundation member view
* 'user'            to add a tab in user view
+
*'contract'        to add a tab in contract view
* 'group'            to add a tab in group view
+
*'user'            to add a tab in user view
* 'contact'          to add a tab in contact view
+
*'group'            to add a tab in group view
* 'categories_x'    to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
+
*'contact'          to add a tab in contact view
* 'member_stats', 'order_stats', 'supplier_order_stats', 'invoice_stats', 'supplier_invoice_stats', 'trip_stats', 'propal_stats' to add a tab in statistic view of elements.
+
*'categories_x'    to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
* 'member_admin', 'company_admin', 'product_admin' for admin pages
+
*'member_stats', 'order_stats', 'supplier_order_stats', 'invoice_stats', 'supplier_invoice_stats', 'trip_stats', 'propal_stats' to add a tab in statistic view of elements.
 +
*'member_admin', 'company_admin', 'product_admin' for admin pages
    
2) 然后添加您的选项卡,创建一个新的模块文件。见 [[模块开发]] 。
 
2) 然后添加您的选项卡,创建一个新的模块文件。见 [[模块开发]] 。
Line 51: Line 52:     
这里:
 
这里:
* objecttype 是您将使用的Tab的名称。
+
 
* +tabname 是一个名称来标识您的选项卡,前面是动作(+ 添加或 - 删除,您可以删除其他选项卡,包括默认的)。
+
*objecttype 是您将使用的Tab的名称。
* TitleOfTab 是一个你选择的标题,它将被翻译。
+
*+tabname 是一个名称来标识您的选项卡,前面是动作(+ 添加或 - 删除,您可以删除其他选项卡,包括默认的)。
* @mymodule 是语言文件,里面是翻译条目。 (如: mytitlelang@mymodule 会查找 '''/htdocs/mymodule/langs/xx_XX/mytitlelang'''  ''' xx_XX''' 是当前语言如: en_US, fr_FR, etc.).
+
*TitleOfTab 是一个你选择的标题,它将被翻译。
* $conditiontoshowtab 是否显示: 是真则显示,假则不显示。如: you can use the Dolibarr rights system, eg: $user->rights->product->creer or $user->admin or any other variable you want. 此项是可选项,跳过也是可以的。不要忘记分号也要删除。
+
*@mymodule 是语言文件,里面是翻译条目。 (如: mytitlelang@mymodule 会查找 '''/htdocs/mymodule/langs/xx_XX/mytitlelang'''  ''' xx_XX''' 是当前语言如: en_US, fr_FR, etc.).
* urloftab?id=__ID__ 是选项卡指向的URL。使用占位符 __ID__ 替代'''id'''。如:DOL_DOCUMENT_ROOT.'/mymodule/lib/mytab.php'
+
*$conditiontoshowtab 是否显示: 是真则显示,假则不显示。如: you can use the Dolibarr rights system, eg: $user->rights->product->creer or $user->admin or any other variable you want. 此项是可选项,跳过也是可以的。不要忘记分号也要删除。
 +
*urloftab?id=__ID__ 是选项卡指向的URL。使用占位符 __ID__ 替代'''id'''。如:DOL_DOCUMENT_ROOT.'/mymodule/lib/mytab.php'
      Line 71: Line 73:  
5) 测试新选项卡
 
5) 测试新选项卡
   −
= 删除现在的选项卡 =
+
=删除现在的选项卡=
 
删除选项卡的操作与添加选项卡相同,在模块文件的tabs数组中使用以下语句:
 
删除选项卡的操作与添加选项卡相同,在模块文件的tabs数组中使用以下语句:
 
<source lang="php">
 
<source lang="php">
Line 81: Line 83:  
注意:在这种情况下不需要其他参数。
 
注意:在这种情况下不需要其他参数。
   −
== 如何确定你要删除的选项卡的名称==
+
==如何确定你要删除的选项卡的名称==
* 打开浏览器的开发者工具。
+
 
* 单击选择元素按钮
+
*打开浏览器的开发者工具。
* 在窗口中选择你要删除的Dolibarr选顶卡。
+
*单击选择元素按钮
* 在开发者工具中查看 tab 属性
+
*在窗口中选择你要删除的Dolibarr选顶卡。
 +
*在开发者工具中查看 tab 属性
    
[[File:企业微信截图 20180829160108.png|800px]]
 
[[File:企业微信截图 20180829160108.png|800px]]
   −
= 替换选项卡 =
+
=替换选项卡=
 
执行 "添加选项卡" 和 "删除现在的选项卡"。如果新标签的标题与删除的标题相同,则错觉是完美的。
 
执行 "添加选项卡" 和 "删除现在的选项卡"。如果新标签的标题与删除的标题相同,则错觉是完美的。
   −
= 将标签显示在自己的页面中 =
+
=将标签显示在自己的页面中=
 
更多关于如何在页面中显示标签的信息在页面上可用。
 
更多关于如何在页面中显示标签的信息在页面上可用。
 
[[Module_development#The_tab_management]]
 
[[Module_development#The_tab_management]]
714

edits