Page 1
I THIU NN TNG SUGARCRM ..................... 9
1.1. Ki .............................................................................................................. 9
1.2. n trong SugarCRM ............................................................................................... 14
U .................. 31
2.1. Gii thi .................................................................................................... 31
2.2. .................................................................................................................. 31
2.3. u cho h thng CRM c ............................................................ 32
2.4. ng .......................................................................................................... 34
2.5. Usecase .............................................................................................................. 36
2.5.1. Usecase c .................................................................................. 37
2.5.2. Usecase c ..................................................................................... 38
2.5.3. Usecase ca Actor K ..................................................................................... 39
2.5.4. Usecase ca Actor Manager: .................................................................................... 40
2.6. u v d liu ................................................................................... 41
2.6.1. a Account ..................................................................................... 42
2.6.2. a Revenues actual ......................................................................... 43
2.6.3. a Revenues Estimation ................................................................. 44
2.6.4. a Production Cost Esmation ......................................................... 45
2.6.5. a Production Cost Actual ............................................................. 46
2.6.6. a Manpower Cost ......................................................................... 47
2.6.7. a User ........................................................................................... 47
2.6.8. a Timesheets ................................................................................. 48
2.6.9. a Leaving ...................................................................................... 50
2.6.10. a Salary ......................................................................................... 51
2.6.11. a Project ........................................................................................ 53
2.7. u Report tham kho .............................................................................................. 54
2.7.1. Mu Report Project Cost Estimate ........................................................................... 54
2.7.2. Mu Report Project Cost Actual (CR) ..................................................................... 55
Page 2
2.7.3. Mu Report Project Cost Actual (MA) .................................................................... 56
2.7.4. Mu Report Profit And Loss (CR) .......................................................................... 57
2.7.5. Mu Report Profit And Loss (MA) ......................................................................... 57
2.7.6. Mu Report Revenue ............................................................................................... 57
2.7.7. Mu Report Timesheet (%) ...................................................................................... 58
2.7.8. Mu Report Timesheet ............................................................................................. 59
2.8. Kh th hong ca Red .......................................................... 60
T K H THNG .............................................. 61
3.1. Module Account ............................................................................................................... 62
3.2. Module ManPower Cost .................................................................................................. 63
3.3. Module Production cost actual ......................................................................................... 64
3.4. Module Production cost estimation .................................................................................. 64
3.5. Module Projects ............................................................................................................... 64
3.6. Module Revenues Estimation .......................................................................................... 65
3.7. Module Revenues Actual ................................................................................................. 65
3.8. Module Salary .................................................................................................................. 66
3.9. Module Timesheets .......................................................................................................... 67
3.10. Module Leaving ........................................................................................................... 67
3.11. Module PublicDays ...................................................................................................... 68
3.12. Module Report ............................................................................................................. 68
3.12.1. Report Estimate Cost ................................................................................................ 69
3.12.2. Report Actual Cost (MA) ......................................................................................... 69
3.12.3. Report Actual Cost (CR) .......................................................................................... 70
3.12.4. Report Profit And Loss (CR) ................................................................................... 71
3.12.5. Report Profit And Loss (MA) .................................................................................. 71
3.12.6. Report Revenues Projection ..................................................................................... 72
3.12.7. Report timesheet....................................................................................................... 72
3.12.8. Report Timesheets (%) ............................................................................................. 74
NG H THNG THC T CHO RED ..... 75
4.1. Module Account ............................................................................................................... 75
4.2. Module Projects ............................................................................................................... 76
Page 3
4.3. Module timesheets ........................................................................................................... 81
4.4. Module Teams .................................................................................................................. 84
4.5. Module salary ................................................................................................................... 86
4.6. Module report ................................................................................................................... 89
4.6.1. Report estimate cost ................................................................................................. 91
4.6.2. Report actual cost ..................................................................................................... 95
4.7. Module Manpower Cost ................................................................................................. 100
4.8. thng .......................................................................................................... 101
KT LUN .......................................................................................... 104
U THAM KHO .................................................................. 105
PH LC 1 .......................................................................................... 106
PH LC 2 .......................................................................................... 113
Page 4
...................................................................... 10
c con ca mc gc .......................................... 12
trong Developer Tools ............................................................. 14
Repair trong System ...................................................................... 15
studio .......................................................... 23
gii nhau ........................................................ 23
u ta file logic hook ................................................................ 25
p d ............................... 35
Uscae tng th ............................................................................... 36
Usecase c ..................................................... 37
Usecase c ........................................................ 38
Uscase ca Actor K .......................................................... 39
i qu .............................. 40
ng th ............................................................................... 41
a thc th Account ......................................................... 42
a thc th revenues actual .............................................. 43
a thc th Revenues Estimation ..................................... 44
a thc th Production Cost Estiamtion .......................... 45
a thc th Production Cost Actual ................................. 46
a thc th Manpower Cost ............................................. 47
a thc th Users .............................................................. 48
a thc th Timesheets..................................................... 49
a thc th Leaving .......................................................... 50
a thc th Salary............................................................. 52
a thc th Project ........................................................... 53
a h thng Red online timesheet (Red CRM) ...................... 62
a module Account .................................... 62
a module Account ................................... 63
n to mi Manpower Cost ............................................................ 63
n to mi Prduction cost actual .................................................... 64
n to mi Production cost Estimation .......................................... 64
n mi mi Projects ....................................................................... 65
n to mi Revenues Estimation .................................................... 65
n to mi Revenues Actual .......................................................... 66
n to mi Salary ........................................................................... 66
Page 5
n khi nhp Timesheets .................................................................. 67
n khi nhp Leaving ....................................................................... 67
n khi to mi Publicdays .............................................................. 68
thng ......................................................... 68
n Report Estiamte Cost ................................................................. 69
n Report Actual Cost (MA) .......................................................... 70
n Report Actual Cost (CR) ........................................................... 70
n Report Profit And Loss (CR) .................................................... 71
n Report Profit And Loss (MA) ................................................... 72
din Report Revenues Projection ...................................................... 72
c lc theo d ..................................... 73
n Report Timesc l ............................... 73
............................................................... 74
thng ............................................................. 75
................................................................................ 76
o mi Project ........................................................................... 79
n Project ............................... 80
................................................................................. 84
p te ...................... 86
......................................................................................... 89
................................................................. 91
.................................................................. 94
..................................................................... 99
Page 6
o mi mt package trong SugarCRM ...................................................... 16
o mi mt module trong SugarCRM ....................................................... 17
nh module b Studio trong module builder ................... 21
dng trong h thng SugarCRM .................. 22
n qu ................................ 34
u Report Project Cost Estimation ........................................................... 54
u Report Project Cost Actual (CR) ......................................................... 55
u Report Project Cost Actual (MA) ....................................................... 56
u Report Profit And Loss (CR) .............................................................. 57
u Report Profit And Loss (MA) ........................................................... 57
u Report Revenues ............................................................................... 57
u Report Timesheet (%) ....................................................................... 58
u report Timesheet ................................................................................ 59
Page 7
M U
Cu th k y nh
c c n mi sng kinh t
i chuyn mnh t i
kinh t p sang kinh t c.
Trong mi
hot
qu c t i
i nhu
c bo
my cm... Phn mm qu i
nh gii quyt
Mn
cho th d trn ph m m ngu m
SugarCRM.
Cn
Cn bao gn sau:
Phn m u
Phn ni dung
Page 8
Chg 1 gii thiu nn tng sugarcrm: n thc cn bit v c
mc cnh sa trong SugarCRM.
Chg 2 thu thp v phn t yu cu: gii thiu v cng ty red, c yu cu
v b to usecase, n m
tr ng module
Chg 3 thit k h thng: Workflow cho h thng, thit k giao din ca tng
module
Chg 4 xy dng h thng thc t cho Red: da v nhng thit k u
tin h xy dng h thng thc t.
Phn kt lun: kt qu c.
Page 9
1: GI THI NN TNG SUGARCRM
SugarCRM
SugarCRM l phn mm m ngun m s dng h u LAMP
(Linux, Apache,M P
SugarCRM nhiu h tr cho mi h thng hot ng (bao gm Windows,
HP
SugarCR thi k h tr ti a cho nh s dg d
bi v code hay khg bi v code php c c th c nh t bi trong h
th c SugarCR nhu c c s d. N s dg
khng bi v code php c th s dg cng c developer trong m h ad
c nh thi l c thi.
C dg c SugarCRc x dg d trn module framework,
khi dg b ch s g c entry point ln (m s g index.php
hoc soap.php).
Entry point ch c SugarCRc g ln l index.php. C 3 thng
s ch trong vic g l:
Module: s g modc truy c.
Action: g h c thc hi khi g module.
truy c.
Page 10
1
c vic h thng nhm
hn ch nhng s tip c d li hin th n
i dung s c ly trong b nh cache.
m nhn vic tp trung lnh sa ca nhng
nh
mc custom s t ng sinh ra nhng v
tri ng chnh sa cn thit cho h thng cng
nh s
Data: nhng files h thng quan tr tt
t t ng dng mnh cho mng
trong Sugar.
Page 11
Include: Nhiu ch
nh t phn trong hong c
ng da hu hc
i rc s dng .
i quan h gii nhau.
Modules: Bao gm tt c thc hin th
web. Nh c l
n th thc hin
c Modules nh s ng cho vic t
vic chnh s
ng
Thng mi module i din cho mt thc th tng ng trong mc
kinh doanh, v d nh l modarCRM. Mt module bao
gm 3 phn ch l d liu, giao din i d v chc nng ng
dng.
Page 12
2: Cc con ca mc gc
Dashlets: S ng d lu tr thng tin ca module c
th hin th trang ch, mc nh trang ch trong SugarCRM s hin th c
thng tin ch ca tng module. V vy nu mun hin th thng tin g ca module
ra ngo m h trang ch th khai b y. Mnh ca Dashlets s ly m
h Listview l m l dashlets.
chui hin th trong module.
V SugarCRM l mt phn mm a ngn ng, nn tt c c nhn ca module s
nh ngha ti ti th mc n tin li cho vi i ngn ng m
khng nh ng n vic hin th c chui hin th ra ngo ng dng.
Metadata: Th mc n c nhim v lu c file hin th ca module bao
gm vic hin th c subpanel, m h listview, detailview, editview.
Page 13
Tpls: Th mc n ch c c d HTML m nhim vic hin th d
liu ra bn ngo m h ng dng.
Views: C thc hin th d liu ca SugarCRc s dng bng nhiu
c, v Views ch l th mc m nhim mt trong c cng vi, n nay
s lu c file .php ca m h editview,detailview hay l listview.
Khi gii thiu v c th phn ca modng hay nhc n m h
editview, detailview hay listview, c m h n s m nhim nhng cng vic
c th cho vic hin th nh sau:
ListView : L m h s hin th c danh s c d liu c trong
module, mn h s hin th mnh khi nhp v mt module n , trong m
h n c c c chc nng nh search.
EditView: L m h hin th ra c ng hin th c ng d liu
hin c ca mod i s dng nhp v.
DetailView: L m h hin th thng tin chi tit d liu c nhp v
c lu xung c s d liu.
Bn cnh c th mc ch trn SugarCRM c bao gm nhng tp tin b
sung nh sau:
Form.php: Tp tin ny c chc nng l cho Javascript x nhn c h
ng chnh sa i s dng c nhng i
Menu.php: Tp tin ny l nhim v hin th ra c ph tt c
hin th bn tr ph trn ca m h s dng, mi menu n s lin kt vi
m h listview, hay editview t theo tng ng hp s dng
Vadefs.php: Tp tin n s nh ngha c ng d liu ca module, c
ng d liu c th nh ngha lu xung database hoc khng cho lu
xung database. Ngo ra c mi quan h gia module v module cng c th c
nh ngha y. ( c module c th c c mi quan h nh l: 1-n, n-n,1-1).
SugarBean.php: Tc '<sugar root> / d liu cha
SugarBean u c s dng. Bt k module c, vit hoc hin th
Page 14
liu s m rng l SugarBean thc hin tt c ng cho d
li i quan h, ...
1.2. T bi trong SugarCRM
c pht tri gi c s dg d khng bi v code
PHP v c th c nh ch s v giao di hoc vi thm c module n
gi c yu c c s dg. s
th ph d
V Module Buil
dg c th
ra dg ph tri
PHP m.
1.2.1.
3 trong Developer Tools
Studio -
Module Builder -
SugarCRM
Module Loader -
Page 15
Dropdown Editor -
Rename Tabs -
-
Configure Grouped modules - gom nh c module
trong SugarCRM
dg
d
4 Repair trong System
C t m 1 module trong SugarCRM d trn c cng c c s
trong trang ch c Admin. Trong SugarCRM m b d li v m
modt tn tng , ngoi ra SugarCRM c h tr cho vic t c
m quan h gi c module v nhau thng qua cng c studio y l c
h c nh thao t minh h cho vic t m c module v thi l c
m quan h gi c module v nhau.
1: T m package (package l mt g c th ch mt hoc nhi
module)
Page 16
1
To mi package
B1:
AdminModule
Builder
B2: To mi 1
package,
i.
o mi package
1: To mi mt package trong SugarCRM
c th t m c mt module trong h th th h c phi t
ra c packa ch c module c t m, module builder gi t c g
package v xu s dg c th d v di chuy khi
c nh trong SugarCRM.
ti theo sau khi t m package l s dg t c module m
c nh thi l c fields, c m quan h, c nh
Page 17
m module
2
To mi module
B1: Click new
module
B2
Module
- Module Name
- Label
- Chn Type
o mi module
2: To mi mt module trong SugarCRM
t . :
basic basic
Page 18
Module
Company ng
ng
.
fibasic
3: D studio trong module builder ti h c ch s
3
nh module
b Studio.
A. Fields
B1: Chn test1Fields
Add Fields
B2:
Fields
Save li.
B. EditView
elds
Page 19
B1: Chn test1
LayoutsEditView
- EditView
giao di
mi hoc chnh
sa m
liu vi Module
B2: Ti
nhng Fields
t a s Toolbox
sang ca s Layout
c li.
- Sau khi thit k
giao din Edit ta
chn Save.
C. DetailView
B1: Chn test1
LayoutsDetailView
- DetailView
giao din hin
th chi tit ca
mng d
liu trong
B2: Ti
Page 20
nh
a s Toolbox
sang ca s Layout
c li.
- Ca s Layout
a
nhng fields ca
DetailView ca
Module.
- Sau khi thit k
giao din Detail
ta chn Save.
D. ListView
B1: Chn test1
LayoutsListView
- ListView
din Hin th
Records trong
B2: Ti i
nhng Fields
t a s Hidden
sang ca s Available
c li.
- Sau khi thit k
Page 21
giao din List ta
chn Save.
E. Search
B1: Chn test1
LayoutsSearchBas
ic Search
- Basic Search
giao din Hin
th
s
record ca
module.
B2: Ti
nhng Fields
t a s Hidden
sang ca s Default
c li.Nh
b
cho module.
- Sau khi thit k
giao din
Search ta chn
Save.
3nh module b Studio trong module builder
V c thao t tr s dg c th thi l c m h edit view,
detail view, list view, quick create trong ph layout.
Edit view: l m h t m hoc ch s th d b
v button edit hay create c module .
Page 22
Detail view: l m h xem chi ti c thng tin.
List view: l mn h danh s c thng tin c module, c l m h
m khi ch v m module
Quick create: l m h t m c thng tin c thi c m module.
Trong module builder c h tr cho vic t giao di cho c dashlet,
popup view, search v c subpanel.
4: Deloy module
Sau khi t c c thng tin c thi cho mod s dg s
ti h Deloy hoc l Publis c th module m t th.
4
Deploy Module
nh
Module b
Studio
s d
hoc Publish
t sau.
A. Deploy
- s dng
Module Buider
Test
- n
Deploy
- Sau khi Deploy
Sugar.
-
s
d
4: D dng trong h thng SugarCRM
Page 23
i s dg
i s dg s
upload file Zip v c publish.
5: T studio
Trong ph Studio n s dg c th t c m quan h, c nh
l c nh cho c mod s dg c th t c quan h: 1-1, 1-
n, n-n tr ti thng qua cng c n.
6 gii nhau
Page 24
ch c c s dg c th t m mt modn
gin, v t c quan h gi c module trong h th m khng c hi bi
nhi code PHP. Tuy nhin n mun m r c d c h c
nh hi bi v c tr c t th m th mi c ch s su v h
th y l ph gi thi v ch ng c t th m.
uga m
Th m c
Su m
s dg.
m Custom
Vardefs : file n c d
efs trong th m custom. s
dg n mu m n
/custom/Extension/modules/<MODULE_NAME>/Ext/Vardefs/
Tuy nhin c lu v m
/custom/modules/<MODULE_NAME>/Ext/Vardefs/vardefs.ext.php
.
d Nn repair l c field
nh v nhau (Admin->Repair->Quick Repair and Rebuild).
Languages s d l th
s trong c
th m.
/custom/include/language/ (for $app_strings or $app_list_strings)
/custom/Extension/application/Ext/Include/
/custom/Extension/modules/<MODULE_NAME>/Ext/Language/ (for
$mod_strings only)
Page 25
1.2.2. T bi trong SugarCRM b code
Bean Files.
1.2.2.1.
s ki trong SugarCRM, c s ki c th
g c c action trong h th v d:
7: C code ca file logic hook
<?php
//prevents directly accessing this file from a web browser
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class AddTimeStamp {
function StampIt(& $focus, $event){