pivots.php 172 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161
  1. <?php
  2. $config->bi->builtin->pivots = array();
  3. $config->bi->builtin->pivots[] = array
  4. (
  5. 'id' => 1000,
  6. 'version' => '1',
  7. 'name' => array('zh-cn' => '完成项目工期透视表', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  8. 'code' => 'finishedProjectDuration',
  9. 'dimension' => '2',
  10. 'driver' => 'mysql',
  11. 'group' => '86',
  12. 'createdDate' => '2009-03-14',
  13. 'sql' => <<<EOT
  14. select
  15. t1.name,
  16. t2.program1,
  17. t1.begin,
  18. t1.`end`,
  19. t1.realBegan,
  20. t1.realEnd,
  21. t1.closedDate,
  22. t1.realduration,
  23. t1.realduration - t1.planduration as duration_deviation,
  24. round((t1.realduration - t1.planduration) / t1.planduration, 3) as rate
  25. from
  26. (select
  27. name,
  28. CAST(substr(path,2,4) AS DECIMAL) as program1,
  29. begin,
  30. `end`,
  31. realBegan,
  32. realEnd,
  33. left(closedDate, 10) as closedDate,
  34. datediff(`end`, `begin`) as planduration,
  35. ifnull(if(left(`realEnd`,4) != '0000',datediff(`realEnd`,`realBegan`),datediff(`closedDate`,`realBegan`)),0) realduration
  36. from zt_project
  37. where type='project' and status='closed' and deleted='0') t1
  38. left join
  39. (select
  40. id as programid,
  41. name as program1
  42. from zt_project
  43. where type='program'
  44. and grade=1) t2
  45. on t1.program1=t2.programid;
  46. EOT
  47. ,
  48. 'settings' => array
  49. (
  50. 'columns' => array
  51. (
  52. array('field' => 'begin', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  53. array('field' => 'end', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  54. array('field' => 'realBegan', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  55. array('field' => 'realEnd', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  56. array('field' => 'closedDate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  57. array('field' => 'realduration', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  58. array('field' => 'duration_deviation', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  59. array('field' => 'rate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow')
  60. ),
  61. 'group1' => 'program1',
  62. 'group2' => 'name',
  63. 'lastStep' => '4'
  64. ),
  65. 'fields' => array
  66. (
  67. 'name' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  68. 'program1' => array('object' => 'project', 'field' => 'program1', 'type' => 'string'),
  69. 'begin' => array('object' => 'project', 'field' => 'begin', 'type' => 'date'),
  70. 'end' => array('object' => 'project', 'field' => 'end', 'type' => 'date'),
  71. 'realBegan' => array('object' => 'project', 'field' => 'realBegan', 'type' => 'date'),
  72. 'realEnd' => array('object' => 'project', 'field' => 'realEnd', 'type' => 'date'),
  73. 'closedDate' => array('object' => 'project', 'field' => 'closedDate', 'type' => 'date'),
  74. 'realduration' => array('object' => 'project', 'field' => 'realduration', 'type' => 'number'),
  75. 'duration_deviation' => array('object' => 'project', 'field' => 'duration_deviation', 'type' => 'number'),
  76. 'rate' => array('object' => 'project', 'field' => 'rate', 'type' => 'number')
  77. ),
  78. 'langs' => array
  79. (
  80. 'name' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  81. 'program1' => array('zh-cn' => '一级项目集', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  82. 'begin' => array('zh-cn' => '计划开始日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  83. 'end' => array('zh-cn' => '计划完成日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  84. 'realBegan' => array('zh-cn' => '实际开始日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  85. 'realEnd' => array('zh-cn' => '实际完成日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  86. 'closedDate' => array('zh-cn' => '关闭日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  87. 'realduration' => array('zh-cn' => '实际工期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  88. 'duration_deviation' => array('zh-cn' => '工期偏差', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  89. 'rate' => array('zh-cn' => '工期偏差率', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  90. ),
  91. 'stage' => 'published',
  92. 'builtin' => '1'
  93. );
  94. $config->bi->builtin->pivots[] = array
  95. (
  96. 'id' => 1001,
  97. 'version' => '1',
  98. 'name' => array('zh-cn' => '完成项目工时透视表', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  99. 'code' => 'finishedProjectHour',
  100. 'dimension' => '2',
  101. 'driver' => 'mysql',
  102. 'group' => '85',
  103. 'createdDate' => '2009-03-14',
  104. 'sql' => <<<EOT
  105. select
  106. t1.name as "projectname",
  107. t4.program1 as "topprogram",
  108. round(t2.estimate, 2) as "estimate",
  109. round(t2.consumed, 2) as "consumed",
  110. round(t2.consumed - t2.estimate, 2) as "deviation",
  111. round((t2.consumed - t2.estimate) / t2.estimate, 2) as "deviationrate",
  112. coalesce(t3.storys, 0) as "finishedstorys",
  113. coalesce(t3.storyestimate, 0) as "finishedstorysmate",
  114. round(coalesce(t3.storyestimate, 0) / coalesce(t2.consumed, 0), 2) as "demandsizesperunittime",
  115. t1.closedDate as "closeddate"
  116. from
  117. (
  118. select
  119. id,
  120. name,
  121. CAST(substr(`path`, 2, 4) AS DECIMAL) as program1,
  122. closedDate
  123. from zt_project
  124. where deleted = '0'
  125. and type = 'project'
  126. and status = 'closed'
  127. ) as t1
  128. left join (
  129. select
  130. project,
  131. sum(estimate) as estimate,
  132. sum(consumed) as consumed
  133. from zt_task
  134. where deleted = '0'
  135. and project != 0
  136. group by project
  137. ) as t2 on t1.id = t2.project
  138. left join (
  139. select
  140. tt3.project,
  141. count(tt3.id) as storys,
  142. sum(estimate) as storyestimate
  143. from
  144. (
  145. select
  146. tt1.id,
  147. tt1.estimate,
  148. tt2.project
  149. from zt_story tt1
  150. left join zt_projectstory tt2 on tt1.id = tt2.story
  151. where tt1.deleted = '0'
  152. and tt1.status = 'closed'
  153. and tt1.closedReason = 'done'
  154. ) tt3
  155. group by
  156. tt3.project
  157. ) t3 on t1.id = t3.project
  158. left join (
  159. select
  160. id as programid,
  161. name as program1
  162. from zt_project
  163. where type = 'program'
  164. and grade = 1
  165. ) t4 on t1.program1 = t4.programid;
  166. EOT
  167. ,
  168. 'settings' => array
  169. (
  170. 'columns' => array
  171. (
  172. array('field' => 'estimate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  173. array('field' => 'consumed', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  174. array('field' => 'deviation', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  175. array('field' => 'deviationrate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  176. array('field' => 'finishedstorys', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  177. array('field' => 'finishedstorysmate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  178. array('field' => 'demandsizesperunittime', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow')
  179. ),
  180. 'columnTotal' => 'noShow',
  181. 'group1' => 'topprogram',
  182. 'group2' => 'projectname',
  183. 'lastStep' => '4'
  184. ),
  185. 'filters' => array
  186. (
  187. array
  188. (
  189. 'field' => 'closeddate',
  190. 'type' => 'date',
  191. 'name' => '关闭日期',
  192. 'default' => array('begin' => '', 'end' => '')
  193. )
  194. ),
  195. 'fields' => array
  196. (
  197. 'projectname' => array('object' => 'project', 'field' => 'projectname', 'type' => 'string'),
  198. 'topprogram' => array('object' => 'project', 'field' => 'topprogram', 'type' => 'string'),
  199. 'estimate' => array('object' => 'project', 'field' => 'estimate', 'type' => 'number'),
  200. 'consumed' => array('object' => 'project', 'field' => 'consumed', 'type' => 'number'),
  201. 'deviation' => array('object' => 'project', 'field' => 'deviation', 'type' => 'number'),
  202. 'deviationrate' => array('object' => 'project', 'field' => 'deviationrate', 'type' => 'number'),
  203. 'finishedstorys' => array('object' => 'project', 'field' => 'deviationrate', 'type' => 'string'),
  204. 'finishedstorysmate' => array('object' => 'project', 'field' => 'finishedstorysmate', 'type' => 'number'),
  205. 'demandsizesperunittime' => array('object' => 'project', 'field' => 'demandsizesperunittime', 'type' => 'number'),
  206. 'closeddate' => array('object' => 'project', 'field' => 'closeddate', 'type' => 'date')
  207. ),
  208. 'langs' => array
  209. (
  210. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '项目名称', 'en' => 'projectname'),
  211. 'topprogram' => array('zh-cn' => '一级项目集', 'zh-tw' => '一级项目集', 'en' => 'topprogram'),
  212. 'estimate' => array('zh-cn' => '预计工时', 'zh-tw' => '预计工时', 'en' => 'estimate'),
  213. 'consumed' => array('zh-cn' => '消耗工时', 'zh-tw' => '消耗工时', 'en' => 'consumed'),
  214. 'deviation' => array('zh-cn' => '工时偏差', 'zh-tw' => '工时偏差', 'en' => 'deviation'),
  215. 'deviationrate' => array('zh-cn' => '工时偏差率', 'zh-tw' => '工时偏差率', 'en' => 'deviationrate'),
  216. 'finishedstorys' => array('zh-cn' => '完成需求数', 'zh-tw' => '完成需求数', 'en' => 'finishedstorys'),
  217. 'finishedstorysmate' => array('zh-cn' => '完成需求规模数', 'zh-tw' => '完成需求规模数', 'en' => 'finishedstorysmate'),
  218. 'demandsizesperunittime' => array('zh-cn' => '单位时间交付需求规模数', 'zh-tw' => '单位时间交付需求规模数', 'en' => 'demandsizesperunittime'),
  219. 'closeddate' => array('zh-cn' => '关闭日期', 'zh-tw' => '关闭日期', 'en' => 'closeddate')
  220. ),
  221. 'stage' => 'published',
  222. 'builtin' => '1'
  223. );
  224. $config->bi->builtin->pivots[] = array
  225. (
  226. 'id' => 1002,
  227. 'version' => '1',
  228. 'name' => array('zh-cn' => '产品缺陷数据汇总表', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  229. 'code' => 'productBugSummary',
  230. 'dimension' => '3',
  231. 'driver' => 'mysql',
  232. 'group' => '100',
  233. 'createdDate' => '2009-03-14',
  234. 'sql' => <<<EOT
  235. select
  236. t1.name as product,
  237. coalesce(t2.name, '/') as topprogram,
  238. coalesce(t3.name, '/') as productline,
  239. coalesce(t6.exfixedstorys, 0) as exfixedstorys,
  240. round(coalesce(t6.exfixedstorysmate, 0), 3) as exfixedstorysmate,
  241. coalesce(t8.storycases, 0) as storycases,
  242. round(coalesce(t8.storycases / t6.exfixedstorysmate, 0), 3) as casedensity,
  243. round(coalesce(t10.casestorys / t6.exfixedstorys, 0), 3) as casecoveragerate,
  244. coalesce(t7.bug, 0) as bugs,
  245. coalesce(t7.effbugs, 0) as effectivebugs,
  246. coalesce(t7.pri12bugs, 0) as pri12bugs,
  247. round(coalesce(t7.bug / t6.exfixedstorysmate, 0), 3) as bugdensity,
  248. coalesce(t7.fixedbugs, 0) as fixedbugs,
  249. round(coalesce(t7.fixedbugs / t7.bug, 0), 3) as fixedbugsrate
  250. from zt_product as t1
  251. left join zt_project as t2 on t1.program = t2.id
  252. and t2.type = 'program'
  253. and t2.grade = 1
  254. left join zt_module as t3 on t1.line = t3.id and t3.type = 'line'
  255. left join (
  256. select
  257. product,
  258. count(id) as exfixedstorys,
  259. sum(estimate) as exfixedstorysmate
  260. from zt_story
  261. where deleted = '0'
  262. and (stage in ('developed', 'testing', 'verified', 'released') or (status = 'closed' and closedReason = 'done'))
  263. group by product
  264. ) as t6 on t1.id = t6.product
  265. left join (
  266. select
  267. product,
  268. count(id) as bug,
  269. sum(case when resolution in ('fixed', 'postponed') or status = 'active' then 1=1 else 0 end) as effbugs,
  270. sum(case when resolution = 'fixed' then 1=1 else 0 end) as fixedbugs,
  271. sum(case when severity IN (1, 2) then 1=1 else 0 end) as pri12bugs
  272. from zt_bug
  273. where deleted = '0'
  274. group by product
  275. ) as t7 on t1.id = t7.product
  276. left join (
  277. select
  278. product,
  279. COUNT(id) as storycases
  280. from zt_case
  281. where deleted = '0'
  282. group by product
  283. ) as t8 on t1.id = t8.product
  284. left join (
  285. select
  286. tcase.product,
  287. COUNT(tcase.story) as casestorys
  288. from zt_case as tcase
  289. left join zt_story as tstory on tcase.story = tstory.id
  290. where tcase.deleted = '0'
  291. and tcase.story != '0'
  292. and tstory.deleted = '0'
  293. and (tstory.stage IN ('developed', 'testing', 'verified', 'released') OR (tstory.status = 'closed' and tstory.closedReason = 'done'))
  294. group by tcase.product
  295. ) as t10 on t1.id = t10.product
  296. where t1.deleted = '0'
  297. and t1.status != 'closed'
  298. and t1.vision = 'rnd'
  299. ORDER BY t1.order;
  300. EOT
  301. ,
  302. 'settings' => array
  303. (
  304. 'columns' => array
  305. (
  306. array('field' => 'exfixedstorys', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  307. array('field' => 'exfixedstorysmate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  308. array('field' => 'storycases', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  309. array('field' => 'casedensity', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  310. array('field' => 'casecoveragerate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  311. array('field' => 'bugs', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  312. array('field' => 'effectivebugs', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  313. array('field' => 'pri12bugs', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  314. array('field' => 'bugdensity', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  315. array('field' => 'fixedbugs', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow'),
  316. array('field' => 'fixedbugsrate', 'stat' => 'sum', 'slice' => 'noSlice', 'showMode' => 'default', 'monopolize' => '0', 'showTotal' => 'noShow')
  317. ),
  318. 'columnTotal' => 'noShow',
  319. 'group1' => 'topprogram',
  320. 'group2' => 'productline',
  321. 'group3' => 'product',
  322. 'lastStep' => '4'
  323. ),
  324. 'fields' => array
  325. (
  326. 'product' => array('object' => 'story', 'field' => 'product', 'type' => 'string'),
  327. 'topprogram' => array('object' => 'story', 'field' => 'topprogram', 'type' => 'string'),
  328. 'productline' => array('object' => 'story', 'field' => 'productline', 'type' => 'string'),
  329. 'exfixedstorys' => array('object' => 'story', 'field' => 'exfixedstorys', 'type' => 'string'),
  330. 'exfixedstorysmate' => array('object' => 'story', 'field' => 'exfixedstorysmate', 'type' => 'number'),
  331. 'storycases' => array('object' => 'story', 'field' => 'storycases', 'type' => 'string'),
  332. 'casedensity' => array('object' => 'story', 'field' => 'casedensity', 'type' => 'number'),
  333. 'casecoveragerate' => array('object' => 'story', 'field' => 'casecoveragerate', 'type' => 'number'),
  334. 'bugs' => array('object' => 'story', 'field' => 'bugs', 'type' => 'string'),
  335. 'effectivebugs' => array('object' => 'story', 'field' => 'effectviebugs', 'type' => 'number'),
  336. 'pri12bugs' => array('object' => 'story', 'field' => 'pri12bugs', 'type' => 'number'),
  337. 'bugdensity' => array('object' => 'story', 'field' => 'bugdensity', 'type' => 'number'),
  338. 'fixedbugs' => array('object' => 'story', 'field' => 'fixedbugs', 'type' => 'number'),
  339. 'fixedbugsrate' => array('object' => 'story', 'field' => 'fixedbugsrate', 'type' => 'number')
  340. ),
  341. 'langs' => array
  342. (
  343. 'product' => array('zh-cn' => '产品', 'zh-tw' => '产品', 'en' => 'product'),
  344. 'topprogram' => array('zh-cn' => '一级项目集', 'zh-tw' => '一级项目集', 'en' => 'topprogram'),
  345. 'productline' => array('zh-cn' => '产品线', 'zh-tw' => '产品线', 'en' => 'productline'),
  346. 'exfixedstorys' => array('zh-cn' => '研发完成需求数', 'zh-tw' => '研发完成需求数', 'en' => 'exfixedstorys'),
  347. 'exfixedstorysmate' => array('zh-cn' => '研发完成需求规模数', 'zh-tw' => '研发完成需求规模数', 'en' => 'exfixedstorysmate'),
  348. 'storycases' => array('zh-cn' => '需求用例数', 'zh-tw' => '需求用例数', 'en' => 'storycases'),
  349. 'casedensity' => array('zh-cn' => '用例密度', 'zh-tw' => '用例密度', 'en' => 'casedensity'),
  350. 'casecoveragerate' => array('zh-cn' => '用例覆盖率', 'zh-tw' => '用例覆盖率', 'en' => 'casecoveragerate'),
  351. 'bugs' => array('zh-cn' => 'Bug数', 'zh-tw' => 'Bug数', 'en' => 'bugs'),
  352. 'effectivebugs' => array('zh-cn' => '有效Bug数', 'zh-tw' => '有效Bug数', 'en' => 'effectviebugs'),
  353. 'pri12bugs' => array('zh-cn' => '优先级为1,2的Bug数', 'zh-tw' => '优先级为1,2的Bug数', 'en' => 'pri12bugs'),
  354. 'bugdensity' => array('zh-cn' => 'Bug密度', 'zh-tw' => 'Bug密度', 'en' => 'bugdensity'),
  355. 'fixedbugs' => array('zh-cn' => '修复Bug数', 'zh-tw' => '修复Bug数', 'en' => 'fixedbugs'),
  356. 'fixedbugsrate' => array('zh-cn' => 'Bug修复率', 'zh-tw' => 'Bug修复率', 'en' => 'fixedbugsrate')
  357. ),
  358. 'stage' => 'published',
  359. 'builtin' => '1'
  360. );
  361. $config->bi->builtin->pivots[] = array
  362. (
  363. 'id' => 1003,
  364. 'version' => '1',
  365. 'name' => array('zh-cn' => '产品需求交付统计表', 'zh-tw' => '產品完成度統計表', 'en' => 'Product Progress', 'de' => 'Product Progress', 'fr' => 'Product Progress'),
  366. 'code' => 'productProgress',
  367. 'desc' => array('zh-cn' => '按照产品列出需求总数,交付的需求总数(状态是关闭且关闭原因为已完成,或者研发阶段是已发布的需求)。', 'zh-tw' => '按照產品列出需求總數,完成的總數(狀態是關閉,或者研發階段是發布),完成的百分比。', 'en' => 'Number of total stories,done stories(state is closed, or stage is released), percent of completion.', 'de' => 'Number of total stories,done stories(state is closed, or stage is released), percent of completion.', 'fr' => 'Number of total stories,done stories(state is closed, or stage is released), percent of completion.'),
  368. 'dimension' => '1',
  369. 'driver' => 'mysql',
  370. 'group' => '59',
  371. 'createdDate' => '2009-03-14',
  372. 'sql' => <<<EOT
  373. select
  374. t1.product,
  375. t2.name,
  376. (case when t1.closedReason = 'done' or t1.stage = 'released' then 1=1 else 1=0 end) as done,
  377. 1 as count from zt_story as t1
  378. left join zt_product as t2 on t1.product=t2.id
  379. left join zt_project as t3 on t2.program=t3.id
  380. where t1.deleted='0'
  381. and t2.deleted='0'
  382. and t2.shadow='0'
  383. and (case when \$productStatus='' then 1=1 else t2.status=\$productStatus end)
  384. and (case when \$productType='' then 1=1 else t2.type=\$productType end)
  385. and (case when \$product='' then 1=1 else t2.id=\$product end)
  386. order by t3.`order` asc, t2.line desc, t2.`order` asc
  387. EOT
  388. ,
  389. 'settings' => array
  390. (
  391. 'summary' => 'use',
  392. 'group1' => 'product',
  393. 'columns' => array
  394. (
  395. array('field' => 'done', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  396. array('field' => 'count', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  397. ),
  398. 'columnTotal' => 'sum'
  399. ),
  400. 'filters' => array
  401. (
  402. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  403. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  404. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  405. ),
  406. 'fields' => array
  407. (
  408. 'product' => array('object' => 'product', 'field' => 'name', 'type' => 'object'),
  409. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string'),
  410. 'done' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  411. 'count' => array('object' => 'project', 'field' => '', 'type' => 'number')
  412. ),
  413. 'langs' => array
  414. (
  415. 'product' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  416. 'name' => array('zh-cn' => 'name', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  417. 'done' => array('zh-cn' => '交付需求数', 'zh-tw' => '交付需求数', 'en' => 'delivery', 'de' => '', 'fr' => ''),
  418. 'count' => array('zh-cn' => '需求数', 'zh-tw' => '需求数', 'en' => 'Stories', 'de' => '', 'fr' => '')
  419. ),
  420. 'vars' => array(),
  421. 'drills' => array
  422. (
  423. array
  424. (
  425. 'field' => 'done',
  426. 'object' => 'story',
  427. 'whereSql' => "WHERE t1.deleted='0' and t1.closedReason = 'done' or t1.stage = 'released'",
  428. 'condition' => array
  429. (
  430. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product')
  431. )
  432. ),
  433. array
  434. (
  435. 'field' => 'count',
  436. 'object' => 'story',
  437. 'whereSql' => "WHERE t1.deleted='0' ",
  438. 'condition' => array
  439. (
  440. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product')
  441. )
  442. )
  443. ),
  444. 'stage' => 'published',
  445. 'builtin' => '1'
  446. );
  447. $config->bi->builtin->pivots[] = array
  448. (
  449. 'id' => 1004,
  450. 'version' => '1',
  451. 'name' => array('zh-cn' => '产品需求状态分布表', 'zh-tw' => '產品需求狀態分布表', 'en' => 'Story Status', 'de' => 'Story Status', 'fr' => 'Story Status'),
  452. 'code' => 'productStoryStatus',
  453. 'desc' => array('zh-cn' => '按照产品列出需求总数,状态的分布情况。', 'zh-tw' => '按照產品列出需求總數,狀態的分布情況。', 'en' => 'Total number and status distribution of stories.', 'de' => 'Total number and status distribution of stories.', 'fr' => 'Total number and status distribution of stories.'),
  454. 'dimension' => '1',
  455. 'driver' => 'mysql',
  456. 'group' => '59',
  457. 'createdDate' => '2009-03-14',
  458. 'sql' => <<<EOT
  459. select
  460. t1.product, t1.status,
  461. t2.name
  462. from zt_story as t1
  463. left join zt_product as t2 on t1.product=t2.id
  464. left join zt_project as t3 on t2.program=t3.id
  465. where t1.deleted='0'
  466. and t2.deleted='0'
  467. and t2.shadow='0'
  468. and (case when \$productStatus='' then 1=1 else t2.status=\$productStatus end)
  469. and (case when \$productType='' then 1=1 else t2.type=\$productType end)
  470. and (case when \$product='' then 1=1 else t2.id=\$product end)
  471. order by t3.`order` asc, t2.line desc, t2.`order` asc
  472. EOT
  473. ,
  474. 'settings' => array
  475. (
  476. 'group1' => 'product',
  477. 'columnTotal' => 'sum',
  478. 'columns' => array
  479. (
  480. array('field' => 'status', 'slice' => 'status', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0, 'summary' => 'use')
  481. )
  482. ),
  483. 'filters' => array
  484. (
  485. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  486. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  487. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  488. ),
  489. 'fields' => array
  490. (
  491. 'product' => array('object' => 'product', 'field' => 'name', 'type' => 'object'),
  492. 'status' => array('object' => 'story', 'field' => 'status', 'type' => 'option'),
  493. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string')
  494. ),
  495. 'langs' => array
  496. (
  497. 'product' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  498. 'status' => array('zh-cn' => '不同状态需求', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  499. 'name' => array('zh-cn' => 'name', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  500. ),
  501. 'vars' => array(),
  502. 'drills' => array
  503. (
  504. array
  505. (
  506. 'field' => 'status',
  507. 'object' => 'story',
  508. 'whereSql' => "WHERE t1.deleted='0' ",
  509. 'condition' => array
  510. (
  511. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product'),
  512. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'status', 'queryField' => 'status')
  513. )
  514. )
  515. ),
  516. 'stage' => 'published',
  517. 'builtin' => '1'
  518. );
  519. $config->bi->builtin->pivots[] = array
  520. (
  521. 'id' => 1005,
  522. 'version' => '1',
  523. 'name' => array('zh-cn' => '产品需求阶段分布表', 'zh-tw' => '產品需求階段分布表', 'en' => 'Story Stage', 'de' => 'Story Stage', 'fr' => 'Story Stage'),
  524. 'code' => 'productStoryStage',
  525. 'desc' => array('zh-cn' => '按照产品列出需求总数,研发阶段的分布情况。', 'zh-tw' => '按照產品列出需求總數,研發階段的分布情況。', 'en' => 'Total number and stage distribution of stories ', 'de' => 'Total number and stage distribution of stories ', 'fr' => 'Total number and stage distribution of stories '),
  526. 'dimension' => '1',
  527. 'driver' => 'mysql',
  528. 'group' => '59',
  529. 'createdDate' => '2009-03-14',
  530. 'sql' => <<<EOT
  531. select
  532. t1.product, t1.stage,
  533. t2.name
  534. from zt_story as t1
  535. left join zt_product as t2 on t1.product=t2.id
  536. left join zt_project as t3 on t2.program=t3.id
  537. where t1.deleted='0'
  538. and t2.deleted='0'
  539. and t2.shadow='0'
  540. and (case when \$productStatus='' then 1=1 else t2.status=\$productStatus end)
  541. and (case when \$productType='' then 1=1 else t2.type=\$productType end)
  542. and (case when \$product='' then 1=1 else t2.id=\$product end)
  543. order by t3.`order` asc, t2.line desc, t2.`order` asc
  544. EOT
  545. ,
  546. 'settings' => array
  547. (
  548. 'group1' => 'product',
  549. 'columnTotal' => 'sum',
  550. 'columns' => array
  551. (
  552. array('field' => 'stage', 'slice' => 'stage', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0)
  553. ),
  554. 'summary' => 'use'
  555. ),
  556. 'filters' => array
  557. (
  558. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  559. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  560. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  561. ),
  562. 'fields' => array
  563. (
  564. 'product' => array('object' => 'product', 'field' => 'name', 'type' => 'object'),
  565. 'stage' => array('object' => 'story', 'field' => 'stage', 'type' => 'option'),
  566. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string')
  567. ),
  568. 'langs' => array
  569. (
  570. 'product' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  571. 'stage' => array('zh-cn' => '不同阶段需求', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  572. 'name' => array('zh-cn' => 'name', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  573. ),
  574. 'vars' => array(),
  575. 'drills' => array
  576. (
  577. array
  578. (
  579. 'field' => 'stage',
  580. 'object' => 'story',
  581. 'whereSql' => "WHERE t1.deleted='0' ",
  582. 'condition' => array
  583. (
  584. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product'),
  585. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'stage', 'queryField' => 'stage')
  586. )
  587. )
  588. ),
  589. 'stage' => 'published',
  590. 'builtin' => '1'
  591. );
  592. $config->bi->builtin->pivots[] = array
  593. (
  594. 'id' => 1006,
  595. 'version' => '1',
  596. 'name' => array('zh-cn' => '产品发布数量统计表', 'zh-tw' => '產品發布數量統計表', 'en' => 'Product Release', 'de' => 'Product Release', 'fr' => 'Product Release'),
  597. 'code' => 'productRelease',
  598. 'desc' => array('zh-cn' => '按照产品列出发布的数量。', 'zh-tw' => '按照產品列出發布的數量。', 'en' => 'Product Release.', 'de' => 'Product Release.', 'fr' => 'Product Release.'),
  599. 'dimension' => '1',
  600. 'driver' => 'mysql',
  601. 'group' => '59',
  602. 'createdDate' => '2009-03-14',
  603. 'sql' => <<<EOT
  604. select
  605. t1.product,
  606. t2.name,
  607. 1 as releases
  608. from zt_release as t1
  609. left join zt_product as t2 on t1.product=t2.id
  610. left join zt_project as t3 on t2.program=t3.id
  611. where t1.deleted='0'
  612. and t2.deleted='0'
  613. and t2.shadow='0'
  614. and (case when \$productStatus='' then 1=1 else t2.status=\$productStatus end)
  615. and (case when \$productType='' then 1=1 else t2.type=\$productType end)
  616. and (case when \$product='' then 1=1 else t2.id=\$product end)
  617. order by t3.`order` asc, t2.line desc, t2.`order` asc
  618. EOT
  619. ,
  620. 'settings' => array
  621. (
  622. 'summary' => 'use',
  623. 'group1' => 'product',
  624. 'columns' => array
  625. (
  626. array('field' => 'releases', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  627. ),
  628. 'columnTotal' => 'sum'
  629. ),
  630. 'filters' => array
  631. (
  632. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  633. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  634. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  635. ),
  636. 'fields' => array
  637. (
  638. 'product' => array('object' => 'product', 'field' => 'name', 'type' => 'object'),
  639. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string'),
  640. 'releases' => array('object' => 'product', 'field' => '', 'type' => 'number')
  641. ),
  642. 'langs' => array
  643. (
  644. 'product' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  645. 'name' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  646. 'releases' => array('zh-cn' => '发布', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  647. ),
  648. 'vars' => array(),
  649. 'drills' => array
  650. (
  651. array
  652. (
  653. 'field' => 'releases',
  654. 'object' => 'release',
  655. 'whereSql' => "WHERE t1.deleted='0' ",
  656. 'condition' => array
  657. (
  658. array('drillObject' => 'zt_release', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product')
  659. )
  660. )
  661. ),
  662. 'stage' => 'published',
  663. 'builtin' => '1'
  664. );
  665. $config->bi->builtin->pivots[] = array
  666. (
  667. 'id' => 1007,
  668. 'version' => '1',
  669. 'name' => array('zh-cn' => '任务状态统计表', 'zh-tw' => '任務狀態統計表', 'en' => 'Task Status Report', 'de' => 'Task Status Report', 'fr' => 'Task Status Report', 'vi' => 'Task Status Report', 'ja' => 'Task Status Report'),
  670. 'code' => 'taskStatus',
  671. 'desc' => array('zh-cn' => '按照执行统计任务的状态分布情况。', 'zh-tw' => '按照執行統計任務的狀態分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  672. 'dimension' => '1',
  673. 'driver' => 'mysql',
  674. 'group' => '60',
  675. 'createdDate' => '2009-03-14',
  676. 'sql' => <<<EOT
  677. select
  678. t1.project,
  679. t3.name as projectname,
  680. t2.status,
  681. t1.name as executionname,
  682. t1.status as executionstatus,
  683. t2.execution as execution,
  684. t2.id as taskID,
  685. (case when cast(t2.deadline as date) < current_date()
  686. and t2.deadline is not null
  687. and t2.status != 'closed'
  688. and t2.status != 'done'
  689. and t2.status != 'cancel' then 1=1 else 0 end
  690. ) as timeout
  691. from zt_project as t1
  692. left join zt_task as t2 on t1.id=t2.execution
  693. left join zt_project as t3 on t3.id=t1.project
  694. where t1.deleted='0'
  695. and t1.type in ('sprint','stage')
  696. and t2.deleted='0'
  697. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  698. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  699. and (case when \$project='' then 1=1 else t3.id=\$project end)
  700. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  701. and (case when \$beginDate='' then 1=1 else t1.begin>=cast(\$beginDate as date) end)
  702. and (case when \$endDate='' then 1=1 else t1.end<=cast(\$endDate as date) end)
  703. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$beginDate='' and \$endDate='')
  704. EOT
  705. ,
  706. 'settings' => array
  707. (
  708. 'summary' => 'use',
  709. 'columns' => array
  710. (
  711. array('field' => 'taskID', 'slice' => 'status', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  712. ),
  713. 'columnTotal' => 'sum',
  714. 'group1' => 'projectname',
  715. 'group2' => 'executionname'
  716. ),
  717. 'filters' => array
  718. (
  719. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  720. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  721. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  722. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0'),
  723. array('from' => 'query', 'field' => 'beginDate', 'name' => '执行起始日期', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  724. array('from' => 'query', 'field' => 'endDate', 'name' => '执行结束日期', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY')
  725. ),
  726. 'fields' => array
  727. (
  728. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  729. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  730. 'status' => array('object' => 'task', 'field' => 'status', 'type' => 'option'),
  731. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  732. 'execution' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  733. 'taskID' => array('object' => 'task', 'field' => '', 'type' => 'object'),
  734. 'executionstatus' => array('object' => 'task', 'field' => '', 'type' => 'object'),
  735. 'timeout' => array('object' => 'task', 'field' => '', 'type' => 'number')
  736. ),
  737. 'langs' => array
  738. (
  739. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  740. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  741. 'status' => array('zh-cn' => '任务状态', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  742. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  743. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  744. 'taskID' => array('zh-cn' => '不同状态任务', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  745. 'executionstatus' => array('zh-cn' => 'executionstatus', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  746. 'timeout' => array('zh-cn' => 'timeout', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  747. ),
  748. 'vars' => array
  749. (
  750. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution', 'beginDate', 'endDate'),
  751. 'showName' => array('项目列表', '执行列表', '项目状态', '执行状态', '执行起始日期', '执行结束日期'),
  752. 'requestType' => array('select', 'select','select', 'select', 'date', 'date'),
  753. 'selectList' => array('project.status', 'execution.status', 'project', 'execution', '', ''),
  754. 'default' => array('doing', 'doing', '', '', '$MONTHBEGIN', '$MONTHEND')
  755. ),
  756. 'drills' => array
  757. (
  758. array
  759. (
  760. 'field' => 'taskID',
  761. 'object' => 'task',
  762. 'whereSql' => "left join zt_project t2 on t1.execution=t2.id left join zt_project as t3 on t3.id=t2.project WHERE t1.deleted='0'",
  763. 'condition' => array
  764. (
  765. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  766. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname'),
  767. array('drillObject' => 'zt_task', 'drillAlias' => 't1', 'drillField' => 'status', 'queryField' => 'status')
  768. )
  769. )
  770. ),
  771. 'stage' => 'published',
  772. 'builtin' => '1'
  773. );
  774. $config->bi->builtin->pivots[] = array
  775. (
  776. 'id' => 1008,
  777. 'version' => '1',
  778. 'name' => array('zh-cn' => '任务类型统计表', 'zh-tw' => '任務類型統計表', 'en' => 'Task Type Report', 'de' => 'Task Type Report', 'fr' => 'Task Type Report', 'vi' => 'Task Type Report', 'ja' => 'Task Type Report'),
  779. 'code' => 'taskType',
  780. 'desc' => array('zh-cn' => '按照项目统计任务的类型分布情况。', 'zh-tw' => '按照項目統計任務的類型分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  781. 'dimension' => '1',
  782. 'driver' => 'mysql',
  783. 'group' => '60',
  784. 'createdDate' => '2009-03-14',
  785. 'sql' => <<<EOT
  786. select
  787. t1.id,
  788. t3.name as projectname,
  789. t3.id as project,
  790. t1.name as executionname,
  791. t1.status as executionstatus,
  792. t1.id as execution,
  793. t2.type,
  794. t2.id as taskID
  795. from zt_project as t1
  796. left join zt_task as t2 on t1.id=t2.execution
  797. left join zt_project as t3 on t3.id=t1.project
  798. where t1.deleted='0'
  799. and t1.type in ('sprint','stage')
  800. and t2.deleted='0'
  801. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  802. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  803. and (case when \$project='' then 1=1 else t3.id=\$project end)
  804. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  805. and (case when \$beginDate='' then 1=1 else t1.begin>=cast(\$beginDate as date) end)
  806. and (case when \$endDate='' then 1=1 else t1.end<=cast(\$endDate as date) end)
  807. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$beginDate='' and \$endDate='')
  808. EOT
  809. ,
  810. 'settings' => array
  811. (
  812. 'summary' => 'use',
  813. 'columns' => array
  814. (
  815. array('field' => 'taskID', 'slice' => 'type', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  816. ),
  817. 'columnTotal' => 'sum',
  818. 'group1' => 'projectname',
  819. 'group2' => 'executionname'
  820. ),
  821. 'filters' => array
  822. (
  823. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  824. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  825. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  826. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0'),
  827. array('from' => 'query', 'field' => 'beginDate', 'name' => '执行起始日期', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  828. array('from' => 'query', 'field' => 'endDate', 'name' => '执行结束日期', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY')
  829. ),
  830. 'fields' => array
  831. (
  832. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  833. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  834. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  835. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  836. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'object'),
  837. 'type' => array('object' => 'task', 'field' => 'type', 'type' => 'option'),
  838. 'taskID' => array('object' => 'task', 'field' => '', 'type' => 'object'),
  839. 'executionstatus' => array('object' => 'task', 'field' => '', 'type' => 'object')
  840. ),
  841. 'langs' => array
  842. (
  843. 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  844. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  845. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  846. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  847. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  848. 'type' => array('zh-cn' => '任务类型', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  849. 'taskID' => array('zh-cn' => '不同类型任务', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  850. 'executionstatus' => array('zh-cn' => 'executionstatus', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  851. ),
  852. 'vars' => array
  853. (
  854. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution', 'beginDate', 'endDate'),
  855. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表', '执行起始日期', '执行结束日期'),
  856. 'requestType' => array('select', 'select', 'select', 'select', 'date', 'date'),
  857. 'selectList' => array('project.status', 'execution.status', 'project', 'execution', 'user', 'user'),
  858. 'default' => array('doing', 'doing', '', '', '$MONTHBEGIN', '$MONTHEND')
  859. ),
  860. 'drills' => array
  861. (
  862. array
  863. (
  864. 'field' => 'taskID',
  865. 'object' => 'task',
  866. 'whereSql' => "left join zt_project t2 on t1.execution=t2.id left join zt_project as t3 on t3.id=t2.project WHERE t1.deleted='0'",
  867. 'condition' => array
  868. (
  869. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  870. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname'),
  871. array('drillObject' => 'zt_task', 'drillAlias' => 't1', 'drillField' => 'type', 'queryField' => 'type')
  872. )
  873. )
  874. ),
  875. 'stage' => 'published',
  876. 'builtin' => '1'
  877. );
  878. $config->bi->builtin->pivots[] = array
  879. (
  880. 'id' => 1009,
  881. 'version' => '1',
  882. 'name' => array('zh-cn' => '项目任务指派统计表', 'zh-tw' => '項目任務指派統計表', 'en' => 'Task Assign Report', 'de' => 'Task Assign Report', 'fr' => 'Task Assign Report', 'vi' => 'Task Assign Report', 'ja' => 'Task Assign Report'),
  883. 'code' => 'projectTaskAssign',
  884. 'desc' => array('zh-cn' => '按照项目统计任务的指派给分布情况。', 'zh-tw' => '按照項目統計任務的指派給分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  885. 'dimension' => '1',
  886. 'driver' => 'mysql',
  887. 'group' => '60',
  888. 'createdDate' => '2009-03-14',
  889. 'sql' => <<<EOT
  890. select
  891. t1.id,
  892. t4.name as projectname,
  893. t4.id as project,
  894. t1.name as executionname,
  895. t2.execution as execution,
  896. (case when t3.account is not null then t3.account else t2.assignedTo end) as assignedTo,
  897. t2.id as taskID,
  898. t1.status as executionstatus
  899. from zt_project as t1
  900. left join zt_task as t2 on t1.id=t2.execution
  901. left join zt_team as t3 on t3.type='task' and t3.root=t2.id
  902. left join zt_project as t4 on t1.project=t4.id
  903. where t1.deleted='0'
  904. and t1.type in ('sprint','stage')
  905. and t2.deleted='0'
  906. and (case when \$projectStatus='' then 1=1 else t4.status=\$projectStatus end)
  907. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  908. and (case when \$project='' then 1=1 else t4.id=\$project end)
  909. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  910. and (case when \$beginDate='' then 1=1 else t1.begin>=cast(\$beginDate as date) end)
  911. and (case when \$endDate='' then 1=1 else t1.end<=cast(\$endDate as date) end)
  912. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$beginDate='' and \$endDate = '')
  913. EOT
  914. ,
  915. 'settings' => array
  916. (
  917. 'summary' => 'use',
  918. 'columns' => array
  919. (
  920. array('field' => 'taskID', 'slice' => 'assignedTo', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  921. ),
  922. 'columnTotal' => 'sum',
  923. 'group1' => 'projectname',
  924. 'group2' => 'executionname'
  925. ),
  926. 'filters' => array
  927. (
  928. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  929. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  930. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  931. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0'),
  932. array('from' => 'query', 'field' => 'beginDate', 'name' => '执行起始日期', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  933. array('from' => 'query', 'field' => 'endDate', 'name' => '执行结束日期', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY')
  934. ),
  935. 'fields' => array
  936. (
  937. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  938. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  939. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  940. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  941. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'object'),
  942. 'assignedTo' => array('object' => 'task', 'field' => 'assignedTo', 'type' => 'user'),
  943. 'taskID' => array('object' => 'team', 'field' => '', 'type' => 'number'),
  944. 'executionstatus' => array('object' => 'project', 'field' => 'status', 'type' => 'option')
  945. ),
  946. 'langs' => array
  947. (
  948. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  949. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  950. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  951. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  952. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  953. 'assignedTo' => array('zh-cn' => '指派给', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  954. 'taskID' => array('zh-cn' => '人员被指派任务', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  955. 'executionstatus' => array('zh-cn' => 'executionstatus', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  956. ),
  957. 'vars' => array
  958. (
  959. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution', 'beginDate', 'endDate'),
  960. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表', '执行起始日期', '执行结束日期'),
  961. 'requestType' => array('select', 'select', 'select', 'select', 'date', 'date'),
  962. 'selectList' => array('project.status', 'execution.status', 'project', 'execution', 'user', 'user'),
  963. 'default' => array('doing', 'doing', '', '', '$MONTHBEGIN', '$MONTHEND')
  964. ),
  965. 'drills' => array
  966. (
  967. array
  968. (
  969. 'field' => 'taskID',
  970. 'object' => 'task',
  971. 'whereSql' => "left join zt_project t2 on t1.execution=t2.id left join zt_project as t3 on t2.project=t3.id WHERE t1.deleted='0'",
  972. 'condition' => array
  973. (
  974. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  975. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname'),
  976. array('drillObject' => 'zt_task', 'drillAlias' => 't1', 'drillField' => 'assignedTo', 'queryField' => 'assignedTo')
  977. )
  978. )
  979. ),
  980. 'stage' => 'published',
  981. 'builtin' => '1'
  982. );
  983. $config->bi->builtin->pivots[] = array
  984. (
  985. 'id' => 1010,
  986. 'version' => '1',
  987. 'name' => array('zh-cn' => '项目任务完成者统计表', 'zh-tw' => '項目任務完成者統計表', 'en' => 'Task Finish Report', 'de' => 'Task Finish Report', 'fr' => 'Task Finish Report', 'vi' => 'Task Finish Report', 'ja' => 'Task Finish Report'),
  988. 'code' => 'projectTaskFinished',
  989. 'desc' => array('zh-cn' => '按照项目统计任务的完成者分布情况。', 'zh-tw' => '按照項目統計任務的完成者分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  990. 'dimension' => '1',
  991. 'driver' => 'mysql',
  992. 'group' => '60',
  993. 'createdDate' => '2009-03-14',
  994. 'sql' => <<<EOT
  995. select
  996. t1.id,
  997. t3.name as projectname,
  998. t3.id as project,
  999. t1.name as executionname,
  1000. t2.execution as execution,
  1001. t2.finishedBy,
  1002. t2.id as taskID,
  1003. t1.status as executionstatus
  1004. from zt_project as t1
  1005. left join zt_task as t2 on t1.id=t2.execution
  1006. left join zt_project as t3 on t1.project=t3.id
  1007. left join zt_user as t4 on t2.finishedBy=t4.account
  1008. where t1.deleted='0'
  1009. and t1.type in ('sprint','stage')
  1010. and t2.deleted='0'
  1011. and t2.finishedBy!=''
  1012. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  1013. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1014. and (case when \$project='' then 1=1 else t3.id=\$project end)
  1015. and (case when \$dept='' then 1=1 else t4.dept=\$dept end)
  1016. and (case when \$user='' then 1=1 else t2.finishedBy=\$user end)
  1017. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='' and \$dept='' and \$user='')
  1018. EOT
  1019. ,
  1020. 'settings' => array
  1021. (
  1022. 'summary' => 'use',
  1023. 'columns' => array
  1024. (
  1025. array('field' => 'taskID', 'slice' => 'finishedBy', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1026. ),
  1027. 'columnTotal' => 'sum',
  1028. 'group1' => 'projectname',
  1029. 'group2' => 'executionname'
  1030. ),
  1031. 'filters' => array
  1032. (
  1033. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1034. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1035. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1036. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0'),
  1037. array('from' => 'query', 'field' => 'dept', 'name' => '完成者所在部门', 'type' => 'select', 'typeOption' => 'dept', 'default' => '0'),
  1038. array('from' => 'query', 'field' => 'user', 'name' => '完成者', 'type' => 'select', 'typeOption' => 'user', 'default' => '0')
  1039. ),
  1040. 'fields' => array
  1041. (
  1042. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1043. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1044. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1045. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1046. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'object'),
  1047. 'finishedBy' => array('object' => 'task', 'field' => 'finishedBy', 'type' => 'user'),
  1048. 'taskID' => array('object' => 'task', 'field' => '', 'type' => 'number'),
  1049. 'executionstatus' => array('object' => 'task', 'field' => '', 'type' => 'string')
  1050. ),
  1051. 'langs' => array
  1052. (
  1053. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1054. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1055. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1056. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1057. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1058. 'finishedBy' => array('zh-cn' => '由谁完成', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1059. 'taskID' => array('zh-cn' => '不同完成者完成的任务', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1060. 'executionstatus' => array('zh-cn' => 'executionstatus', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1061. ),
  1062. 'vars' => array
  1063. (
  1064. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution', 'beginDate', 'endDate'),
  1065. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表', '执行起始日期', '执行结束日期'),
  1066. 'requestType' => array('select', 'select', 'select', 'select', 'date', 'date'),
  1067. 'selectList' => array('project.status', 'execution.status', 'project', 'execution', 'user', 'user'),
  1068. 'default' => array('doing', 'doing', '', '', '$MONTHBEGIN', '$MONTHEND')
  1069. ),
  1070. 'drills' => array
  1071. (
  1072. array
  1073. (
  1074. 'field' => 'taskID',
  1075. 'object' => 'task',
  1076. 'whereSql' => "left join zt_project t2 on t1.execution=t2.id left join zt_user t3 on t1.finishedBy=t3.account WHERE t1.deleted='0' AND t1.finishedBy!=''",
  1077. 'condition' => array
  1078. (
  1079. array('drillObject' => 'zt_task', 'drillAlias' => 't1', 'drillField' => 'finishedBy', 'queryField' => 'finishedBy'),
  1080. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname')
  1081. )
  1082. )
  1083. ),
  1084. 'stage' => 'published',
  1085. 'builtin' => '1'
  1086. );
  1087. $config->bi->builtin->pivots[] = array
  1088. (
  1089. 'id' => 1011,
  1090. 'version' => '1',
  1091. 'name' => array('zh-cn' => '项目投入统计表', 'zh-tw' => '項目投入統計表', 'en' => 'Project Invest Report', 'de' => 'Project Invest Report', 'fr' => 'Project Invest Report', 'vi' => 'Project Invest Report', 'ja' => 'Project Invest Report'),
  1092. 'code' => 'projectInvested',
  1093. 'desc' => array('zh-cn' => '按照项目列出:任务数,需求数,人数,总消耗工时。', 'zh-tw' => '按照項目列出:任務數,需求數,人數,總消耗工時。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1094. 'dimension' => '1',
  1095. 'driver' => 'mysql',
  1096. 'group' => '60',
  1097. 'createdDate' => '2009-03-14',
  1098. 'sql' => <<<EOT
  1099. select
  1100. t1.id,
  1101. t5.name as projectname,
  1102. t5.id as project,
  1103. t1.name as executionname,
  1104. t2.execution as execution,
  1105. concat(t1.begin,' ~ ',t1.end) as timeLimit,
  1106. t2.teams,
  1107. t3.stories,
  1108. round(t4.consumed,1) as consumed,
  1109. t4.number,
  1110. t1.status as executionstatus
  1111. from zt_project as t1
  1112. left join ztv_projectteams as t2 on t1.id=t2.execution
  1113. left join ztv_projectstories as t3 on t1.id=t3.execution
  1114. left join ztv_executionsummary as t4 on t1.id=t4.execution
  1115. left join zt_project as t5 on t1.project=t5.id
  1116. where t1.deleted='0'
  1117. and t1.type in ('sprint','stage')
  1118. and (case when \$projectStatus='' then 1=1 else t5.status=\$projectStatus end)
  1119. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1120. and (case when \$project='' then 1=1 else t5.id=\$project end)
  1121. and (case when \$beginDate='' then 1=1 else t1.begin>=cast(\$beginDate as date) end)
  1122. and (case when \$endDate='' then 1=1 else t1.end<=cast(\$endDate as date) end)
  1123. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$beginDate='' and \$endDate='')
  1124. EOT
  1125. ,
  1126. 'settings' => array
  1127. (
  1128. 'summary' => 'use',
  1129. 'columns' => array
  1130. (
  1131. array('field' => 'number', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1132. array('field' => 'stories', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1133. array('field' => 'teams', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1134. array('field' => 'consumed', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1135. ),
  1136. 'columnTotal' => 'sum',
  1137. 'group1' => 'projectname',
  1138. 'group2' => 'executionname'
  1139. ),
  1140. 'filters' => array
  1141. (
  1142. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1143. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1144. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1145. array('from' => 'query', 'field' => 'beginDate', 'name' => '执行起始日期', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  1146. array('from' => 'query', 'field' => 'endDate', 'name' => '执行结束日期', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY')
  1147. ),
  1148. 'fields' => array
  1149. (
  1150. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1151. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1152. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1153. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1154. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'object'),
  1155. 'timeLimit' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1156. 'teams' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1157. 'stories' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1158. 'consumed' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1159. 'number' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1160. 'executionstatus' => array('object' => 'project', 'field' => '', 'type' => 'object')
  1161. ),
  1162. 'langs' => array
  1163. (
  1164. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1165. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1166. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1167. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1168. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1169. 'timeLimit' => array('zh-cn' => '工期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1170. 'teams' => array('zh-cn' => '人数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1171. 'stories' => array('zh-cn' => '需求数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1172. 'consumed' => array('zh-cn' => '总消耗', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1173. 'number' => array('zh-cn' => '任务数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1174. 'executionstatus' => array('zh-cn' => 'executionstatus', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1175. ),
  1176. 'vars' => array
  1177. (
  1178. 'varName' => array('projectStatus', 'executionStatus', 'project', 'beginDate', 'endDate'),
  1179. 'showName' => array('项目状态', '执行状态', '项目列表', '执行起始日期', '执行结束日期'),
  1180. 'requestType' => array('select', 'select', 'select', 'date', 'date'),
  1181. 'selectList' => array('project.status', 'execution.status', 'project', '', ''),
  1182. 'default' => array('doing', 'doing', '', '$WEEKBEGIN', '$WEEKEND')
  1183. ),
  1184. 'drills' => array
  1185. (
  1186. array
  1187. (
  1188. 'field' => 'number',
  1189. 'object' => 'task',
  1190. 'whereSql' => "left join zt_project as t2 on t1.execution=t2.id left join zt_project as t3 on t2.project=t3.id where t1.deleted='0' and t2.deleted='0' and t2.type in ('sprint','stage')",
  1191. 'condition' => array
  1192. (
  1193. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  1194. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  1195. )
  1196. ),
  1197. array
  1198. (
  1199. 'field' => 'stories',
  1200. 'object' => 'story',
  1201. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in('sprint', 'stage') and t1.deleted='0'",
  1202. 'condition' => array
  1203. (
  1204. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  1205. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname')
  1206. )
  1207. ),
  1208. array
  1209. (
  1210. 'field' => 'teams',
  1211. 'object' => 'user',
  1212. 'whereSql' => "left join zt_team t2 on t1.account=t2.account left join zt_project t3 on t2.root=t3.id left join zt_project t4 on t3.project=t4.id where t2.type ='execution' and t3.deleted='0'",
  1213. 'condition' => array
  1214. (
  1215. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  1216. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname')
  1217. )
  1218. ),
  1219. array
  1220. (
  1221. 'field' => 'consumed',
  1222. 'object' => 'task',
  1223. 'whereSql' => "left join zt_project as t2 on t1.execution=t2.id left join zt_project as t3 on t2.project=t3.id where t1.deleted='0' and t2.deleted='0' and t2.type in ('sprint','stage') and t1.parent>='0'",
  1224. 'condition' => array
  1225. (
  1226. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  1227. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  1228. )
  1229. )
  1230. ),
  1231. 'stage' => 'published',
  1232. 'builtin' => '1'
  1233. );
  1234. $config->bi->builtin->pivots[] = array
  1235. (
  1236. 'id' => 1012,
  1237. 'version' => '1',
  1238. 'name' => array('zh-cn' => '项目需求状态分布表', 'zh-tw' => '項目需求狀態分布表', 'en' => 'Project Story Status', 'de' => 'Project Story Status', 'fr' => 'Project Story Status', 'vi' => 'Project Story Status', 'ja' => 'Project Story Status'),
  1239. 'code' => 'projectStoryStatus',
  1240. 'desc' => array('zh-cn' => '按照项目统计需求的状态分布情况。', 'zh-tw' => '按照項目統計需求的狀態分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1241. 'dimension' => '1',
  1242. 'driver' => 'mysql',
  1243. 'group' => '60',
  1244. 'createdDate' => '2009-03-14',
  1245. 'sql' => <<<EOT
  1246. select
  1247. t2.id,
  1248. t4.name as projectname,
  1249. t4.id as project,
  1250. t2.name as executionname,
  1251. t2.id as execution,
  1252. t3.status
  1253. from zt_projectstory as t1
  1254. left join zt_project as t2 on t1.project=t2.id
  1255. left join zt_story as t3 on t1.story=t3.id
  1256. left join zt_project as t4 on t4.id=t2.project
  1257. where t2.deleted='0' and t3.deleted='0'
  1258. and t2.type in('sprint', 'stage')
  1259. and (case when \$projectStatus='' then 1=1 else t4.status=\$projectStatus end)
  1260. and (case when \$executionStatus='' then 1=1 else t2.status=\$executionStatus end)
  1261. and (case when \$project='' then 1=1 else t4.id=\$project end)
  1262. and (case when \$execution='' then 1=1 else t2.id=\$execution end)
  1263. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='')
  1264. EOT
  1265. ,
  1266. 'settings' => array
  1267. (
  1268. 'summary' => 'use',
  1269. 'columns' => array
  1270. (
  1271. array('field' => 'status', 'slice' => 'status', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1272. ),
  1273. 'columnTotal' => 'sum',
  1274. 'group1' => 'projectname',
  1275. 'group2' => 'executionname'
  1276. ),
  1277. 'filters' => array
  1278. (
  1279. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1280. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1281. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1282. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1283. ),
  1284. 'fields' => array
  1285. (
  1286. 'id' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1287. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1288. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1289. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1290. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1291. 'status' => array('object' => 'story', 'field' => 'status', 'type' => 'option')
  1292. ),
  1293. 'langs' => array
  1294. (
  1295. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1296. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1297. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1298. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1299. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1300. 'status' => array('zh-cn' => '不同状态需求', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1301. ),
  1302. 'vars' => array
  1303. (
  1304. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1305. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表'),
  1306. 'requestType' => array('select', 'select', 'select', 'select'),
  1307. 'selectList' => array('project.status', 'execution.status', 'project', 'execution'),
  1308. 'default' => array('doing', 'doing', '', '')
  1309. ),
  1310. 'drills' => array
  1311. (
  1312. array
  1313. (
  1314. 'field' => 'status',
  1315. 'object' => 'story',
  1316. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in('sprint', 'stage') and t1.deleted='0'",
  1317. 'condition' => array
  1318. (
  1319. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  1320. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname'),
  1321. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'status', 'queryField' => 'status')
  1322. )
  1323. )
  1324. ),
  1325. 'stage' => 'published',
  1326. 'builtin' => '1'
  1327. );
  1328. $config->bi->builtin->pivots[] = array
  1329. (
  1330. 'id' => 1013,
  1331. 'version' => '1',
  1332. 'name' => array('zh-cn' => '项目需求阶段分布表', 'zh-tw' => '項目需求階段分布表', 'en' => 'Project Stage Report', 'de' => 'Project Stage Report', 'fr' => 'Project Stage Report', 'vi' => 'Project Stage Report', 'ja' => 'Project Stage Report'),
  1333. 'code' => 'projectStoryStage',
  1334. 'desc' => array('zh-cn' => '按照项目统计需求阶段分布情况。', 'zh-tw' => '按照項目統計需求階段分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1335. 'dimension' => '1',
  1336. 'driver' => 'mysql',
  1337. 'group' => '60',
  1338. 'createdDate' => '2009-03-14',
  1339. 'sql' => <<<EOT
  1340. select
  1341. t2.id,
  1342. t4.name as projectname,
  1343. t4.id as project,
  1344. t2.name as executionname,
  1345. t2.id as execution,
  1346. t3.stage
  1347. from zt_projectstory as t1
  1348. left join zt_project as t2 on t1.project=t2.id
  1349. left join zt_story as t3 on t1.story=t3.id
  1350. left join zt_project as t4 on t4.id=t2.project
  1351. where t2.deleted='0' and t3.deleted='0'
  1352. and t2.type in('sprint', 'stage')
  1353. and (case when \$projectStatus='' then 1=1 else t4.status=\$projectStatus end)
  1354. and (case when \$executionStatus='' then 1=1 else t2.status=\$executionStatus end)
  1355. and (case when \$project='' then 1=1 else t4.id=\$project end)
  1356. and (case when \$execution='' then 1=1 else t2.id=\$execution end)
  1357. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='')
  1358. EOT
  1359. ,
  1360. 'settings' => array
  1361. (
  1362. 'summary' => 'use',
  1363. 'columns' => array
  1364. (
  1365. array('field' => 'stage', 'slice' => 'stage', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1366. ),
  1367. 'columnTotal' => 'sum',
  1368. 'group1' => 'projectname',
  1369. 'group2' => 'executionname'
  1370. ),
  1371. 'filters' => array
  1372. (
  1373. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1374. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1375. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1376. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1377. ),
  1378. 'fields' => array
  1379. (
  1380. 'id' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1381. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1382. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1383. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1384. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1385. 'stage' => array('object' => 'story', 'field' => 'stage', 'type' => 'option')
  1386. ),
  1387. 'langs' => array
  1388. (
  1389. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1390. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1391. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1392. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1393. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1394. 'stage' => array('zh-cn' => '不同阶段需求', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1395. ),
  1396. 'vars' => array
  1397. (
  1398. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1399. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表'),
  1400. 'requestType' => array('select', 'select', 'select', 'select'),
  1401. 'selectList' => array('project.status', 'execution.status', 'project', 'execution'),
  1402. 'default' => array('doing', 'doing', '', '')
  1403. ),
  1404. 'drills' => array
  1405. (
  1406. array
  1407. (
  1408. 'field' => 'stage',
  1409. 'object' => 'story',
  1410. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in('sprint', 'stage') and t1.deleted='0'",
  1411. 'condition' => array
  1412. (
  1413. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  1414. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname'),
  1415. array('drillObject' => 'zt_story', 'drillAlias' => 't1', 'drillField' => 'stage', 'queryField' => 'stage')
  1416. )
  1417. )
  1418. ),
  1419. 'stage' => 'published',
  1420. 'builtin' => '1'
  1421. );
  1422. $config->bi->builtin->pivots[] = array
  1423. (
  1424. 'id' => 1014,
  1425. 'version' => '1',
  1426. 'name' => array('zh-cn' => '项目Bug解决方案分布表', 'zh-tw' => '項目Bug解決方案分布表', 'en' => 'Project Bug Resolution', 'de' => 'Project Bug Resolution', 'fr' => 'Project Bug Resolution', 'vi' => 'Project Bug Resolution', 'ja' => 'Project Bug Resolution'),
  1427. 'code' => 'projectBugResolution',
  1428. 'desc' => array('zh-cn' => '按照项目统计Bug的解决方案分布情况。', 'zh-tw' => '按照項目統計Bug的解決方案分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1429. 'dimension' => '1',
  1430. 'driver' => 'mysql',
  1431. 'group' => '60,61',
  1432. 'createdDate' => '2009-03-14',
  1433. 'sql' => <<<EOT
  1434. select
  1435. t1.id,
  1436. t3.name as project,
  1437. t3.id as projectID,
  1438. t1.id as execution,
  1439. t1.name as executionname,
  1440. t2.id as bugID,
  1441. t2.resolution
  1442. from zt_project as t1
  1443. left join zt_bug as t2 on t1.id=t2.execution
  1444. left join zt_project as t3 on t3.id=t1.project
  1445. where t1.deleted='0'
  1446. and t2.deleted='0'
  1447. and t2.resolution!=''
  1448. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  1449. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1450. and (case when \$project='' then 1=1 else t3.id=\$project end)
  1451. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  1452. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='')
  1453. EOT
  1454. ,
  1455. 'settings' => array
  1456. (
  1457. 'summary' => 'use',
  1458. 'columns' => array
  1459. (
  1460. array('field' => 'resolution', 'slice' => 'resolution', 'stat' => 'count', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1461. ),
  1462. 'columnTotal' => 'sum',
  1463. 'group1' => 'project',
  1464. 'group2' => 'executionname'
  1465. ),
  1466. 'filters' => array
  1467. (
  1468. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1469. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1470. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1471. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1472. ),
  1473. 'fields' => array
  1474. (
  1475. 'id' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1476. 'project' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1477. 'projectID' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1478. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1479. 'executionname' => array('object' => 'bug', 'field' => '', 'type' => 'string'),
  1480. 'bugID' => array('object' => 'bug', 'field' => '', 'type' => 'number'),
  1481. 'resolution' => array('object' => 'bug', 'field' => 'resolution', 'type' => 'option')
  1482. ),
  1483. 'langs' => array
  1484. (
  1485. 'id' => array('zh-cn' => '项目', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1486. 'project' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1487. 'projectID' => array('zh-cn' => '执行', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1488. 'execution' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1489. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1490. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1491. 'resolution' => array('zh-cn' => '解决方案', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1492. ),
  1493. 'vars' => array
  1494. (
  1495. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1496. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表'),
  1497. 'requestType' => array('select', 'select', 'select', 'select'),
  1498. 'selectList' => array('project.status', 'execution.status', 'project', 'execution'),
  1499. 'default' => array('doing', 'doing', '', '')
  1500. ),
  1501. 'drills' => array
  1502. (
  1503. array
  1504. (
  1505. 'field' => 'resolution',
  1506. 'object' => 'bug',
  1507. 'whereSql' => "left join zt_project as t2 on t1.execution=t2.id left join zt_project as t3 on t3.id=t2.project where t1.deleted='0' and t2.deleted='0' and t1.resolution!=''",
  1508. 'condition' => array
  1509. (
  1510. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  1511. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'project'),
  1512. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolution', 'queryField' => 'resolution')
  1513. )
  1514. )
  1515. ),
  1516. 'stage' => 'published',
  1517. 'builtin' => '1'
  1518. );
  1519. $config->bi->builtin->pivots[] = array
  1520. (
  1521. 'id' => 1015,
  1522. 'version' => '1',
  1523. 'name' => array('zh-cn' => '项目Bug状态分布表', 'zh-tw' => '項目Bug狀態分布表', 'en' => 'Project Bug Status', 'de' => 'Project Bug Status', 'fr' => 'Project Bug Status', 'vi' => 'Project Bug Status', 'ja' => 'Project Bug Status'),
  1524. 'code' => 'projectBugStatus',
  1525. 'desc' => array('zh-cn' => '按照项目统计Bug的状态分布情况。', 'zh-tw' => '按照項目統計Bug的狀態分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1526. 'dimension' => '1',
  1527. 'driver' => 'mysql',
  1528. 'group' => '60,61',
  1529. 'createdDate' => '2009-03-14',
  1530. 'sql' => <<<EOT
  1531. select
  1532. t1.id,
  1533. t3.name as project,
  1534. t3.id as projectID,
  1535. t1.name as execution,
  1536. t1.id as executionID,
  1537. t2.id as bugID,
  1538. t2.status
  1539. from zt_project as t1
  1540. left join zt_bug as t2 on t1.id=t2.execution
  1541. left join zt_project as t3 on t3.id=t1.project
  1542. where t1.deleted='0'
  1543. and t2.deleted='0'
  1544. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  1545. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1546. and (case when \$project='' then 1=1 else t3.id=\$project end)
  1547. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  1548. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='')
  1549. EOT
  1550. ,
  1551. 'settings' => array
  1552. (
  1553. 'summary' => 'use',
  1554. 'columns' => array
  1555. (
  1556. array('field' => 'status', 'slice' => 'status', 'stat' => 'count', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1557. ),
  1558. 'columnTotal' => 'noShow',
  1559. 'group1' => 'project',
  1560. 'group2' => 'execution'
  1561. ),
  1562. 'filters' => array
  1563. (
  1564. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1565. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1566. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1567. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1568. ),
  1569. 'fields' => array
  1570. (
  1571. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1572. 'project' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1573. 'projectID' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1574. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1575. 'executionID' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1576. 'bugID' => array('object' => 'bug', 'field' => '', 'type' => 'number'),
  1577. 'status' => array('object' => 'bug', 'field' => 'status', 'type' => 'option')
  1578. ),
  1579. 'langs' => array
  1580. (
  1581. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1582. 'project' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1583. 'projectID' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1584. 'execution' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1585. 'executionID' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1586. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1587. 'status' => array('zh-cn' => 'Bug状态', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1588. ),
  1589. 'vars' => array
  1590. (
  1591. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1592. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表'),
  1593. 'requestType' => array('select', 'select', 'select', 'select'),
  1594. 'selectList' => array('project.status', 'execution.status', 'project', 'execution'),
  1595. 'default' => array('doing', 'doing', '', '')
  1596. ),
  1597. 'drills' => array
  1598. (
  1599. array
  1600. (
  1601. 'field' => 'status',
  1602. 'object' => 'bug',
  1603. 'whereSql' => "left join zt_project as t2 on t2.id=t1.execution left join zt_project as t3 on t3.id=t1.project WHERE t1.deleted='0'",
  1604. 'condition' => array
  1605. (
  1606. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'execution'),
  1607. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'project'),
  1608. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'status', 'queryField' => 'status')
  1609. )
  1610. )
  1611. ),
  1612. 'stage' => 'published',
  1613. 'builtin' => '1'
  1614. );
  1615. $config->bi->builtin->pivots[] = array
  1616. (
  1617. 'id' => 1016,
  1618. 'version' => '1',
  1619. 'name' => array('zh-cn' => '项目Bug创建者分布表', 'zh-tw' => '項目Bug創建者分布表', 'en' => 'Project Bug Opened', 'de' => 'Project Bug Opened', 'fr' => 'Project Bug Opened', 'vi' => 'Project Bug Opened', 'ja' => 'Project Bug Opened'),
  1620. 'code' => 'projectBugOpenedBy',
  1621. 'desc' => array('zh-cn' => '按照项目统计Bug的创建者分布情况。', 'zh-tw' => '按照項目統計Bug的創建者分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1622. 'dimension' => '1',
  1623. 'driver' => 'mysql',
  1624. 'group' => '60,61',
  1625. 'createdDate' => '2009-03-14',
  1626. 'sql' => <<<EOT
  1627. select
  1628. t1.id,
  1629. t3.name as projectname,
  1630. t3.id as projectID,
  1631. t1.name as executionname,
  1632. t1.id as execution,
  1633. t2.id as bugID,
  1634. t2.openedBy
  1635. from zt_project as t1
  1636. left join zt_bug as t2 on t1.id=t2.execution
  1637. left join zt_project as t3 on t3.id=t1.project
  1638. where t1.deleted='0'
  1639. and t2.deleted='0'
  1640. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  1641. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1642. and (case when \$project='' then 1=1 else t3.id=\$project end)
  1643. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  1644. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='')
  1645. EOT
  1646. ,
  1647. 'settings' => array
  1648. (
  1649. 'summary' => 'use',
  1650. 'columns' => array
  1651. (
  1652. array('field' => 'openedBy', 'slice' => 'openedBy', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1653. ),
  1654. 'columnTotal' => 'sum',
  1655. 'group1' => 'projectname',
  1656. 'group2' => 'executionname'
  1657. ),
  1658. 'filters' => array
  1659. (
  1660. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1661. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1662. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1663. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1664. ),
  1665. 'fields' => array
  1666. (
  1667. 'id' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1668. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1669. 'projectID' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1670. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1671. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1672. 'bugID' => array('object' => 'bug', 'field' => '', 'type' => 'number'),
  1673. 'openedBy' => array('object' => 'project', 'field' => 'openedBy', 'type' => 'user')
  1674. ),
  1675. 'langs' => array
  1676. (
  1677. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1678. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1679. 'projectID' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1680. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1681. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1682. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1683. 'openedBy' => array('zh-cn' => '创建者', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1684. ),
  1685. 'vars' => array
  1686. (
  1687. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1688. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表'),
  1689. 'requestType' => array('select', 'select', 'select', 'select'),
  1690. 'selectList' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1691. 'default' => array('doing', 'doing', '', '')
  1692. ),
  1693. 'drills' => array
  1694. (
  1695. array
  1696. (
  1697. 'field' => 'openedBy',
  1698. 'object' => 'bug',
  1699. 'whereSql' => "left join zt_project as t2 on t2.id=t1.execution left join zt_project as t3 on t3.id=t2.project where t1.deleted='0' and t2.deleted='0'",
  1700. 'condition' => array
  1701. (
  1702. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  1703. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname'),
  1704. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'openedBy', 'queryField' => 'openedBy')
  1705. )
  1706. )
  1707. ),
  1708. 'stage' => 'published',
  1709. 'builtin' => '1'
  1710. );
  1711. $config->bi->builtin->pivots[] = array
  1712. (
  1713. 'id' => 1017,
  1714. 'version' => '1',
  1715. 'name' => array('zh-cn' => '项目Bug解决者分布表', 'zh-tw' => '項目Bug解決者分布表', 'en' => 'Project Bug Resolve', 'de' => 'Project Bug Resolve', 'fr' => 'Project Bug Resolve', 'vi' => 'Project Bug Resolve', 'ja' => 'Project Bug Resolve'),
  1716. 'code' => 'projectBugResolvedBy',
  1717. 'desc' => array('zh-cn' => '按照项目统计Bug的解决者分布情况。', 'zh-tw' => '按照項目統計Bug的解決者分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1718. 'dimension' => '1',
  1719. 'driver' => 'mysql',
  1720. 'group' => '60,61',
  1721. 'createdDate' => '2009-03-14',
  1722. 'sql' => <<<EOT
  1723. select
  1724. t1.id,
  1725. t3.name as projectname,
  1726. t3.id as projectID,
  1727. t1.name as executionname,
  1728. t1.id as execution,
  1729. t2.id as bugID,
  1730. t2.resolvedBy
  1731. from zt_project as t1
  1732. left join zt_bug as t2 on t1.id=t2.execution
  1733. left join zt_project as t3 on t3.id=t1.project
  1734. where t1.deleted='0'
  1735. and t2.deleted='0'
  1736. and t2.status!='active'
  1737. and t2.resolvedBy!=''
  1738. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  1739. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1740. and (case when \$project='' then 1=1 else t3.id=\$project end)
  1741. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  1742. and not (\$projectStatus='' and \$executionStatus='' and \$project='' and \$execution='')
  1743. EOT
  1744. ,
  1745. 'settings' => array
  1746. (
  1747. 'summary' => 'use',
  1748. 'columns' => array
  1749. (
  1750. array('field' => 'resolvedBy', 'slice' => 'resolvedBy', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1751. ),
  1752. 'columnTotal' => 'sum',
  1753. 'group1' => 'projectname',
  1754. 'group2' => 'executionname'
  1755. ),
  1756. 'filters' => array
  1757. (
  1758. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1759. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1760. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1761. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1762. ),
  1763. 'fields' => array
  1764. (
  1765. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1766. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1767. 'projectID' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1768. 'executionname' => array('object' => 'bug', 'field' => 'name', 'type' => 'string'),
  1769. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1770. 'bugID' => array('object' => 'bug', 'field' => '', 'type' => 'number'),
  1771. 'resolvedBy' => array('object' => 'bug', 'field' => 'resolvedBy', 'type' => 'user')
  1772. ),
  1773. 'langs' => array
  1774. (
  1775. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1776. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1777. 'projectID' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1778. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1779. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1780. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1781. 'resolvedBy' => array('zh-cn' => '解决者', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1782. ),
  1783. 'vars' => array
  1784. (
  1785. 'varName' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1786. 'showName' => array('项目状态', '执行状态', '项目列表', '执行列表'),
  1787. 'requestType' => array('select', 'select', 'select', 'select'),
  1788. 'selectList' => array('projectStatus', 'executionStatus', 'project', 'execution'),
  1789. 'default' => array('doing', 'doing', '', '')
  1790. ),
  1791. 'drills' => array
  1792. (
  1793. array
  1794. (
  1795. 'field' => 'resolvedBy',
  1796. 'object' => 'bug',
  1797. 'whereSql' => "left join zt_project as t2 on t2.id=t1.execution left join zt_project as t3 on t3.id=t2.project where t1.deleted='0' and t2.deleted='0' and t1.status!='active' and t1.resolvedBy!=''",
  1798. 'condition' => array
  1799. (
  1800. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  1801. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname'),
  1802. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolvedBy', 'queryField' => 'resolvedBy')
  1803. )
  1804. )
  1805. ),
  1806. 'stage' => 'published',
  1807. 'builtin' => '1'
  1808. );
  1809. $config->bi->builtin->pivots[] = array
  1810. (
  1811. 'id' => 1018,
  1812. 'version' => '1',
  1813. 'name' => array('zh-cn' => '项目Bug指派给分布表', 'zh-tw' => '項目Bug指派給分布表', 'en' => 'Project Bug Assign', 'de' => 'Project Bug Assign', 'fr' => 'Project Bug Assign', 'vi' => 'Project Bug Assign', 'ja' => 'Project Bug Assign'),
  1814. 'code' => 'projectBugAssignedBy',
  1815. 'desc' => array('zh-cn' => '按照项目统计Bug的指派给分布情况。', 'zh-tw' => '按照項目統計Bug的指派給分布情況。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1816. 'dimension' => '1',
  1817. 'driver' => 'mysql',
  1818. 'group' => '60,61',
  1819. 'createdDate' => '2009-03-14',
  1820. 'sql' => <<<EOT
  1821. select
  1822. t1.id,
  1823. t3.name as project,
  1824. t3.id as projectID,
  1825. t1.name as execution,
  1826. t1.id as executionID,
  1827. t2.id as bugID,
  1828. t2.assignedTo
  1829. from zt_project as t1
  1830. left join zt_bug as t2 on t1.id=t2.execution
  1831. left join zt_project as t3 on t3.id=t1.project
  1832. where t1.deleted='0'
  1833. and t2.deleted='0'
  1834. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  1835. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1836. and (case when \$project='' then 1=1 else t3.id=\$project end)
  1837. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  1838. EOT
  1839. ,
  1840. 'settings' => array
  1841. (
  1842. 'summary' => 'use',
  1843. 'columns' => array
  1844. (
  1845. array('field' => 'assignedTo', 'slice' => 'assignedTo', 'stat' => 'count', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1846. ),
  1847. 'columnTotal' => 'noShow',
  1848. 'group1' => 'project',
  1849. 'group2' => 'execution'
  1850. ),
  1851. 'filters' => array
  1852. (
  1853. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1854. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1855. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1856. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1857. ),
  1858. 'fields' => array
  1859. (
  1860. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1861. 'project' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1862. 'projectID' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1863. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1864. 'executionID' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1865. 'bugID' => array('object' => 'bug', 'field' => '', 'type' => 'number'),
  1866. 'assignedTo' => array('object' => 'bug', 'field' => 'assignedTo', 'type' => 'user')
  1867. ),
  1868. 'langs' => array
  1869. (
  1870. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1871. 'project' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1872. 'projectID' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1873. 'execution' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1874. 'executionID' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1875. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1876. 'assignedTo' => array('zh-cn' => '指派给', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  1877. ),
  1878. 'vars' => array
  1879. (
  1880. 'varName' => array('project', 'execution'),
  1881. 'showName' => array('项目列表', '执行列表'),
  1882. 'requestType' => array('select', 'select'),
  1883. 'selectList' => array('project', 'execution'),
  1884. 'default' => array('', '')
  1885. ),
  1886. 'drills' => array
  1887. (
  1888. array
  1889. (
  1890. 'field' => 'assignedTo',
  1891. 'object' => 'bug',
  1892. 'whereSql' => "left join zt_project as t2 on t1.project=t2.id left join zt_project as t3 on t1.execution=t3.id WHERE t1.deleted='0'",
  1893. 'condition' => array
  1894. (
  1895. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'project'),
  1896. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'assignedTo', 'queryField' => 'assignedTo'),
  1897. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'execution')
  1898. )
  1899. )
  1900. ),
  1901. 'stage' => 'published',
  1902. 'builtin' => '1'
  1903. );
  1904. $config->bi->builtin->pivots[] = array
  1905. (
  1906. 'id' => 1019,
  1907. 'version' => '1',
  1908. 'name' => array('zh-cn' => '项目质量表', 'zh-tw' => '項目質量表', 'en' => 'Project Quality Report', 'de' => 'Project Quality Report', 'fr' => 'Project Quality Report', 'vi' => 'Project Quality Report', 'ja' => 'Project Quality Report'),
  1909. 'code' => 'projectQuality',
  1910. 'desc' => array('zh-cn' => '列出项目的需求总数,完成需求数,任务总数,完成的任务数,Bug数,解决的Bug数,Bug/需求,Bug/任务,重要Bug数量(严重程度不大于3)。', 'zh-tw' => '列出項目的需求總數,完成需求數,任務總數,完成的任務數,Bug數,解決的Bug數,Bug/需求,Bug/任務,重要Bug數量(嚴重程度不大於3)。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  1911. 'dimension' => '1',
  1912. 'driver' => 'mysql',
  1913. 'group' => '60',
  1914. 'createdDate' => '2009-03-14',
  1915. 'sql' => <<<EOT
  1916. select
  1917. t1.id,
  1918. t5.name as projectname,
  1919. t5.id as project,
  1920. t1.name as executionname,
  1921. t1.id as execution,
  1922. ifnull(t2.stories, 0) as stories,
  1923. ifnull((t2.stories-t2.undone), 0) as doneStory,
  1924. ifnull(t3.number, 0) as number,
  1925. ifnull((t3.number-t3.undone), 0) as doneTask,
  1926. ifnull(t4.bugs, 0) as bugs,
  1927. ifnull(t4.resolutions, 0) as resolutions,
  1928. ifnull(round(t4.bugs/(t2.stories-t2.undone),2), 0) as bugthanstory,
  1929. ifnull(round(t4.bugs/(t3.number-t3.undone),2), 0) as bugthantask,
  1930. ifnull(t4.seriousBugs, 0) as seriousBugs
  1931. from zt_project as t1
  1932. left join ztv_projectstories as t2 on t1.id=t2.execution
  1933. left join ztv_executionsummary as t3 on t1.id=t3.execution
  1934. left join ztv_projectbugs as t4 on t1.id=t4.execution
  1935. left join zt_project as t5 on t5.id=t1.project
  1936. where t1.deleted='0'
  1937. and t1.type in ('sprint','stage')
  1938. and t1.grade='1'
  1939. and (case when \$projectStatus='' then 1=1 else t5.status=\$projectStatus end)
  1940. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  1941. and (case when \$project='' then 1=1 else t5.id=\$project end)
  1942. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  1943. EOT
  1944. ,
  1945. 'settings' => array
  1946. (
  1947. 'summary' => 'use',
  1948. 'columns' => array
  1949. (
  1950. array('field' => 'stories', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1951. array('field' => 'doneStory', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1952. array('field' => 'number', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1953. array('field' => 'doneTask', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1954. array('field' => 'bugs', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1955. array('field' => 'resolutions', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1956. array('field' => 'bugthanstory', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1957. array('field' => 'bugthantask', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  1958. array('field' => 'seriousBugs', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  1959. ),
  1960. 'columnTotal' => 'sum',
  1961. 'group1' => 'projectname',
  1962. 'group2' => 'executionname'
  1963. ),
  1964. 'filters' => array
  1965. (
  1966. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  1967. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  1968. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  1969. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  1970. ),
  1971. 'fields' => array
  1972. (
  1973. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1974. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1975. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  1976. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1977. 'execution' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  1978. 'stories' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1979. 'doneStory' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1980. 'number' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1981. 'doneTask' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1982. 'bugs' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  1983. 'resolutions' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1984. 'bugthanstory' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1985. 'bugthantask' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  1986. 'seriousBugs' => array('object' => 'project', 'field' => '', 'type' => 'number')
  1987. ),
  1988. 'langs' => array
  1989. (
  1990. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1991. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1992. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1993. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1994. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1995. 'stories' => array('zh-cn' => '需求总数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1996. 'doneStory' => array('zh-cn' => '关闭需求数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1997. 'number' => array('zh-cn' => '任务总数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1998. 'doneTask' => array('zh-cn' => '完成任务数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  1999. 'bugs' => array('zh-cn' => 'Bug数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2000. 'resolutions' => array('zh-cn' => '解决Bug数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2001. 'bugthanstory' => array('zh-cn' => 'Bug/完成需求', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2002. 'bugthantask' => array('zh-cn' => 'Bug/完成任务', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2003. 'seriousBugs' => array('zh-cn' => '重要Bug数', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2004. ),
  2005. 'vars' => array
  2006. (
  2007. 'varName' => array('project', 'execution'),
  2008. 'showName' => array('项目列表', '执行列表'),
  2009. 'requestType' => array('select', 'select'),
  2010. 'selectList' => array('project', 'execution'),
  2011. 'default' => array('', '')
  2012. ),
  2013. 'drills' => array
  2014. (
  2015. array
  2016. (
  2017. 'field' => 'stories',
  2018. 'object' => 'story',
  2019. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in ('sprint','stage') and t1.deleted='0'",
  2020. 'condition' => array
  2021. (
  2022. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  2023. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname')
  2024. )
  2025. ),
  2026. array
  2027. (
  2028. 'field' => 'doneStory',
  2029. 'object' => 'story',
  2030. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in ('sprint','stage') and t1.deleted='0' and t1.status='closed'",
  2031. 'condition' => array
  2032. (
  2033. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  2034. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname')
  2035. )
  2036. ),
  2037. array
  2038. (
  2039. 'field' => 'number',
  2040. 'object' => 'task',
  2041. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t2.type in ('sprint','stage')",
  2042. 'condition' => array
  2043. (
  2044. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2045. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2046. )
  2047. ),
  2048. array
  2049. (
  2050. 'field' => 'doneTask',
  2051. 'object' => 'task',
  2052. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t1.status in ('closed','done') and t2.type in ('sprint','stage')",
  2053. 'condition' => array
  2054. (
  2055. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2056. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2057. )
  2058. ),
  2059. array
  2060. (
  2061. 'field' => 'bugs',
  2062. 'object' => 'bug',
  2063. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0'",
  2064. 'condition' => array
  2065. (
  2066. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2067. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2068. )
  2069. ),
  2070. array
  2071. (
  2072. 'field' => 'resolutions',
  2073. 'object' => 'bug',
  2074. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t1.resolution !=' '",
  2075. 'condition' => array
  2076. (
  2077. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2078. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2079. )
  2080. ),
  2081. array
  2082. (
  2083. 'field' => 'seriousBugs',
  2084. 'object' => 'bug',
  2085. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t1.severity<='2'",
  2086. 'condition' => array
  2087. (
  2088. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2089. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2090. )
  2091. )
  2092. ),
  2093. 'stage' => 'published',
  2094. 'builtin' => '1'
  2095. );
  2096. $config->bi->builtin->pivots[] = array
  2097. (
  2098. 'id' => 1020,
  2099. 'version' => '1',
  2100. 'name' => array('zh-cn' => '产品Bug类型统计表', 'zh-tw' => '產品Bug類型統計表', 'en' => 'Bug Type of Product', 'de' => 'Bug Type of Product', 'fr' => 'Bug Type of Product'),
  2101. 'code' => 'productBugType',
  2102. 'desc' => array('zh-cn' => '按照产品统计Bug的类型分布情况。', 'zh-tw' => '按照產品統計Bug的類型分布情況。', 'en' => 'Type distribution of Bugs.', 'de' => 'Type distribution of Bugs.', 'fr' => 'Type distribution of Bugs.'),
  2103. 'dimension' => '1',
  2104. 'driver' => 'mysql',
  2105. 'group' => '59,61',
  2106. 'createdDate' => '2009-03-14',
  2107. 'sql' => <<<EOT
  2108. select
  2109. t2.product,
  2110. t1.name,
  2111. t2.id as bugID,
  2112. t2.type
  2113. from zt_product as t1
  2114. left join zt_bug as t2 on t1.id=t2.product
  2115. left join zt_project as t3 on t1.program=t3.id
  2116. where t1.deleted='0'
  2117. and t1.shadow='0'
  2118. and t2.deleted='0'
  2119. and (case when \$productStatus='' then 1=1 else t1.status=\$productStatus end)
  2120. and (case when \$productType='' then 1=1 else t1.type=\$productType end)
  2121. and (case when \$product='' then 1=1 else t1.id=\$product end)
  2122. order by t3.`order` asc, t1.line desc, t1.`order` asc
  2123. EOT
  2124. ,
  2125. 'settings' => array
  2126. (
  2127. 'group1' => 'product',
  2128. 'columnTotal' => 'sum',
  2129. 'columns' => array
  2130. (
  2131. array('field' => 'type', 'slice' => 'type', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0)
  2132. ),
  2133. 'summary' => 'use'
  2134. ),
  2135. 'filters' => array
  2136. (
  2137. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  2138. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  2139. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  2140. ),
  2141. 'fields' => array
  2142. (
  2143. 'product' => array('object' => 'product', 'field' => 'name', 'type' => 'object'),
  2144. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string'),
  2145. 'bugID' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2146. 'type' => array('object' => 'bug', 'field' => 'type', 'type' => 'option')
  2147. ),
  2148. 'langs' => array
  2149. (
  2150. 'product' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2151. 'name' => array('zh-cn' => '产品', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2152. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2153. 'type' => array('zh-cn' => '不同类型Bug', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2154. ),
  2155. 'vars' => array(),
  2156. 'drills' => array
  2157. (
  2158. array
  2159. (
  2160. 'field' => 'type',
  2161. 'object' => 'bug',
  2162. 'whereSql' => "WHERE t1.deleted='0'",
  2163. 'condition' => array
  2164. (
  2165. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product'),
  2166. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'type', 'queryField' => 'type')
  2167. )
  2168. )
  2169. ),
  2170. 'stage' => 'published',
  2171. 'builtin' => '1'
  2172. );
  2173. $config->bi->builtin->pivots[] = array
  2174. (
  2175. 'id' => 1021,
  2176. 'version' => '1',
  2177. 'name' => array('zh-cn' => '产品质量表', 'zh-tw' => '產品質量表', 'en' => 'Product Quality', 'de' => 'Product Quality', 'fr' => 'Product Quality'),
  2178. 'code' => 'productQuality',
  2179. 'desc' => array('zh-cn' => '列出产品的需求数,完成的需求总数,Bug数,解决的Bug总数,Bug/需求,重要Bug数量(严重程度小于3)。', 'zh-tw' => '列出產品的需求數,完成的需求總數,Bug數,解決的Bug總數,Bug/需求,重要Bug數量(嚴重程度小於3)。', 'en' => 'Serious Bug (severity is less than 3).', 'de' => 'Serious Bug (severity is less than 3).', 'fr' => 'Serious Bug (severity is less than 3).'),
  2180. 'dimension' => '1',
  2181. 'driver' => 'mysql',
  2182. 'group' => '59',
  2183. 'createdDate' => '2009-03-14',
  2184. 'sql' => <<<EOT
  2185. select
  2186. t1.id,
  2187. t1.name,
  2188. ifnull(t2.stories, 0) as stories,
  2189. ifnull((t2.stories-t2.undone), 0) as doneStory,
  2190. ifnull(t3.bugs, 0) as bugs,
  2191. ifnull(t3.resolutions, 0) as resolutions,
  2192. ifnull(round(t3.bugs/(t2.stories-t2.undone),2), 0) as bugthanstory,
  2193. ifnull(t3.seriousBugs, 0) as seriousBugs
  2194. from zt_product as t1
  2195. left join ztv_productstories as t2 on t1.id=t2.product
  2196. left join ztv_productbugs as t3 on t1.id=t3.product
  2197. left join zt_project as t4 on t1.program=t4.id
  2198. where t1.deleted='0'
  2199. and t1.shadow='0'
  2200. and (case when \$productStatus='' then 1=1 else t1.status=\$productStatus end)
  2201. and (case when \$productType='' then 1=1 else t1.type=\$productType end)
  2202. and (case when \$product='' then 1=1 else t1.id=\$product end)
  2203. order by t4.`order` asc, t1.line desc, t1.`order` asc
  2204. EOT
  2205. ,
  2206. 'settings' => array
  2207. (
  2208. 'group1' => 'name',
  2209. 'columnTotal' => 'sum',
  2210. 'columns' => array
  2211. (
  2212. array('field' => 'stories', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0),
  2213. array('field' => 'doneStory', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0),
  2214. array('field' => 'bugs', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0),
  2215. array('field' => 'resolutions', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0),
  2216. array('field' => 'bugthanstory', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0),
  2217. array('field' => 'seriousBugs', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '1', 'showOrigin' => 0)
  2218. ),
  2219. 'summary' => 'use'
  2220. ),
  2221. 'filters' => array
  2222. (
  2223. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  2224. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  2225. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  2226. ),
  2227. 'fields' => array
  2228. (
  2229. 'id' => array('object' => 'product', 'field' => 'id', 'type' => 'number'),
  2230. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string'),
  2231. 'stories' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  2232. 'doneStory' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2233. 'bugs' => array('object' => 'product', 'field' => '', 'type' => 'string'),
  2234. 'resolutions' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2235. 'bugthanstory' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2236. 'seriousBugs' => array('object' => 'project', 'field' => '', 'type' => 'number')
  2237. ),
  2238. 'langs' => array
  2239. (
  2240. 'id' => array('zh-cn' => '产品ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2241. 'name' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2242. 'stories' => array('zh-cn' => '需求总数', 'zh-tw' => '需求总数', 'en' => 'Stories', 'de' => '', 'fr' => ''),
  2243. 'doneStory' => array('zh-cn' => '关闭需求数', 'zh-tw' => '关闭需求数', 'en' => 'Closed Stories', 'de' => '', 'fr' => ''),
  2244. 'bugs' => array('zh-cn' => 'Bug数', 'zh-tw' => 'Bug数', 'en' => 'Bugs', 'de' => '', 'fr' => ''),
  2245. 'resolutions' => array('zh-cn' => '解决Bug数', 'zh-tw' => '解决Bug数', 'en' => 'Solved Bugs', 'de' => '', 'fr' => ''),
  2246. 'bugthanstory' => array('zh-cn' => 'Bug/完成需求', 'zh-tw' => 'Bug/完成需求', 'en' => 'Bug/Finished Story', 'de' => '', 'fr' => ''),
  2247. 'seriousBugs' => array('zh-cn' => '重要Bug数', 'zh-tw' => '重要Bug数', 'en' => 'Serious Bugs', 'de' => '', 'fr' => '')
  2248. ),
  2249. 'vars' => array(),
  2250. 'drills' => array
  2251. (
  2252. array
  2253. (
  2254. 'field' => 'stories',
  2255. 'object' => 'story',
  2256. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id where t1.deleted='0' ",
  2257. 'condition' => array
  2258. (
  2259. array('drillObject' => 'zt_story', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'name')
  2260. )
  2261. ),
  2262. array
  2263. (
  2264. 'field' => 'doneStory',
  2265. 'object' => 'story',
  2266. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id where t1.deleted='0' and t1.status='closed'",
  2267. 'condition' => array
  2268. (
  2269. array('drillObject' => 'zt_story', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'name')
  2270. )
  2271. ),
  2272. array
  2273. (
  2274. 'field' => 'bugs',
  2275. 'object' => 'bug',
  2276. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id where t1.deleted='0'",
  2277. 'condition' => array
  2278. (
  2279. array('drillObject' => 'zt_bug', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'name')
  2280. )
  2281. ),
  2282. array
  2283. (
  2284. 'field' => 'resolutions',
  2285. 'object' => 'bug',
  2286. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id where t1.deleted='0' and t1.resolution !=' '",
  2287. 'condition' => array
  2288. (
  2289. array('drillObject' => 'zt_bug', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'name')
  2290. )
  2291. ),
  2292. array
  2293. (
  2294. 'field' => 'seriousBugs',
  2295. 'object' => 'bug',
  2296. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id where t1.deleted and t1.severity<='2'",
  2297. 'condition' => array
  2298. (
  2299. array('drillObject' => 'zt_bug', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'name')
  2300. )
  2301. )
  2302. ),
  2303. 'stage' => 'published',
  2304. 'builtin' => '1'
  2305. );
  2306. $config->bi->builtin->pivots[] = array
  2307. (
  2308. 'id' => 1022,
  2309. 'version' => '1',
  2310. 'name' => array('zh-cn' => '员工登录次数统计表', 'zh-tw' => '員工登錄次數統計表', 'en' => 'Login Times', 'de' => 'Login Times', 'fr' => 'Login Times'),
  2311. 'code' => 'loginTimes',
  2312. 'desc' => array('zh-cn' => '实现员工登录次数统计报表,按照天统计每天每个人的登录次数,以及总数。', 'zh-tw' => '實現員工登錄次數統計報表,按照天統計每天每個人的登錄次數,以及總數。', 'en' => 'The summary of user login times.', 'de' => 'The summary of user login times.', 'fr' => 'The summary of user login times.'),
  2313. 'dimension' => '1',
  2314. 'driver' => 'mysql',
  2315. 'group' => '62',
  2316. 'createdDate' => '2009-03-14',
  2317. 'sql' => <<<EOT
  2318. select t1.actor,LEFT(t1.`date`,10) as `day` from zt_action t1
  2319. left join zt_user as t2 on t1.actor = t2.account
  2320. where t1.`action`='login'
  2321. and if(\$startDate='',1=1,LEFT(t1.`date`, 10)>=\$startDate)
  2322. and if(\$endDate='',1=1,LEFT(t1.`date`, 10)<=\$endDate)
  2323. and if(\$dept='',1=1,t2.`dept`=\$dept)
  2324. and not (\$startDate='' and \$endDate='' and \$dept='')
  2325. order by t1.`date` asc, t1.actor asc
  2326. EOT
  2327. ,
  2328. 'settings' => array
  2329. (
  2330. 'summary' => 'use',
  2331. 'group1' => 'actor',
  2332. 'columns' => array
  2333. (
  2334. array('field' => 'day', 'slice' => 'day', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  2335. ),
  2336. 'columnTotal' => 'sum'
  2337. ),
  2338. 'filters' => array
  2339. (
  2340. array('from' => 'query', 'field' => 'startDate', 'name' => '起始时间', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  2341. array('from' => 'query', 'field' => 'endDate', 'name' => '结束时间', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY'),
  2342. array('from' => 'query', 'field' => 'dept', 'name' => '部门', 'type' => 'select', 'typeOption' => 'dept', 'default' => '0')
  2343. ),
  2344. 'fields' => array
  2345. (
  2346. 'actor' => array('object' => 'action', 'field' => 'actor', 'type' => 'user'),
  2347. 'day' => array('object' => 'action', 'field' => 'day', 'type' => 'string')
  2348. ),
  2349. 'langs' => array
  2350. (
  2351. 'actor' => array('name' => '操作者', 'zh-cn' => '操作者', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2352. 'day' => array('name' => 'day', 'zh-cn' => '日期', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2353. ),
  2354. 'vars' => array
  2355. (
  2356. 'varName' => array('startDate', 'endDate'),
  2357. 'showName' => array('起始时间', '结束时间'),
  2358. 'requestType' => array('date', 'date'),
  2359. 'selectList' => array('user', 'user'),
  2360. 'default' => array('$MONTHBEGIN', '$MONTHEND')
  2361. ),
  2362. 'drills' => array
  2363. (
  2364. array
  2365. (
  2366. 'field' => 'day',
  2367. 'object' => 'action',
  2368. 'whereSql' => "left join (select date(date) `day`,id from zt_action) t2 on t2.id=t1.id WHERE t1.`action`='login' AND if(\$startDate='',1,`date`>=\$startDate) AND if(\$endDate='',1,`date`<=\$endDate)",
  2369. 'condition' => array
  2370. (
  2371. array('drillAlias' => 't2', 'queryField' => 'day', 'drillObject' => '', 'drillField' => 'day'),
  2372. array('drillObject' => 'zt_action', 'drillAlias' => 't1', 'drillField' => 'actor', 'queryField' => 'actor')
  2373. )
  2374. )
  2375. ),
  2376. 'stage' => 'published',
  2377. 'builtin' => '1'
  2378. );
  2379. $config->bi->builtin->pivots[] = array
  2380. (
  2381. 'id' => 1023,
  2382. 'version' => '1',
  2383. 'name' => array('zh-cn' => '日志汇总表', 'zh-tw' => '日誌匯總表', 'en' => 'Effort Summary', 'de' => 'Effort Summary', 'fr' => 'Effort Summary'),
  2384. 'code' => 'effortSummary',
  2385. 'desc' => array('zh-cn' => '查看某个时间段内的日志情况,可以按照部门选择。', 'zh-tw' => '查看某個時間段內的日誌情況,可以按照部門選擇。', 'en' => 'Effort summary of users within a certain period of time, you can select by department.', 'de' => 'Effort summary of users within a certain period of time, you can select by department.', 'fr' => 'Effort summary of users within a certain period of time, you can select by department.'),
  2386. 'dimension' => '1',
  2387. 'driver' => 'mysql',
  2388. 'group' => '62',
  2389. 'createdDate' => '2009-03-14',
  2390. 'sql' => <<<EOT
  2391. select
  2392. t1.account,
  2393. t1.consumed,
  2394. t1.`date`,
  2395. t2.dept as dept
  2396. from zt_effort as t1
  2397. left join zt_user as t2 on t1.account = t2.account
  2398. left join zt_dept as t3 on t2.dept = t3.id
  2399. where t1.`deleted` = '0'
  2400. and (case when \$startDate='' then 1=1 else cast(t1.`date` as date) >= cast(\$startDate as date) end)
  2401. and (case when \$endDate='' then 1=1 else cast(t1.`date` as date) <= cast(\$endDate as date) end)
  2402. and (t3.path like concat((select path from zt_dept where id=\$dept), '%') or \$dept=0)
  2403. and not (\$startDate='' and \$endDate='' and \$dept='')
  2404. order by t1.`date` asc
  2405. EOT
  2406. ,
  2407. 'settings' => array
  2408. (
  2409. 'group1' => 'account',
  2410. 'columnTotal' => 'sum',
  2411. 'columns' => array
  2412. (
  2413. array('field' => 'consumed', 'slice' => 'date', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0)
  2414. ),
  2415. 'lastStep' => '4',
  2416. 'summary' => 'use'
  2417. ),
  2418. 'filters' => array
  2419. (
  2420. array('from' => 'query', 'field' => 'dept', 'name' => '部门', 'type' => 'select', 'typeOption' => 'dept', 'default' => '0'),
  2421. array('from' => 'query', 'field' => 'startDate', 'name' => '起始时间', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  2422. array('from' => 'query', 'field' => 'endDate', 'name' => '结束时间', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY')
  2423. ),
  2424. 'fields' => array
  2425. (
  2426. 'account' => array('object' => 'effort', 'field' => 'account', 'type' => 'user'),
  2427. 'consumed' => array('object' => 'effort', 'field' => 'consumed', 'type' => 'number'),
  2428. 'date' => array('object' => 'effort', 'field' => 'date', 'type' => 'date'),
  2429. 'dept' => array('object' => 'effort', 'field' => 'dept', 'type' => 'number')
  2430. ),
  2431. 'langs' => array
  2432. (
  2433. 'account' => array('name' => 'account', 'zh-cn' => '名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2434. 'consumed' => array('name' => 'consumed', 'zh-cn' => '消耗工时', 'zh-tw' => '消耗工时', 'en' => 'Cost', 'de' => '', 'fr' => ''),
  2435. 'date' => array('name' => 'date', 'zh-cn' => '日期', 'zh-tw' => '日期', 'en' => 'Date', 'de' => '', 'fr' => ''),
  2436. 'dept' => array('name' => 'dept', 'zh-cn' => '部门', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2437. ),
  2438. 'vars' => array
  2439. (
  2440. 'varName' => array('dept', 'startDate', 'endDate'),
  2441. 'showName' => array('部门', '起始时间', '结束时间'),
  2442. 'requestType' => array('select', 'date', 'date'),
  2443. 'selectList' => array('dept', 'user', 'user'),
  2444. 'default' => array('', '$MONTHBEGIN', '$MONTHEND')
  2445. ),
  2446. 'drills' => array
  2447. (
  2448. array
  2449. (
  2450. 'field' => 'consumed',
  2451. 'object' => 'effort',
  2452. 'whereSql' => "left join zt_user as t2 on t1.account = t2.account left join zt_dept as t3 on t2.dept = t3.id where t1.`deleted` = '0' and (case when \$startDate='' then 1=1 else cast(t1.`date` as date) >= cast(\$startDate as date) end) and (case when \$endDate='' then 1=1 else cast(t1.`date` as date) <= cast(\$endDate as date) end) and (t3.path like concat((select path from zt_dept where id=\$dept), '%') or \$dept=0) order by t1.`date` asc",
  2453. 'condition' => array
  2454. (
  2455. array('drillObject' => 'zt_effort', 'drillAlias' => 't1', 'drillField' => 'account', 'queryField' => 'account'),
  2456. array('drillObject' => 'zt_effort', 'drillAlias' => 't1', 'drillField' => 'date', 'queryField' => 'date')
  2457. )
  2458. )
  2459. ),
  2460. 'stage' => 'published',
  2461. 'builtin' => '1'
  2462. );
  2463. $config->bi->builtin->pivots[] = array
  2464. (
  2465. 'id' => 1024,
  2466. 'version' => '1',
  2467. 'name' => array('zh-cn' => '公司动态汇总表', 'zh-tw' => '公司動態匯總表', 'en' => 'Company Dynamics', 'de' => 'Company Dynamics', 'fr' => 'Company Dynamics'),
  2468. 'code' => 'companyDynamics',
  2469. 'desc' => array('zh-cn' => '可以指定一个时期,列出相应的数据:1. 每天的登录次数。2. 每天的日志工时量。3. 每天新增的需求数。4. 每天关闭的需求数。5. 每天新增的任务数。6. 每天完成的任务数。7. 每天新增的Bug数。8. 每天解决的Bug数。9. 每天的动态数。', 'zh-tw' => '可以指定一個時期,列出相應的數據:1. 每天的登錄次數。2. 每天的日誌工時量。3. 每天新增的需求數。4. 每天關閉的需求數。5. 每天新增的任務數。6. 每天完成的任務數。7. 每天新增的Bug數。8. 每天解決的Bug數。9. 每天的動態數。', 'en' => 'The summary of company dynamics', 'de' => 'The summary of company dynamics', 'fr' => 'The summary of company dynamics'),
  2470. 'dimension' => '1',
  2471. 'driver' => 'mysql',
  2472. 'group' => '62',
  2473. 'createdDate' => '2009-03-14',
  2474. 'sql' => <<<EOT
  2475. select t1.day,t2.userlogin,t3.consumed,t4.storyopen,t5.storyclose,t6.taskopen,t7.taskfinish,t8.bugopen,t9.bugresolve,t1.actions from ztv_dayactions as t1
  2476. left join ztv_dayuserlogin as t2 on t1.day=t2.day
  2477. left join ztv_dayeffort as t3 on t1.day=t3.date
  2478. left join ztv_daystoryopen as t4 on t1.day=t4.day
  2479. left join ztv_daystoryclose as t5 on t1.day=t5.day
  2480. left join ztv_daytaskopen as t6 on t1.day=t6.day
  2481. left join ztv_daytaskfinish as t7 on t1.day=t7.day
  2482. left join ztv_daybugopen as t8 on t1.day=t8.day
  2483. left join ztv_daybugresolve as t9 on t1.day=t9.day
  2484. where if(\$startDate='',1=1,t1.day>=\$startDate)
  2485. and if(\$endDate='',1=1,t1.day<=\$endDate)
  2486. and not (\$startDate='' and \$endDate='')
  2487. EOT
  2488. ,
  2489. 'settings' => array
  2490. (
  2491. 'summary' => 'use',
  2492. 'group1' => 'day',
  2493. 'columns' => array
  2494. (
  2495. array('field' => 'userlogin', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2496. array('field' => 'consumed', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2497. array('field' => 'storyopen', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2498. array('field' => 'storyclose', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2499. array('field' => 'taskopen', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2500. array('field' => 'taskfinish', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2501. array('field' => 'bugopen', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2502. array('field' => 'bugresolve', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2503. array('field' => 'actions', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  2504. ),
  2505. 'columnTotal' => 'sum'
  2506. ),
  2507. 'filters' => array
  2508. (
  2509. array('from' => 'query', 'field' => 'startDate', 'name' => '起始时间', 'type' => 'date', 'typeOption' => '', 'default' => '$MONDAY'),
  2510. array('from' => 'query', 'field' => 'endDate', 'name' => '结束时间', 'type' => 'date', 'typeOption' => '', 'default' => '$SUNDAY')
  2511. ),
  2512. 'fields' => array
  2513. (
  2514. 'day' => array('object' => '', 'field' => 'day', 'type' => 'string'),
  2515. 'userlogin' => array('object' => '', 'field' => 'userlogin', 'type' => 'string'),
  2516. 'consumed' => array('object' => '', 'field' => 'consumed', 'type' => 'number'),
  2517. 'storyopen' => array('object' => '', 'field' => 'storyopen', 'type' => 'string'),
  2518. 'storyclose' => array('object' => '', 'field' => 'storyclose', 'type' => 'string'),
  2519. 'taskopen' => array('object' => '', 'field' => 'taskopen', 'type' => 'string'),
  2520. 'taskfinish' => array('object' => '', 'field' => 'taskfinish', 'type' => 'string'),
  2521. 'bugopen' => array('object' => '', 'field' => 'bugopen', 'type' => 'string'),
  2522. 'bugresolve' => array('object' => '', 'field' => 'bugresolve', 'type' => 'string'),
  2523. 'actions' => array('object' => '', 'field' => 'actions', 'type' => 'string')
  2524. ),
  2525. 'langs' => array
  2526. (
  2527. 'day' => array('zh-cn' => '日期', 'zh-tw' => '日期', 'en' => 'Date'),
  2528. 'userlogin' => array('zh-cn' => '登录次数', 'zh-tw' => '登錄次數', 'en' => 'Login'),
  2529. 'consumed' => array('zh-cn' => '日志工时', 'zh-tw' => '日誌工時', 'en' => 'Cost(h)'),
  2530. 'storyopen' => array('zh-cn' => '新增需求数', 'zh-tw' => '新增需求數', 'en' => 'Open Story'),
  2531. 'storyclose' => array('zh-cn' => '关闭需求数', 'zh-tw' => '關閉需求數', 'en' => 'Closed Story'),
  2532. 'taskopen' => array('zh-cn' => '新增任务数', 'zh-tw' => '新增任務數', 'en' => 'Open Task'),
  2533. 'taskfinish' => array('zh-cn' => '完成任务数', 'zh-tw' => '完成任務數', 'en' => 'Finished Task'),
  2534. 'bugopen' => array('zh-cn' => '新增Bug数', 'zh-tw' => '新增Bug數', 'en' => 'Open Bug'),
  2535. 'bugresolve' => array('zh-cn' => '解决Bug数', 'zh-tw' => '解决Bug數', 'en' => 'Resolved bug'),
  2536. 'actions' => array('zh-cn' => '动态数', 'zh-tw' => '動態數', 'en' => 'Dynamics')
  2537. ),
  2538. 'vars' => array
  2539. (
  2540. 'varName' => array('startDate', 'endDate'),
  2541. 'showName' => array('起始时间', '结束时间'),
  2542. 'requestType' => array('date', 'date'),
  2543. 'selectList' => array('user', 'user'),
  2544. 'default' => array('$MONTHBEGIN', '$MONTHEND')
  2545. ),
  2546. 'drills' => array
  2547. (
  2548. array
  2549. (
  2550. 'field' => 'userlogin',
  2551. 'object' => 'action',
  2552. 'whereSql' => "left join ztv_dayuserlogin t2 on date(t1.date)=t2.day where ((t1.objectType = 'user') and (t1.action = 'login')) and if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2553. 'condition' => array
  2554. (
  2555. array('drillObject' => 'ztv_dayuserlogin', 'drillAlias' => 't2', 'drillField' => 'day', 'queryField' => 'day')
  2556. )
  2557. ),
  2558. array
  2559. (
  2560. 'field' => 'consumed',
  2561. 'object' => 'effort',
  2562. 'whereSql' => "where if(\$startDate='',1,t1.date>=\$startDate) and if(\$endDate='',1,t1.date<=\$endDate) ",
  2563. 'condition' => array
  2564. (
  2565. array('drillObject' => 'zt_effort', 'drillAlias' => 't1', 'drillField' => 'date', 'queryField' => 'day')
  2566. )
  2567. ),
  2568. array
  2569. (
  2570. 'field' => 'storyopen',
  2571. 'object' => 'story',
  2572. 'whereSql' => "right join (select objectID,date(`date`) day from zt_action where objectType = 'story' and action = 'opened') t2 on t2.objectID=t1.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2573. 'condition' => array
  2574. (
  2575. array('drillAlias' => 't2', 'queryField' => 'day', 'drillObject' => '', 'drillField' => 'day')
  2576. )
  2577. ),
  2578. array
  2579. (
  2580. 'field' => 'storyclose',
  2581. 'object' => 'story',
  2582. 'whereSql' => "right join (select objectID,date(`date`) day from zt_action where objectType = 'story' and action = 'closed') t2 on t2.objectID=t1.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2583. 'condition' => array
  2584. (
  2585. array('drillAlias' => 't2', 'queryField' => 'day', 'drillObject' => '', 'drillField' => 'day')
  2586. )
  2587. ),
  2588. array
  2589. (
  2590. 'field' => 'taskopen',
  2591. 'object' => 'task',
  2592. 'whereSql' => "right join (select objectID,date(`date`) day from zt_action where objectType = 'task' and action = 'opened') t2 on t2.objectID=t1.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2593. 'condition' => array
  2594. (
  2595. array('drillAlias' => 't2', 'queryField' => 'day', 'drillObject' => '', 'drillField' => 'day')
  2596. )
  2597. ),
  2598. array
  2599. (
  2600. 'field' => 'taskfinish',
  2601. 'object' => 'task',
  2602. 'whereSql' => "right join (select objectID,date(`date`) day from zt_action where objectType = 'task' and action = 'finished') t2 on t2.objectID=t1.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2603. 'condition' => array
  2604. (
  2605. array('drillAlias' => 't2', 'queryField' => 'day', 'drillObject' => '', 'drillField' => 'day')
  2606. )
  2607. ),
  2608. array
  2609. (
  2610. 'field' => 'bugopen',
  2611. 'object' => 'bug',
  2612. 'whereSql' => "right join (select objectID,date(`date`) day from zt_action where objectType = 'bug' and action = 'opened') t2 on t2.objectID=t1.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2613. 'condition' => array
  2614. (
  2615. array('drillAlias' => 't2', 'queryField' => 'day', 'drillObject' => '', 'drillField' => 'day')
  2616. )
  2617. ),
  2618. array
  2619. (
  2620. 'field' => 'bugresolve',
  2621. 'object' => 'bug',
  2622. 'whereSql' => "right join (select objectID,date(`date`) day from zt_action where objectType = 'bug' and action = 'resolved') t2 on t2.objectID=t1.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2623. 'condition' => array
  2624. (
  2625. array('drillObject' => '', 'drillAlias' => 't2', 'drillField' => 'day', 'queryField' => 'day')
  2626. )
  2627. ),
  2628. array
  2629. (
  2630. 'field' => 'actions',
  2631. 'object' => 'action',
  2632. 'whereSql' => "left join (select id,date(`date`) day from zt_action) t2 on t1.id=t2.id where if(\$startDate='',1,t2.day>=\$startDate) and if(\$endDate='',1,t2.day<=\$endDate)",
  2633. 'condition' => array
  2634. (
  2635. array('drillObject' => '', 'drillAlias' => 't2', 'drillField' => 'day', 'queryField' => 'day')
  2636. )
  2637. )
  2638. ),
  2639. 'stage' => 'published',
  2640. 'builtin' => '1'
  2641. );
  2642. $config->bi->builtin->pivots[] = array
  2643. (
  2644. 'id' => 1025,
  2645. 'version' => '1',
  2646. 'name' => array('zh-cn' => 'Bug解决表', 'zh-tw' => 'Bug解決表', 'en' => 'Solved Bugs', 'de' => 'Solved Bugs', 'fr' => 'Solved Bugs'),
  2647. 'code' => 'slovedBugs',
  2648. 'desc' => array('zh-cn' => '列出解决的Bug总数,解决方案的分布,占的比例(该用户解决的Bug的数量占所有的解决的Bug的数量)。', 'zh-tw' => '列出解決的Bug總數,解決方案的分布,占的比例(該用戶解決的Bug的數量占所有的解決的Bug的數量)。', 'en' => 'percentage:self resolved / all resolved', 'de' => 'percentage:self resolved / all resolved', 'fr' => 'percentage:self resolved / all resolved'),
  2649. 'dimension' => '1',
  2650. 'driver' => 'mysql',
  2651. 'group' => '61',
  2652. 'createdDate' => '2009-03-14',
  2653. 'sql' => <<<EOT
  2654. select
  2655. t1.resolvedBy,t1.resolution
  2656. from zt_bug as t1
  2657. left join zt_product as t2 on t1.product = t2.id
  2658. where t1.deleted='0'
  2659. and t2.deleted='0'
  2660. and t1.resolution!=''
  2661. and (case when \$startDate='' then 1=1 else cast(t1.resolvedDate as date)>=cast(\$startDate as date) end)
  2662. and (case when \$endDate='' then 1=1 else cast(t1.resolvedDate as date)<=cast(\$endDate as date) end)
  2663. and (case when \$product = '' then 1=1 else t1.product=\$product end)
  2664. and not (\$product='' and \$startDate='' and \$endDate='')
  2665. EOT
  2666. ,
  2667. 'settings' => array
  2668. (
  2669. 'summary' => 'use',
  2670. 'columns' => array
  2671. (
  2672. array('field' => 'resolution', 'slice' => 'resolution', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'row', 'monopolize' => 1, 'showOrigin' => 0)
  2673. ),
  2674. 'columnTotal' => 'sum',
  2675. 'group1' => 'resolvedBy'
  2676. ),
  2677. 'filters' => array
  2678. (
  2679. array('from' => 'query', 'field' => 'product', 'name' => '产品', 'type' => 'select', 'typeOption' => 'product', 'default' => '0'),
  2680. array('from' => 'query', 'field' => 'startDate', 'name' => '解决日期开始', 'type' => 'date', 'typeOption' => '', 'default' => '$MONTHBEGIN'),
  2681. array('from' => 'query', 'field' => 'endDate', 'name' => '解决日期结束', 'type' => 'date', 'typeOption' => '', 'default' => '$MONTHEND')
  2682. ),
  2683. 'fields' => array
  2684. (
  2685. 'resolvedBy' => array('object' => 'bug', 'field' => 'resolvedBy', 'type' => 'user'),
  2686. 'resolution' => array('object' => 'bug', 'field' => 'resolution', 'type' => 'option')
  2687. ),
  2688. 'langs' => array
  2689. (
  2690. 'resolvedBy' => array('zh-cn' => '解决者', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2691. 'resolution' => array('zh-cn' => '不同解决方案的Bug', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2692. ),
  2693. 'vars' => array
  2694. (
  2695. 'varName' => array('product', 'startDate', 'endDate'),
  2696. 'showName' => array('产品', '解决日期开始', '解决日期结束'),
  2697. 'requestType' => array('select', 'date', 'date'),
  2698. 'selectList' => array('product', 'user', 'user'),
  2699. 'default' => array('', '$MONTHBEGIN', '$MONTHEND')
  2700. ),
  2701. 'drills' => array
  2702. (
  2703. array
  2704. (
  2705. 'field' => 'resolution',
  2706. 'object' => 'bug',
  2707. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id WHERE t1.deleted='0' AND t1.resolution!='' and (case when \$startDate='' then 1=1 else cast(t1.resolvedDate as date)>=cast(\$startDate as date) end) and (case when \$endDate='' then 1=1 else cast(t1.resolvedDate as date)<=cast(\$endDate as date) end) and (case when \$product = '' then 1=1 else t1.product=\$product end)",
  2708. 'condition' => array
  2709. (
  2710. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolvedBy', 'queryField' => 'resolvedBy'),
  2711. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolution', 'queryField' => 'resolution')
  2712. )
  2713. )
  2714. ),
  2715. 'stage' => 'published',
  2716. 'builtin' => '1'
  2717. );
  2718. $config->bi->builtin->pivots[] = array
  2719. (
  2720. 'id' => 1026,
  2721. 'version' => '1',
  2722. 'name' => array('zh-cn' => '项目进展表', 'zh-tw' => '項目進展表', 'en' => 'Project Progress Report', 'de' => 'Project Progress Report', 'fr' => 'Project Progress Report', 'vi' => 'Project Progress Report', 'ja' => 'Project Progress Report'),
  2723. 'code' => 'projectProgress',
  2724. 'desc' => array('zh-cn' => '项目的:需求数,剩余需求数(过滤状态为已关闭的需求),任务数,剩余任务数(过滤状态为已完成和已关闭的任务),剩余工时(剩余任务的剩余工时),已消耗工时。', 'zh-tw' => '項目的需求數,任務數,已消耗工時,剩餘工時,剩餘需求數,剩餘任務數,進度。', 'en' => '', 'de' => '', 'fr' => '', 'vi' => '', 'ja' => ''),
  2725. 'dimension' => '1',
  2726. 'driver' => 'mysql',
  2727. 'group' => '60',
  2728. 'createdDate' => '2009-03-14',
  2729. 'sql' => <<<EOT
  2730. select
  2731. t1.id,
  2732. t4.name as projectname,
  2733. t4.id as project,
  2734. t1.name as executionname,
  2735. t1.id as execution,
  2736. t1.status,
  2737. t2.number as tasks,
  2738. round(t2.consumed,2) as consumed,
  2739. round(t2.`left`,2) as `left`,
  2740. t3.stories,
  2741. t2.undone as undoneTask,
  2742. t3.undone as undoneStory,
  2743. t2.totalReal from zt_project as t1
  2744. left join ztv_executionsummary as t2 on t1.id=t2.execution
  2745. left join ztv_projectstories as t3 on t1.id=t3.execution
  2746. left join zt_project as t4 on t4.id=t1.project
  2747. where t1.deleted='0'
  2748. and t1.type in ('sprint','stage')
  2749. and (case when \$projectStatus='' then 1=1 else t4.status=\$projectStatus end)
  2750. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  2751. and (case when \$project='' then 1=1 else t4.id=\$project end)
  2752. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  2753. EOT
  2754. ,
  2755. 'settings' => array
  2756. (
  2757. 'summary' => 'use',
  2758. 'columns' => array
  2759. (
  2760. array('field' => 'stories', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2761. array('field' => 'undoneStory', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2762. array('field' => 'tasks', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2763. array('field' => 'undoneTask', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2764. array('field' => 'left', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0),
  2765. array('field' => 'consumed', 'slice' => 'noSlice', 'stat' => 'sum', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  2766. ),
  2767. 'columnTotal' => 'sum',
  2768. 'group1' => 'projectname',
  2769. 'group2' => 'executionname'
  2770. ),
  2771. 'filters' => array
  2772. (
  2773. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  2774. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  2775. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  2776. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  2777. ),
  2778. 'fields' => array
  2779. (
  2780. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  2781. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  2782. 'project' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  2783. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  2784. 'execution' => array('object' => 'project', 'field' => 'id', 'type' => 'string'),
  2785. 'status' => array('object' => 'project', 'field' => 'status', 'type' => 'option'),
  2786. 'tasks' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  2787. 'consumed' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2788. 'left' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2789. 'stories' => array('object' => 'project', 'field' => '', 'type' => 'string'),
  2790. 'undoneTask' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2791. 'undoneStory' => array('object' => 'project', 'field' => '', 'type' => 'number'),
  2792. 'totalReal' => array('object' => 'project', 'field' => '', 'type' => 'number')
  2793. ),
  2794. 'langs' => array
  2795. (
  2796. 'id' => array('zh-cn' => 'id', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2797. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2798. 'project' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2799. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2800. 'execution' => array('zh-cn' => '执行ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2801. 'status' => array('zh-cn' => '状态', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2802. 'tasks' => array('zh-cn' => '任务数', 'zh-tw' => '任务数', 'en' => 'Tasks', 'de' => '', 'fr' => ''),
  2803. 'consumed' => array('zh-cn' => '已消耗工时', 'zh-tw' => '已消耗工时', 'en' => 'Cost(h)', 'de' => '', 'fr' => ''),
  2804. 'left' => array('zh-cn' => '剩余工时', 'zh-tw' => '剩余工时', 'en' => 'Left(h)', 'de' => '', 'fr' => ''),
  2805. 'stories' => array('zh-cn' => '需求数', 'zh-tw' => '需求数', 'en' => 'Stories', 'de' => '', 'fr' => ''),
  2806. 'undoneTask' => array('zh-cn' => '剩余任务数', 'zh-tw' => '剩余任务数', 'en' => 'Undone Task', 'de' => '', 'fr' => ''),
  2807. 'undoneStory' => array('zh-cn' => '剩余需求数', 'zh-tw' => '剩余需求数', 'en' => 'Undone Story', 'de' => '', 'fr' => ''),
  2808. 'totalReal' => array('zh-cn' => 'totalReal', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2809. ),
  2810. 'vars' => array
  2811. (
  2812. 'varName' => array('project', 'execution', 'status'),
  2813. 'showName' => array('项目列表', '执行列表', '执行状态'),
  2814. 'requestType' => array('select', 'select', 'select'),
  2815. 'selectList' => array('project', 'execution', 'project.status'),
  2816. 'default' => array('', '', '')
  2817. ),
  2818. 'drills' => array
  2819. (
  2820. array
  2821. (
  2822. 'field' => 'stories',
  2823. 'object' => 'story',
  2824. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in ('sprint','stage') and t1.deleted='0'",
  2825. 'condition' => array
  2826. (
  2827. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  2828. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname')
  2829. )
  2830. ),
  2831. array
  2832. (
  2833. 'field' => 'undoneStory',
  2834. 'object' => 'story',
  2835. 'whereSql' => "right join zt_projectstory as t2 on t2.story=t1.id left join zt_project as t3 on t2.project=t3.id left join zt_project as t4 on t4.id=t3.project where t3.deleted='0' and t3.type in ('sprint','stage') and t1.status !='closed' and t1.deleted='0'",
  2836. 'condition' => array
  2837. (
  2838. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'executionname'),
  2839. array('drillObject' => 'zt_project', 'drillAlias' => 't4', 'drillField' => 'name', 'queryField' => 'projectname')
  2840. )
  2841. ),
  2842. array
  2843. (
  2844. 'field' => 'tasks',
  2845. 'object' => 'task',
  2846. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t2.type in ('sprint','stage')",
  2847. 'condition' => array
  2848. (
  2849. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2850. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2851. )
  2852. ),
  2853. array
  2854. (
  2855. 'field' => 'undoneTask',
  2856. 'object' => 'task',
  2857. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t2.type in ('sprint','stage') and t1.status not in ('closed','done')",
  2858. 'condition' => array
  2859. (
  2860. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2861. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2862. )
  2863. ),
  2864. array
  2865. (
  2866. 'field' => 'left',
  2867. 'object' => 'task',
  2868. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t2.type in ('sprint','stage') and t1.status not in ('closed','done')",
  2869. 'condition' => array
  2870. (
  2871. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2872. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2873. )
  2874. ),
  2875. array
  2876. (
  2877. 'field' => 'consumed',
  2878. 'object' => 'task',
  2879. 'whereSql' => "left join zt_project as t2 on t1.execution = t2.id left join zt_project as t3 on t3.id=t2.project where t2.deleted='0' and t1.deleted='0' and t2.type in ('sprint','stage')",
  2880. 'condition' => array
  2881. (
  2882. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2883. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname')
  2884. )
  2885. )
  2886. ),
  2887. 'stage' => 'published',
  2888. 'builtin' => '1'
  2889. );
  2890. $config->bi->builtin->pivots[] = array
  2891. (
  2892. 'id' => 1027,
  2893. 'version' => '1',
  2894. 'name' => array('zh-cn' => '项目执行Bug类型统计表', 'zh-tw' => '項目Bug類型統計表', 'en' => 'Project Bug Type', 'de' => 'Project Bug Type', 'fr' => 'Project Bug Type'),
  2895. 'code' => 'projectBugType',
  2896. 'desc' => array('zh-cn' => '按照项目下不同执行统计Bug的类型分布情况。', 'zh-tw' => '按照項目統計Bug的類型分布情況。'),
  2897. 'dimension' => '1',
  2898. 'driver' => 'mysql',
  2899. 'group' => '60,61',
  2900. 'createdDate' => '2009-03-14',
  2901. 'sql' => <<<EOT
  2902. select
  2903. t1.id,
  2904. t2.project as project,
  2905. t3.name as projectname,
  2906. t1.id as execution,
  2907. t1.name as executionname,
  2908. t2.id as bugID,
  2909. t2.type from zt_project as t1
  2910. left join zt_bug as t2 on t1.id=t2.execution
  2911. left join zt_project as t3 on t3.id=t1.project
  2912. where t1.deleted='0'
  2913. and t2.deleted='0'
  2914. and (case when \$projectStatus='' then 1=1 else t3.status=\$projectStatus end)
  2915. and (case when \$executionStatus='' then 1=1 else t1.status=\$executionStatus end)
  2916. and (case when \$project='' then 1=1 else t3.id=\$project end)
  2917. and (case when \$execution='' then 1=1 else t1.id=\$execution end)
  2918. EOT
  2919. ,
  2920. 'settings' => array
  2921. (
  2922. 'summary' => 'use',
  2923. 'columns' => array
  2924. (
  2925. array('field' => 'type', 'slice' => 'type', 'stat' => 'count', 'showTotal' => 'noShow', 'showMode' => 'default', 'monopolize' => 0, 'showOrigin' => 0)
  2926. ),
  2927. 'columnTotal' => 'sum',
  2928. 'group1' => 'projectname',
  2929. 'group2' => 'executionname'
  2930. ),
  2931. 'filters' => array
  2932. (
  2933. array('from' => 'query', 'field' => 'projectStatus', 'name' => '项目状态', 'type' => 'select', 'typeOption' => 'project.status', 'default' => 'doing'),
  2934. array('from' => 'query', 'field' => 'executionStatus', 'name' => '执行状态', 'type' => 'select', 'typeOption' => 'execution.status', 'default' => 'doing'),
  2935. array('from' => 'query', 'field' => 'project', 'name' => '项目列表', 'type' => 'select', 'typeOption' => 'project', 'default' => '0'),
  2936. array('from' => 'query', 'field' => 'execution', 'name' => '执行列表', 'type' => 'select', 'typeOption' => 'execution', 'default' => '0')
  2937. ),
  2938. 'fields' => array
  2939. (
  2940. 'id' => array('object' => 'project', 'field' => 'id', 'type' => 'number'),
  2941. 'project' => array('object' => 'project', 'field' => 'name', 'type' => 'object'),
  2942. 'projectname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  2943. 'execution' => array('object' => 'project', 'field' => 'id', 'type' => 'string'),
  2944. 'executionname' => array('object' => 'project', 'field' => 'name', 'type' => 'string'),
  2945. 'bugID' => array('object' => 'bug', 'field' => '', 'type' => 'number'),
  2946. 'type' => array('object' => 'bug', 'field' => 'type', 'type' => 'option')
  2947. ),
  2948. 'langs' => array
  2949. (
  2950. 'id' => array('zh-cn' => '项目ID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2951. 'project' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2952. 'projectname' => array('zh-cn' => '项目名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2953. 'execution' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2954. 'executionname' => array('zh-cn' => '执行名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2955. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  2956. 'type' => array('zh-cn' => '不同类型的Bug', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  2957. ),
  2958. 'vars' => array
  2959. (
  2960. 'varName' => array('project', 'execution'),
  2961. 'showName' => array('项目列表', '执行列表'),
  2962. 'requestType' => array('select', 'select'),
  2963. 'selectList' => array('project', 'execution'),
  2964. 'default' => array('', '')
  2965. ),
  2966. 'drills' => array
  2967. (
  2968. array
  2969. (
  2970. 'field' => 'type',
  2971. 'object' => 'bug',
  2972. 'whereSql' => "left join zt_project as t2 on t2.id=t1.execution left join zt_project as t3 on t3.id=t2.project where t1.deleted='0' and t2.deleted='0'",
  2973. 'condition' => array
  2974. (
  2975. array('drillObject' => 'zt_project', 'drillAlias' => 't2', 'drillField' => 'name', 'queryField' => 'executionname'),
  2976. array('drillObject' => 'zt_project', 'drillAlias' => 't3', 'drillField' => 'name', 'queryField' => 'projectname'),
  2977. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'type', 'queryField' => 'type')
  2978. )
  2979. )
  2980. ),
  2981. 'stage' => 'published',
  2982. 'builtin' => '1'
  2983. );
  2984. $config->bi->builtin->pivots[] = array
  2985. (
  2986. 'id' => 1028,
  2987. 'version' => '1',
  2988. 'name' => array('zh-cn' => '产品Bug解决方案统计表', 'zh-tw' => '産品Bug解決方案統計表', 'en' => 'Bug Solution of Product'),
  2989. 'code' => 'productBugSolution',
  2990. 'desc' => array('zh-cn' => '按照产品统计Bug的解决方案分布情况。', 'zh-tw' => '按照産品統計Bug的解決方案分布情況。', 'en' => 'Solution distribution of bugs.'),
  2991. 'dimension' => '1',
  2992. 'driver' => 'mysql',
  2993. 'group' => '59,61',
  2994. 'createdDate' => '2009-03-14',
  2995. 'sql' => <<<EOT
  2996. select t1.product,t2.name,t1.id as bugID,t1.resolution from zt_bug as t1
  2997. left join zt_product as t2 on t2.id=t1.product
  2998. left join zt_project as t3 on t2.program=t3.id
  2999. where t2.deleted='0' and t1.deleted='0'
  3000. and t2.shadow='0'
  3001. and t1.resolution != ''
  3002. and (case when \$productStatus='' then 1=1 else t2.status=\$productStatus end)
  3003. and (case when \$productType='' then 1=1 else t2.type=\$productType end)
  3004. and (case when \$product='' then 1=1 else t2.id=\$product end)
  3005. order by t3.`order` asc, t2.line desc, t2.`order` asc
  3006. EOT
  3007. ,
  3008. 'settings' => array
  3009. (
  3010. 'group1' => 'product',
  3011. 'columnTotal' => 'sum',
  3012. 'columns' => array
  3013. (
  3014. array('field' => 'resolution', 'slice' => 'resolution', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => '0', 'showOrigin' => 0)
  3015. ),
  3016. 'summary' => 'use'
  3017. ),
  3018. 'filters' => array
  3019. (
  3020. array('from' => 'query', 'field' => 'productStatus', 'name' => '产品状态', 'type' => 'select', 'typeOption' => 'product.status', 'default' => 'normal'),
  3021. array('from' => 'query', 'field' => 'productType', 'name' => '产品类型', 'type' => 'select', 'typeOption' => 'product.type', 'default' => 'normal'),
  3022. array('from' => 'query', 'field' => 'product', 'name' => '产品列表', 'type' => 'select', 'typeOption' => 'product', 'default' => '0')
  3023. ),
  3024. 'fields' => array
  3025. (
  3026. 'product' => array('object' => 'product', 'field' => 'name', 'type' => 'object'),
  3027. 'name' => array('object' => 'product', 'field' => 'name', 'type' => 'string'),
  3028. 'bugID' => array('object' => 'bug', 'field' => 'id', 'type' => 'number'),
  3029. 'resolution' => array('object' => 'bug', 'field' => 'resolution', 'type' => 'option')
  3030. ),
  3031. 'langs' => array
  3032. (
  3033. 'product' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  3034. 'name' => array('zh-cn' => '产品名称', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  3035. 'bugID' => array('zh-cn' => 'bugID', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  3036. 'resolution' => array('zh-cn' => '解决方案', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  3037. ),
  3038. 'vars' => array(),
  3039. 'drills' => array
  3040. (
  3041. array
  3042. (
  3043. 'field' => 'resolution',
  3044. 'object' => 'bug',
  3045. 'whereSql' => " where t1.deleted='0' and t1.resolution != ''",
  3046. 'condition' => array
  3047. (
  3048. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolution', 'queryField' => 'resolution'),
  3049. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'product', 'queryField' => 'product')
  3050. )
  3051. )
  3052. ),
  3053. 'stage' => 'published',
  3054. 'builtin' => '1'
  3055. );
  3056. $config->bi->builtin->pivots[] = array
  3057. (
  3058. 'id' => 1025,
  3059. 'version' => '1.1',
  3060. 'name' => array('zh-cn' => 'Bug解决表', 'zh-tw' => 'Bug解決表', 'en' => 'Solved Bugs', 'de' => 'Solved Bugs', 'fr' => 'Solved Bugs'),
  3061. 'code' => 'slovedBugs',
  3062. 'desc' => array('zh-cn' => '列出解决的Bug总数,解决方案的分布,占的比例(该用户解决的Bug的数量占所有的解决的Bug的数量)。', 'zh-tw' => '列出解決的Bug總數,解決方案的分布,占的比例(該用戶解決的Bug的數量占所有的解決的Bug的數量)。', 'en' => 'percentage:self resolved / all resolved', 'de' => 'percentage:self resolved / all resolved', 'fr' => 'percentage:self resolved / all resolved'),
  3063. 'dimension' => '1',
  3064. 'driver' => 'mysql',
  3065. 'group' => '61',
  3066. 'createdDate' => '2009-03-14',
  3067. 'sql' => <<<EOT
  3068. select
  3069. t1.resolvedBy,t1.resolution
  3070. from zt_bug as t1
  3071. left join zt_product as t2 on t1.product = t2.id
  3072. where t1.deleted='0'
  3073. and t2.deleted='0'
  3074. and t1.resolution!=''
  3075. and (case when \$startDate='' then 1=1 else cast(t1.resolvedDate as date)>=cast(\$startDate as date) end)
  3076. and (case when \$endDate='' then 1=1 else cast(t1.resolvedDate as date)<=cast(\$endDate as date) end)
  3077. and (case when \$product = '' then 1=1 else t1.product=\$product end)
  3078. and not (\$product='' and \$startDate='' and \$endDate='')
  3079. EOT
  3080. ,
  3081. 'settings' => array
  3082. (
  3083. 'summary' => 'use',
  3084. 'columns' => array
  3085. (
  3086. array('field' => 'resolution', 'slice' => 'resolution', 'stat' => 'count', 'showTotal' => 'sum', 'showMode' => 'default', 'monopolize' => 1, 'showOrigin' => 0)
  3087. ),
  3088. 'columnTotal' => 'sum',
  3089. 'group1' => 'resolvedBy'
  3090. ),
  3091. 'filters' => array
  3092. (
  3093. array('from' => 'query', 'field' => 'product', 'name' => '产品', 'type' => 'select', 'typeOption' => 'product', 'default' => '0'),
  3094. array('from' => 'query', 'field' => 'startDate', 'name' => '解决日期开始', 'type' => 'date', 'typeOption' => '', 'default' => '$MONTHBEGIN'),
  3095. array('from' => 'query', 'field' => 'endDate', 'name' => '解决日期结束', 'type' => 'date', 'typeOption' => '', 'default' => '$MONTHEND')
  3096. ),
  3097. 'fields' => array
  3098. (
  3099. 'resolvedBy' => array('object' => 'bug', 'field' => 'resolvedBy', 'type' => 'user'),
  3100. 'resolution' => array('object' => 'bug', 'field' => 'resolution', 'type' => 'option')
  3101. ),
  3102. 'langs' => array
  3103. (
  3104. 'resolvedBy' => array('zh-cn' => '解决者', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => ''),
  3105. 'resolution' => array('zh-cn' => '不同解决方案的Bug', 'zh-tw' => '', 'en' => '', 'de' => '', 'fr' => '')
  3106. ),
  3107. 'vars' => array
  3108. (
  3109. 'varName' => array('product', 'startDate', 'endDate'),
  3110. 'showName' => array('产品', '解决日期开始', '解决日期结束'),
  3111. 'requestType' => array('select', 'date', 'date'),
  3112. 'selectList' => array('product', 'user', 'user'),
  3113. 'default' => array('', '$MONTHBEGIN', '$MONTHEND')
  3114. ),
  3115. 'drills' => array
  3116. (
  3117. array
  3118. (
  3119. 'field' => 'resolution',
  3120. 'object' => 'bug',
  3121. 'whereSql' => "left join zt_product as t2 on t1.product = t2.id WHERE t1.deleted='0' AND t1.resolution!='' and (case when \$startDate='' then 1=1 else cast(t1.resolvedDate as date)>=cast(\$startDate as date) end) and (case when \$endDate='' then 1=1 else cast(t1.resolvedDate as date)<=cast(\$endDate as date) end) and (case when \$product = '' then 1=1 else t1.product=\$product end)",
  3122. 'condition' => array
  3123. (
  3124. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolvedBy', 'queryField' => 'resolvedBy'),
  3125. array('drillObject' => 'zt_bug', 'drillAlias' => 't1', 'drillField' => 'resolution', 'queryField' => 'resolution')
  3126. )
  3127. )
  3128. ),
  3129. 'stage' => 'published',
  3130. 'builtin' => '1'
  3131. );