You are on page 1of 9

SUGARCRM TI LIU HNG DN TO CHART DASHLET CHO Ti liu k thut 05/2012

1|P ag e

Lch s chnh sa

Mc lc
1. Gii thiu:.............................................................................................................................................3 2. Cc thnh phn chnh..........................................................................................................................3 3. To file cu hnh ci t chart va ci vo h thng Sugarcrm.................................................7 THNG TIN LIN H H TR.........................................................................................................9

2|P ag e

1. Gii thiu: To ra mt dashlet thng k dng biu trong Sugarcrm Cu trc ca mt dashlet dng biu gm cc thnh phn sau:
-{name}.data.php :file qui nh khung search ca dashlet(khi nhn vo show popup) -{name}.en_us.lang.php :file cc text ngn ng -{name}.meta.php :file qui nh cc tham s cu hnh ca chart -{name}.php :file x l d liu ca chart -{name}.tpl :file qui inh th hin khung search ca chart

{name} :l tn ca dashlet

2. Cc thnh phn chnh

data.php:
file mu:

Vi {name} :tn ca dashlet trong file mu c 3 trng c thm vo phn search ca dashlet gm: demo_date_start,demo_date_end,v demo_employee,bn trong l mt mng cha cc cu hnh ca tham s :

3|P ag e

name: tn bin vname :tiu th hin ngoi giao din type: kiu d liu (user_name sugarcrm h tr y l compobox cha tn ca cc user trong h thng )

en_us.lang.php
file mu

Vi : {name}: tn ca dashlet v mt mng cc gi tr key v value

meta.php
file mu:

Vi: {name}:tn ca dashlet title: tiu ca dashlet description: m t icon: icon th hin khi bn add dashlet(nm trong th mc themes/default/images) module: tn ca module chart ang thng k( khi click vo biu s i xem chi tit) category: v y l dashlet chart ,nn category l Charts

4|P ag e

.php
trong file ny c nhng iu cn ch : u tin l k tha li lp DashletGenericChart, c th v li chart to cc bin ly gi tr khung search

{name} : tn ca dashlet hin thc li cn contructor

phn quan trng y l cu hnh li khung search theo mc nh th dashlet ch ly thng tin v field search trong /modules/module_name/Dashlets/classname/classname.data.php.Nn ta phi cu hnh li ng dn cha file *.data.php hin thc li hm display(),hm cu hnh th hin chart

5|P ag e

vi $sugarChart->setProperties(title,subtitle,style_chart title:Tn ca biu ) subtitle:nh l bn ch thch n v ca bn style_chart:loi biu ,Sugarcrm h tr cc loi biu sau:stacked group by chart,group by chart,bar chart,horizontal group by chart, horizontal,horizontal bar chart,pie chart,gauge chart,funnel chart 3D,line chart

$sugarChart->base_url : mng cc tham s s th hin trn url ngi dng nhn vo biu $sugarChart->getData(query) truyn vo cu query ly gi tr v chart,lu l trong cu query phi c trng total v l trng mc nh sugar_chart ly lm gi tr cho biu

.tpl
file mu

6|P ag e

Vi cc ng gch di mu l cc bin c khai bo trong file .data.php

3. To file cu hnh ci t chart va ci vo h thng Sugarcrm quy nh tn file ci t,bt buc l: manifest.php file mu :

7|P ag e

trong file mu c 2 mng: manifest :cha cc thng tin v module: 'acceptable_sugar_versions':ph hp vi nhng version no 'acceptable_sugar_flavors' : c th no(Community Edition , Professional .) 8|P ag e 'readme' :cc thng tin v module 'key' : key ca module trnh xung t vi cc module khc 'author' :tn ca tc gi vit module 'description' : thng tin m t module 'icon' :icon s th hin trong sut qu trnh ci t 'is_uninstallable' :c cho g b hay khng 'name' : tn ca module ci ln nhng bn sugar

'published_date' :ngy xut bn module 'type' :kiu (theme,module...) 'version' :phin bn

'remove_tables' :c xa cc bn d liu lin quan khng trnh mt mt d liu,'prompt' l th hin thng bo xc nhn installdefs 'id' :tn ca module,phi l duy nht 'copy' : c dng xc nh cc tp tin v th mc cn sao chp

Link tham tho: http://www.atcoresystems.com/resources/documentation/sugarcrm-manifestdevelopment-guide

CHC THNH CNG!

THNG TIN LIN H H TR


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

9|P ag e