如果my-module是模块的名称,则module文件夹将包含以下文件:
extension.xml XML定义文件
module.my-module.php 模块定义文件。必须包含模块的名称、版本、依赖
datamodel.my-module.xml XML中的数据模型。可以包含classes、menus、profiles的定义
model.my-module.php
main.my-module.php PHP代码和实用程序。对于某些包含大量PHP代码的模块,提取PHP代码并在此单独的文件中对其进行编辑比将代码嵌入XML中要容易得多。
images
en.dict.my-module.php 本地化字典文件
XML数据模型文件可用于定义:
SELECT Person WHERE id= :this->caller_id
SELECT Person WHERE id= :this->agent_id
SELECT Person
JOIN lnkContactToTicket AS L ON L.contact_id = Person.id
WHERE Person.notify = 'yes'
AND L.ticket_id = :this->id
AND (L.contact_id != :this->caller_id)
AND (L.contact_id != :this->agent_id)
SELECT Person AS p
JOIN User AS u ON u.contactid = p.id
JOIN URP_UserProfile AS up ON up.userid = u.id
WHERE u.status = 'enabled'
AND p.notify = 'yes'
AND up.profileid = 4
AND u.org_id = :this->org_id
SELECT Person AS p
JOIN lnkPersonToTeam AS pt ON pt.person_id=p.id
JOIN Team AS t ON pt.team_id=t.id
WHERE t.name = 'Team Name'
SELECT Contact AS c
JOIN Organization AS child ON c.org_id = child.id
JOIN Organization AS root ON child.parent_id BELOW root.id
WHERE root.friendlyname = 'TheProvider'
UNION
SELECT Person AS p
JOIN Organization AS o ON p.org_id = o.id
WHERE o.friendlyname = 'TheCustomer' AND p.phone != ''
SELECT UserRequest WHERE status NOT IN ('rejected', 'resolved', 'closed')
UNION
SELECT Incident WHERE status NOT IN ('rejected', 'resolved', 'closed')
UNION
SELECT Change WHERE status NOT IN ('rejected', 'closed')