Changes

Line 26: Line 26:  
*'supplier_order' --- 要在供应商订单视图中添加选项卡
 
*'supplier_order' --- 要在供应商订单视图中添加选项卡
 
*'supplier_invoice' - 要在供应商发票视图中添加选项卡
 
*'supplier_invoice' - 要在供应商发票视图中添加选项卡
*'invoice'         to add a tab in customer invoice view
+
*'invoice' ------------- 要在客户发票视图中添加选项卡
*'order'           to add a tab in customer order view
+
*'order' ---------------- 要在客户订单视图中添加选项卡
*'product'         to add a tab in product view
+
*'product' ------------- 要在产品视图中添加选项卡
*'stock'           to add a tab in stock view
+
*'stock' ---------------- 要在库存视图中添加选项卡
*'propal'           to add a tab in propal view
+
*'propal' --------------- 要在报价单视图中添加选项卡
*'member'           to add a tab in fundation member view
+
*'member' ------------ 要在基金会会员视图中添加选项卡
*'contract'         to add a tab in contract view
+
*'contract' ------------ 要在合同视图中添加选项卡
*'user'             to add a tab in user view
+
*'user' ----------------- 要在用户视图中添加选项卡
*'group'           to add a tab in group view
+
*'group' --------------- 要在组视图中添加选项卡
*'contact'         to add a tab in contact view
+
*'contact' ------------- 要在联系人视图中添加选项卡
*'categories_x'     to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
+
*'bank' ---------------- 要在银行视图中添加选项卡
*'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' ------ 要在类别视图中添加选项卡('x'的值: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' ------- 要在元素的统计视图中添加选项卡
 +
*'member_admin', 'company_admin', 'product_admin' --- 用于管理页面
   −
2) 然后添加您的选项卡,创建一个新的模块文件。见 [[模块开发]]
+
2) 要添加自己的选项卡,请创建模块及其描述符文件。请参阅 [[模块开发]] 页面。
 +
 
 +
3) 然后,在文件描述符中,编辑 $this->tabs 属性,按照以下语法添加选项卡:
   −
3) 然后进入描述符文件,编辑$this->tab,使用以下语法添加选项卡:
   
<source lang="php">
 
<source lang="php">
 
$this->tabs = array(
 
$this->tabs = array(
Line 49: Line 51:  
</source>
 
</source>
   −
这是一个由5或6个元素组成的字符串(取决于你是否选择使用$conditiontoshowtab),用''''''分隔。
+
这是一个由5或6个部分组成的字符串(取决于您是否选择使用$conditiontoshowtab),用 ''':''' 分隔。
   −
这里:
+
其中:
   −
*objecttype 是您将使用的Tab的名称。
+
*'''objecttype''' ------------------- 是您将修改的页面的对象类型代码。
*+tabname 是一个名称来标识您的选项卡,前面是动作(+ 添加或 - 删除,您可以删除其他选项卡,包括默认的)。
+
*'''+tabname''' -------------------- 是您为自己的选项卡选择的标识名称,前面是操作('+' 添加或 '-' 删除,您也可以删除其他选项卡,包括默认选项卡)。
*TitleOfTab 是一个你选择的标题,它将被翻译。
+
*'''TitleOfTab''' ------------------- 是您为自己的选项卡选择的标题,它将被翻译。
*@mymodule 是语言文件,里面是翻译条目。 (如: mytitlelang@mymodule 会查找 '''/htdocs/mymodule/langs/xx_XX/mytitlelang'''  ''' xx_XX''' 是当前语言如: en_US, fr_FR, etc.).
+
*'''@mymodule''' --------------- 是翻译选项卡标题时使用的语言文件(如: mytitlelang@mymodule ,将会查找 '''/htdocs/mymodule/langs/xx_XX/mytitlelang'''  ''' xx_XX''' 是当前语言如:en_US,fr_FR等等)。
*$conditiontoshowtab 是否显示: 是真则显示,假则不显示。如: you can use the Dolibarr rights system, eg: $user->rights->product->creer or $user->admin or any other variable you want. 此项是可选项,跳过也是可以的。不要忘记分号也要删除。
+
*'''$conditiontoshowtab''' --- 是一个变量或者表达式,将被评估以获取其值:为true则显示选项卡,为false则不显示选项卡。例如:您可以使用 Dolibarr 权限系统(如:$user->rights->product->creer or $user->admin)或任何其它您想要的变量。这部分是可选的,您可以跳过它并在此字符串中只保留 5 个部分(不要忘记 ''':''' 号也要删除)。
*urloftab?id=__ID__ 是选项卡指向的URL。使用占位符 __ID__ 替代'''id'''。如:DOL_DOCUMENT_ROOT.'/mymodule/lib/mytab.php'
+
*'''urloftab?id=__ID__''' ------ 是单击选项卡时将指向的URL。您可以使用占位符__ID__。如果定义了 id 的值,该占位符将被替换为 id 的值。如:DOL_DOCUMENT_ROOT.'/mymodule/lib/mytab.php'
    
示例:
 
示例:
714

edits