You are on page 1of 11

TI LIU HNG DN VIT MODULE CHO SUGARCRM

Ti liu k thut 04/2012

Lch s chnh sa

Ngy thng 04/2012

Version 6.4.3

M t

Ngi vit DVMS

Mc lc
1. To module t h thng .............................................................................................. 3 2. Chnh sa code: ........................................................................................................... 7 THNG TIN LIN H H TR ......................................... Error! Bookmark not defined.

1. To module t h thng - ng nhp vo ti khon thuc nhm qung tr cao nht ca h thng => chn vo menu: Admin ti khu vc gc tri ca h thng => ti ca s m ra chn: Module Builder nh 1 hnh sau:

Hnh 1 ca s cu hnh h thng ca admin

Trong ca s Module Builder ta tin hnh to package

Hnh 2 ca s Module Builder, to package

Ch khi to package c trng Key, trng ny s dng lm phn m rng (fix) trong database. Tip theo ta tin hnh to module, chn vo nt New Module to module mi => nhp cc thng tin module vo form => chn kiu module, nu cha xc nh c kiu g th chn base => save li

Ca s to module

Mt module v d Sau khi tao module xong ta c cy th mc nh hnh sau ( y ti to module base, nu chn kiu module khc th cy th mc c th khc mt cht)

Cy th mc module

2. Chnh sa code: Mt module c bn trong sugar gm cc phn c bn: Mt trang xem danh sch({modulename}/metadata/listviewdefs.php) Mt trang to mi({modulename}/metadata/editviewdefs.php)

Mt trang trnh by chi tit cc thnh phn sau khi to mi({modulename}/metadata/detailviewdefs.php) Cc bn c th design giao din ca cc thnh phn ny bng module builder

Tuy nhin c mt s yu cu m module builder khng h tr. Nh thay i tn ca cc button cho ng vi nhu cu dng

Trong trng hp ny ta cn nt gi tin v khng th n l save c,ta phi custom li code trong trang editviewdefs.php

y ta quan tm n 'customCode': value l tn th hin ca nt,ta c th g thng tn ca button vo hoc ly thng qua file ngn ng ca module( {$MOD.LBL_SMS} l thuc tnh trong file ngn ng ca module}

Mt phn quan trng khc m module builder khng h tr l thay i action khi nhn vo nt Gi tin v trong module demo trc lu lu thng tin gm (s in thoi,ni dung,brandname,va status gi tin) ta cn gi 1 webservice gi tin nhn n s in thoi . Sugarcrm h tr chng ta thay i vic ny khng qua hook. to mt hook cho module ta vo phn custom ca module custom/modules/{modulename}/ to file logic_hooks.php (lu tn chnh xc)

$hook_version =1 :theo quy nh ca sugar + ay dng hook before_save :x l trc khi save, ngoi ra cn c mt s hook khc nh laf after_save,before_delete,after_delete... 'modules/sms_SMS/CustomFunction.php' :v tr t file hook x l 'CustomFunction' :Class x l 'SendSMS' ;hm x l

CHC THNH CNG!

10

THNG TIN LIN H H TR

DVMS (08) 360 289 37 info@dvms.vn www.DVMS.vn

11