datamodel.itop-request-mgmt.xml 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
  3. <constants>
  4. <constant id="PORTAL_USERREQUEST_PUBLIC_LOG" xsi:type="string" _delta="define"><![CDATA[public_log]]></constant>
  5. <constant id="PORTAL_USERREQUEST_USER_COMMENT" xsi:type="string" _delta="define"><![CDATA[user_comment]]></constant>
  6. <constant id="PORTAL_USERREQUEST_FORM_ATTRIBUTES" xsi:type="string" _delta="define"><![CDATA[title,description,impact,urgency]]></constant>
  7. <constant id="PORTAL_USERREQUEST_TYPE" xsi:type="string" _delta="define"><![CDATA[request_type]]></constant>
  8. <constant id="PORTAL_USERREQUEST_LIST_ZLIST" xsi:type="string" _delta="define"><![CDATA[finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id]]></constant>
  9. <constant id="PORTAL_USERREQUEST_CLOSED_ZLIST" xsi:type="string" _delta="define"><![CDATA[title,start_date,close_date,servicesubcategory_id]]></constant>
  10. <constant id="PORTAL_USERREQUEST_DETAILS_ZLIST" xsi:type="string" _delta="define"><![CDATA[{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}]]></constant>
  11. <constant id="PORTAL_USERREQUEST_DISPLAY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT UserRequest WHERE org_id = :contact->org_id AND caller_id = :contact->id]]></constant>
  12. <constant id="PORTAL_USERREQUEST_DISPLAY_POWERUSER_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT UserRequest WHERE org_id = :contact->org_id]]></constant>
  13. </constants>
  14. <classes>
  15. <class id="UserRequest" _delta="define">
  16. <parent>Ticket</parent>
  17. <properties>
  18. <comment><![CDATA[/**
  19. * Persistent classes for a CMDB
  20. *
  21. * @copyright Copyright (C) 2010-2012 Combodo SARL
  22. * @license http://opensource.org/licenses/AGPL-3.0
  23. */]]></comment>
  24. <category>bizmodel,searchable,requestmgmt</category>
  25. <abstract>false</abstract>
  26. <key_type>autoincrement</key_type>
  27. <db_table>ticket_request</db_table>
  28. <db_key_field>id</db_key_field>
  29. <db_final_class_field/>
  30. <naming>
  31. <attributes>
  32. <attribute id="ref"/>
  33. </attributes>
  34. </naming>
  35. <display_template/>
  36. <icon>images/user-request.png</icon>
  37. <reconciliation>
  38. <attributes>
  39. <attribute id="ref"/>
  40. </attributes>
  41. </reconciliation>
  42. <order>
  43. <columns>
  44. <column id="ref" ascending="false"/>
  45. </columns>
  46. </order>
  47. </properties>
  48. <fields>
  49. <field id="status" xsi:type="AttributeEnum">
  50. <always_load_in_tables>true</always_load_in_tables>
  51. <values>
  52. <value id="new">new</value>
  53. <value id="waiting_for_approval">waiting_for_approval</value>
  54. <value id="approved">approved</value>
  55. <value id="rejected">rejected</value>
  56. <value id="assigned">assigned</value>
  57. <value id="pending">pending</value>
  58. <value id="escalated_tto">escalated_tto</value>
  59. <value id="escalated_ttr">escalated_ttr</value>
  60. <value id="resolved">resolved</value>
  61. <value id="closed">closed</value>
  62. </values>
  63. <sql>status</sql>
  64. <default_value>new</default_value>
  65. <is_null_allowed>false</is_null_allowed>
  66. </field>
  67. <field id="request_type" xsi:type="AttributeEnum">
  68. <values>
  69. <value id="incident">incident</value>
  70. <value id="service_request">service_request</value>
  71. </values>
  72. <sql>request_type</sql>
  73. <default_value>incident</default_value>
  74. <is_null_allowed>true</is_null_allowed>
  75. <display_style>list</display_style>
  76. </field>
  77. <field id="impact" xsi:type="AttributeEnum">
  78. <values>
  79. <value id="1">1</value>
  80. <value id="2">2</value>
  81. <value id="3">3</value>
  82. </values>
  83. <sql>impact</sql>
  84. <default_value>1</default_value>
  85. <is_null_allowed>false</is_null_allowed>
  86. <display_style>list</display_style>
  87. </field>
  88. <field id="priority" xsi:type="AttributeEnum">
  89. <values>
  90. <value id="1">1</value>
  91. <value id="2">2</value>
  92. <value id="3">3</value>
  93. <value id="4">4</value>
  94. </values>
  95. <dependencies>
  96. <attribute id="impact"/>
  97. <attribute id="urgency"/>
  98. </dependencies>
  99. <sql>priority</sql>
  100. <default_value>4</default_value>
  101. <is_null_allowed>false</is_null_allowed>
  102. </field>
  103. <field id="urgency" xsi:type="AttributeEnum">
  104. <values>
  105. <value id="1">1</value>
  106. <value id="2">2</value>
  107. <value id="3">3</value>
  108. <value id="4">4</value>
  109. </values>
  110. <sql>urgency</sql>
  111. <default_value>4</default_value>
  112. <is_null_allowed>false</is_null_allowed>
  113. </field>
  114. <field id="origin" xsi:type="AttributeEnum">
  115. <values>
  116. <value id="mail">mail</value>
  117. <value id="phone">phone</value>
  118. <value id="portal">portal</value>
  119. <value id="monitoring">monitoring</value>
  120. </values>
  121. <sql>origin</sql>
  122. <default_value>phone</default_value>
  123. <is_null_allowed>true</is_null_allowed>
  124. </field>
  125. <field id="approver_id" xsi:type="AttributeExternalKey">
  126. <filter><![CDATA[SELECT Person WHERE org_id= :this->org_id]]></filter>
  127. <dependencies>
  128. <attribute id="org_id"/>
  129. </dependencies>
  130. <sql>approver_id</sql>
  131. <target_class>Person</target_class>
  132. <is_null_allowed>true</is_null_allowed>
  133. <on_target_delete>DEL_MANUAL</on_target_delete>
  134. <allow_target_creation>false</allow_target_creation>
  135. <jointype/>
  136. </field>
  137. <field id="approver_email" xsi:type="AttributeExternalField">
  138. <extkey_attcode>approver_id</extkey_attcode>
  139. <target_attcode>email</target_attcode>
  140. <is_null_allowed>true</is_null_allowed>
  141. </field>
  142. <field id="service_id" xsi:type="AttributeExternalKey">
  143. <filter><![CDATA[SELECT Service AS s JOIN lnkCustomerContractToService AS l1 ON l1.service_id=s.id JOIN CustomerContract AS cc ON l1.customercontract_id=cc.id WHERE cc.org_id = :this->org_id AND s.status != 'obsolete']]></filter>
  144. <dependencies>
  145. <attribute id="org_id"/>
  146. </dependencies>
  147. <sql>service_id</sql>
  148. <target_class>Service</target_class>
  149. <is_null_allowed>true</is_null_allowed>
  150. <on_target_delete>DEL_MANUAL</on_target_delete>
  151. <allow_target_creation>false</allow_target_creation>
  152. <jointype/>
  153. </field>
  154. <field id="service_name" xsi:type="AttributeExternalField">
  155. <extkey_attcode>service_id</extkey_attcode>
  156. <target_attcode>name</target_attcode>
  157. <is_null_allowed>true</is_null_allowed>
  158. </field>
  159. <field id="servicesubcategory_id" xsi:type="AttributeExternalKey">
  160. <filter><![CDATA[SELECT ServiceSubcategory WHERE service_id = :this->service_id AND request_type = :this->request_type AND status != 'obsolete']]></filter>
  161. <dependencies>
  162. <attribute id="service_id"/>
  163. <attribute id="request_type"/>
  164. </dependencies>
  165. <sql>servicesubcategory_id</sql>
  166. <target_class>ServiceSubcategory</target_class>
  167. <is_null_allowed>true</is_null_allowed>
  168. <on_target_delete>DEL_MANUAL</on_target_delete>
  169. <allow_target_creation>false</allow_target_creation>
  170. <jointype/>
  171. </field>
  172. <field id="servicesubcategory_name" xsi:type="AttributeExternalField">
  173. <extkey_attcode>servicesubcategory_id</extkey_attcode>
  174. <target_attcode>name</target_attcode>
  175. <is_null_allowed>true</is_null_allowed>
  176. </field>
  177. <field id="escalation_flag" xsi:type="AttributeEnum">
  178. <values>
  179. <value id="yes">yes</value>
  180. <value id="no">no</value>
  181. </values>
  182. <sql>escalation_flag</sql>
  183. <default_value>no</default_value>
  184. <is_null_allowed>true</is_null_allowed>
  185. </field>
  186. <field id="escalation_reason" xsi:type="AttributeString">
  187. <sql>escalation_reason</sql>
  188. <default_value/>
  189. <is_null_allowed>true</is_null_allowed>
  190. </field>
  191. <field id="assignment_date" xsi:type="AttributeDateTime">
  192. <sql>assignment_date</sql>
  193. <default_value/>
  194. <is_null_allowed>true</is_null_allowed>
  195. </field>
  196. <field id="resolution_date" xsi:type="AttributeDateTime">
  197. <sql>resolution_date</sql>
  198. <default_value/>
  199. <is_null_allowed>true</is_null_allowed>
  200. </field>
  201. <field id="last_pending_date" xsi:type="AttributeDateTime">
  202. <sql>last_pending_date</sql>
  203. <default_value/>
  204. <is_null_allowed>true</is_null_allowed>
  205. </field>
  206. <field id="cumulatedpending" xsi:type="AttributeStopWatch">
  207. <states>
  208. <state id="pending"/>
  209. </states>
  210. <working_time/>
  211. <thresholds/>
  212. <goal/>
  213. </field>
  214. <field id="tto" xsi:type="AttributeStopWatch">
  215. <always_load_in_tables>true</always_load_in_tables>
  216. <states>
  217. <state id="new"/>
  218. <state id="escalated_tto"/>
  219. </states>
  220. <working_time/>
  221. <goal>ResponseTicketTTO</goal>
  222. <thresholds>
  223. <threshold id="75">
  224. <highlight>
  225. <code>warning</code>
  226. <persistent>false</persistent>
  227. </highlight>
  228. <actions>
  229. </actions>
  230. </threshold>
  231. <threshold id="100">
  232. <highlight>
  233. <code>critical</code>
  234. <persistent>false</persistent>
  235. </highlight>
  236. <actions>
  237. <action>
  238. <verb>ApplyStimulus</verb>
  239. <params>
  240. <param>ev_timeout</param>
  241. </params>
  242. </action>
  243. </actions>
  244. </threshold>
  245. </thresholds>
  246. </field>
  247. <field id="ttr" xsi:type="AttributeStopWatch">
  248. <always_load_in_tables>true</always_load_in_tables>
  249. <states>
  250. <state id="new"/>
  251. <state id="escalated_tto"/>
  252. <state id="assigned"/>
  253. <state id="approved"/>
  254. <state id="escalated_ttr"/>
  255. </states>
  256. <working_time/>
  257. <goal>ResponseTicketTTR</goal>
  258. <thresholds>
  259. <threshold id="75">
  260. <highlight>
  261. <code>warning</code>
  262. <persistent>false</persistent>
  263. </highlight>
  264. <actions>
  265. </actions>
  266. </threshold>
  267. <threshold id="100">
  268. <highlight>
  269. <code>critical</code>
  270. <persistent>false</persistent>
  271. </highlight>
  272. <actions>
  273. <action>
  274. <verb>ApplyStimulus</verb>
  275. <params>
  276. <param>ev_timeout</param>
  277. </params>
  278. </action>
  279. </actions>
  280. </threshold>
  281. </thresholds>
  282. </field>
  283. <field id="tto_escalation_deadline" xsi:type="AttributeSubItem">
  284. <target_attcode>tto</target_attcode>
  285. <item_code>100_deadline</item_code>
  286. </field>
  287. <field id="sla_tto_passed" xsi:type="AttributeSubItem">
  288. <target_attcode>tto</target_attcode>
  289. <item_code>100_passed</item_code>
  290. </field>
  291. <field id="sla_tto_over" xsi:type="AttributeSubItem">
  292. <target_attcode>tto</target_attcode>
  293. <item_code>100_overrun</item_code>
  294. </field>
  295. <field id="ttr_escalation_deadline" xsi:type="AttributeSubItem">
  296. <target_attcode>ttr</target_attcode>
  297. <item_code>100_deadline</item_code>
  298. </field>
  299. <field id="sla_ttr_passed" xsi:type="AttributeSubItem">
  300. <target_attcode>ttr</target_attcode>
  301. <item_code>100_passed</item_code>
  302. </field>
  303. <field id="sla_ttr_over" xsi:type="AttributeSubItem">
  304. <target_attcode>ttr</target_attcode>
  305. <item_code>100_overrun</item_code>
  306. </field>
  307. <field id="time_spent" xsi:type="AttributeDuration">
  308. <sql>time_spent</sql>
  309. <default_value/>
  310. <is_null_allowed>true</is_null_allowed>
  311. </field>
  312. <field id="resolution_code" xsi:type="AttributeEnum">
  313. <values>
  314. <value id="assistance">assistance</value>
  315. <value id="other">other</value>
  316. <value id="software patch">software patch</value>
  317. <value id="training">training</value>
  318. <value id="hardware repair">hardware repair</value>
  319. <value id="system update">system update</value>
  320. <value id="bug fixed">bug fixed</value>
  321. </values>
  322. <sql>resolution_code</sql>
  323. <default_value>assistance</default_value>
  324. <is_null_allowed>true</is_null_allowed>
  325. </field>
  326. <field id="solution" xsi:type="AttributeText">
  327. <sql>solution</sql>
  328. <default_value/>
  329. <is_null_allowed>true</is_null_allowed>
  330. </field>
  331. <field id="pending_reason" xsi:type="AttributeText">
  332. <sql>pending_reason</sql>
  333. <default_value/>
  334. <is_null_allowed>true</is_null_allowed>
  335. </field>
  336. <field id="parent_request_id" xsi:type="AttributeExternalKey">
  337. <filter><![CDATA[SELECT UserRequest WHERE id != :this->id AND status NOT IN ('rejected','resolved','closed')]]></filter>
  338. <dependencies>
  339. </dependencies>
  340. <sql>parent_request_id</sql>
  341. <target_class>UserRequest</target_class>
  342. <is_null_allowed>true</is_null_allowed>
  343. <on_target_delete>DEL_MANUAL</on_target_delete>
  344. <jointype/>
  345. </field>
  346. <field id="parent_request_ref" xsi:type="AttributeExternalField">
  347. <extkey_attcode>parent_request_id</extkey_attcode>
  348. <target_attcode>ref</target_attcode>
  349. <is_null_allowed>true</is_null_allowed>
  350. </field>
  351. <field id="parent_problem_id" xsi:type="AttributeExternalKey">
  352. <sql>parent_problem_id</sql>
  353. <target_class>Problem</target_class>
  354. <is_null_allowed>true</is_null_allowed>
  355. <on_target_delete>DEL_MANUAL</on_target_delete>
  356. <jointype/>
  357. </field>
  358. <field id="parent_problem_ref" xsi:type="AttributeExternalField">
  359. <extkey_attcode>parent_problem_id</extkey_attcode>
  360. <target_attcode>ref</target_attcode>
  361. <is_null_allowed>true</is_null_allowed>
  362. </field>
  363. <field id="parent_change_id" xsi:type="AttributeExternalKey">
  364. <filter><![CDATA[SELECT Change WHERE status != "closed"]]></filter>
  365. <sql>parent_change_id</sql>
  366. <target_class>Change</target_class>
  367. <is_null_allowed>true</is_null_allowed>
  368. <on_target_delete>DEL_MANUAL</on_target_delete>
  369. <jointype/>
  370. </field>
  371. <field id="parent_change_ref" xsi:type="AttributeExternalField">
  372. <extkey_attcode>parent_change_id</extkey_attcode>
  373. <target_attcode>ref</target_attcode>
  374. <is_null_allowed>true</is_null_allowed>
  375. </field>
  376. <field id="related_request_list" xsi:type="AttributeLinkedSet">
  377. <linked_class>UserRequest</linked_class>
  378. <ext_key_to_me>parent_request_id</ext_key_to_me>
  379. <edit_mode>add_remove</edit_mode>
  380. <count_min>0</count_min>
  381. <count_max>0</count_max>
  382. </field>
  383. <field id="public_log" xsi:type="AttributeCaseLog">
  384. <sql>public_log</sql>
  385. <default_value/>
  386. <is_null_allowed>true</is_null_allowed>
  387. </field>
  388. <field id="user_satisfaction" xsi:type="AttributeEnum">
  389. <values>
  390. <value id="1">1</value>
  391. <value id="2">2</value>
  392. <value id="3">3</value>
  393. <value id="4">4</value>
  394. </values>
  395. <sql>user_satisfaction</sql>
  396. <default_value>1</default_value>
  397. <is_null_allowed>true</is_null_allowed>
  398. </field>
  399. <field id="user_comment" xsi:type="AttributeText">
  400. <sql>user_commment</sql>
  401. <default_value/>
  402. <is_null_allowed>true</is_null_allowed>
  403. </field>
  404. </fields>
  405. <lifecycle>
  406. <highlight_scale>
  407. <item id="warning">
  408. <rank>1</rank>
  409. <color>HIGHLIGHT_CLASS_WARNING</color>
  410. <icon>images/user-request-deadline.png</icon>
  411. </item>
  412. <item id="critical">
  413. <rank>2</rank>
  414. <color>HIGHLIGHT_CLASS_CRITICAL</color>
  415. <icon>images/user-request-escalated.png</icon>
  416. </item>
  417. <item id="closed">
  418. <rank>3</rank>
  419. <color>HIGHLIGHT_CLASS_NONE</color>
  420. <icon>images/user-request-closed.png</icon>
  421. </item>
  422. </highlight_scale>
  423. <attribute>status</attribute>
  424. <stimuli>
  425. <stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
  426. <stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
  427. <stimulus id="ev_approve" xsi:type="StimulusUserAction"/>
  428. <stimulus id="ev_reject" xsi:type="StimulusUserAction"/>
  429. <stimulus id="ev_pending" xsi:type="StimulusUserAction"/>
  430. <stimulus id="ev_timeout" xsi:type="StimulusInternal"/>
  431. <stimulus id="ev_autoresolve" xsi:type="StimulusInternal"/>
  432. <stimulus id="ev_autoclose" xsi:type="StimulusInternal"/>
  433. <stimulus id="ev_resolve" xsi:type="StimulusUserAction"/>
  434. <stimulus id="ev_close" xsi:type="StimulusUserAction"/>
  435. <stimulus id="ev_reopen" xsi:type="StimulusUserAction"/>
  436. <stimulus id="ev_wait_for_approval" xsi:type="StimulusUserAction"/>
  437. </stimuli>
  438. <states>
  439. <state id="new">
  440. <flags>
  441. <attribute id="ref">
  442. <read_only/>
  443. </attribute>
  444. <attribute id="org_id">
  445. <mandatory/>
  446. </attribute>
  447. <attribute id="caller_id">
  448. <mandatory/>
  449. </attribute>
  450. <attribute id="team_id">
  451. <hidden/>
  452. </attribute>
  453. <attribute id="priority">
  454. <read_only/>
  455. </attribute>
  456. <attribute id="agent_id">
  457. <hidden/>
  458. </attribute>
  459. <attribute id="start_date">
  460. <read_only/>
  461. </attribute>
  462. <attribute id="last_update">
  463. <read_only/>
  464. </attribute>
  465. <attribute id="close_date">
  466. <hidden/>
  467. </attribute>
  468. <attribute id="approver_id">
  469. <hidden/>
  470. </attribute>
  471. <attribute id="escalation_flag">
  472. <hidden/>
  473. </attribute>
  474. <attribute id="escalation_reason">
  475. <hidden/>
  476. </attribute>
  477. <attribute id="assignment_date">
  478. <hidden/>
  479. </attribute>
  480. <attribute id="resolution_date">
  481. <hidden/>
  482. </attribute>
  483. <attribute id="last_pending_date">
  484. <hidden/>
  485. </attribute>
  486. <attribute id="time_spent">
  487. <hidden/>
  488. </attribute>
  489. <attribute id="resolution_code">
  490. <hidden/>
  491. </attribute>
  492. <attribute id="solution">
  493. <hidden/>
  494. </attribute>
  495. <attribute id="pending_reason">
  496. <hidden/>
  497. </attribute>
  498. <attribute id="user_satisfaction">
  499. <hidden/>
  500. </attribute>
  501. <attribute id="user_comment">
  502. <hidden/>
  503. </attribute>
  504. <attribute id="tto_escalation_deadline">
  505. <read_only/>
  506. </attribute>
  507. <attribute id="sla_tto_passed">
  508. <hidden/>
  509. </attribute>
  510. <attribute id="sla_tto_over">
  511. <hidden/>
  512. </attribute>
  513. <attribute id="sla_ttr_passed">
  514. <hidden/>
  515. </attribute>
  516. <attribute id="ttr_escalation_deadline">
  517. <hidden/>
  518. </attribute>
  519. <attribute id="sla_ttr_over">
  520. <hidden/>
  521. </attribute>
  522. </flags>
  523. <transitions>
  524. <transition id="ev_assign">
  525. <target>assigned</target>
  526. <actions>
  527. <action>
  528. <verb>SetCurrentDate</verb>
  529. <params>
  530. <param xsi:type="attcode">assignment_date</param>
  531. </params>
  532. </action>
  533. </actions>
  534. </transition>
  535. <transition id="ev_timeout">
  536. <target>escalated_tto</target>
  537. <actions/>
  538. </transition>
  539. <transition id="ev_wait_for_approval">
  540. <target>waiting_for_approval</target>
  541. <actions/>
  542. </transition>
  543. <transition id="ev_autoresolve">
  544. <target>resolved</target>
  545. <actions>
  546. <action>
  547. <verb>SetCurrentDate</verb>
  548. <params>
  549. <param xsi:type="attcode">resolution_date</param>
  550. </params>
  551. </action>
  552. <action>
  553. <verb>SetElapsedTime</verb>
  554. <params>
  555. <param xsi:type="attcode">time_spent</param>
  556. <param xsi:type="attcode">start_date</param>
  557. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  558. </params>
  559. </action>
  560. <action>
  561. <verb>ResolveChildTickets</verb>
  562. <params/>
  563. </action>
  564. </actions>
  565. </transition>
  566. </transitions>
  567. </state>
  568. <state id="escalated_tto">
  569. <highlight>
  570. <code>critical</code>
  571. </highlight>
  572. <inherit_flags_from>new</inherit_flags_from>
  573. <flags>
  574. <attribute id="team_id"/>
  575. </flags>
  576. <transitions>
  577. <transition id="ev_assign">
  578. <target>assigned</target>
  579. <actions>
  580. <action>
  581. <verb>SetCurrentDate</verb>
  582. <params>
  583. <param xsi:type="attcode">assignment_date</param>
  584. </params>
  585. </action>
  586. </actions>
  587. </transition>
  588. </transitions>
  589. </state>
  590. <state id="assigned">
  591. <inherit_flags_from>new</inherit_flags_from>
  592. <flags>
  593. <attribute id="request_type">
  594. <mandatory/>
  595. </attribute>
  596. <attribute id="team_id">
  597. <mandatory/>
  598. <must_prompt/>
  599. </attribute>
  600. <attribute id="agent_id">
  601. <mandatory/>
  602. <must_prompt/>
  603. </attribute>
  604. <attribute id="approver_id">
  605. <read_only/>
  606. </attribute>
  607. <attribute id="assignment_date">
  608. <read_only/>
  609. </attribute>
  610. <attribute id="tto_escalation_deadline">
  611. <hidden/>
  612. </attribute>
  613. <attribute id="sla_tto_passed">
  614. <read_only/>
  615. </attribute>
  616. <attribute id="sla_tto_over">
  617. <read_only/>
  618. </attribute>
  619. <attribute id="ttr_escalation_deadline">
  620. <read_only/>
  621. </attribute>
  622. <attribute id="caller_id"/>
  623. <attribute id="escalation_flag"/>
  624. <attribute id="escalation_reason"/>
  625. </flags>
  626. <transitions>
  627. <transition id="ev_pending">
  628. <target>pending</target>
  629. <actions>
  630. <action>
  631. <verb>SetCurrentDate</verb>
  632. <params>
  633. <param xsi:type="attcode">last_pending_date</param>
  634. </params>
  635. </action>
  636. </actions>
  637. </transition>
  638. <transition id="ev_resolve">
  639. <target>resolved</target>
  640. <actions>
  641. <action>
  642. <verb>SetCurrentDate</verb>
  643. <params>
  644. <param xsi:type="attcode">resolution_date</param>
  645. </params>
  646. </action>
  647. <action>
  648. <verb>SetElapsedTime</verb>
  649. <params>
  650. <param xsi:type="attcode">time_spent</param>
  651. <param xsi:type="attcode">start_date</param>
  652. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  653. </params>
  654. </action>
  655. <action>
  656. <verb>ResolveChildTickets</verb>
  657. <params/>
  658. </action>
  659. </actions>
  660. </transition>
  661. <transition id="ev_reassign">
  662. <target>assigned</target>
  663. <actions/>
  664. </transition>
  665. <transition id="ev_timeout">
  666. <target>escalated_ttr</target>
  667. <actions/>
  668. </transition>
  669. <transition id="ev_autoresolve">
  670. <target>resolved</target>
  671. <actions>
  672. <action>
  673. <verb>SetCurrentDate</verb>
  674. <params>
  675. <param xsi:type="attcode">resolution_date</param>
  676. </params>
  677. </action>
  678. <action>
  679. <verb>SetElapsedTime</verb>
  680. <params>
  681. <param xsi:type="attcode">time_spent</param>
  682. <param xsi:type="attcode">start_date</param>
  683. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  684. </params>
  685. </action>
  686. <action>
  687. <verb>ResolveChildTickets</verb>
  688. <params/>
  689. </action>
  690. </actions>
  691. </transition>
  692. </transitions>
  693. </state>
  694. <state id="escalated_ttr">
  695. <highlight>
  696. <code>critical</code>
  697. </highlight>
  698. <inherit_flags_from>assigned</inherit_flags_from>
  699. <flags/>
  700. <transitions>
  701. <transition id="ev_pending">
  702. <target>pending</target>
  703. <actions>
  704. <action>
  705. <verb>SetCurrentDate</verb>
  706. <params>
  707. <param xsi:type="attcode">last_pending_date</param>
  708. </params>
  709. </action>
  710. </actions>
  711. </transition>
  712. <transition id="ev_resolve">
  713. <target>resolved</target>
  714. <actions>
  715. <action>
  716. <verb>SetCurrentDate</verb>
  717. <params>
  718. <param xsi:type="attcode">resolution_date</param>
  719. </params>
  720. </action>
  721. <action>
  722. <verb>SetElapsedTime</verb>
  723. <params>
  724. <param xsi:type="attcode">time_spent</param>
  725. <param xsi:type="attcode">start_date</param>
  726. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  727. </params>
  728. </action>
  729. <action>
  730. <verb>ResolveChildTickets</verb>
  731. <params/>
  732. </action>
  733. </actions>
  734. </transition>
  735. <transition id="ev_reassign">
  736. <target>assigned</target>
  737. <actions/>
  738. </transition>
  739. <transition id="ev_autoresolve">
  740. <target>resolved</target>
  741. <actions>
  742. <action>
  743. <verb>SetCurrentDate</verb>
  744. <params>
  745. <param xsi:type="attcode">resolution_date</param>
  746. </params>
  747. </action>
  748. <action>
  749. <verb>SetElapsedTime</verb>
  750. <params>
  751. <param xsi:type="attcode">time_spent</param>
  752. <param xsi:type="attcode">start_date</param>
  753. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  754. </params>
  755. </action>
  756. <action>
  757. <verb>ResolveChildTickets</verb>
  758. <params/>
  759. </action>
  760. </actions>
  761. </transition>
  762. </transitions>
  763. </state>
  764. <state id="waiting_for_approval">
  765. <inherit_flags_from>new</inherit_flags_from>
  766. <flags>
  767. <attribute id="approver_id">
  768. <must_prompt/>
  769. </attribute>
  770. <attribute id="team_id"/>
  771. </flags>
  772. <transitions>
  773. <transition id="ev_approve">
  774. <target>approved</target>
  775. <actions/>
  776. </transition>
  777. <transition id="ev_reject">
  778. <target>rejected</target>
  779. <actions/>
  780. </transition>
  781. </transitions>
  782. </state>
  783. <state id="approved">
  784. <inherit_flags_from>waiting_for_approval</inherit_flags_from>
  785. <flags>
  786. <attribute id="approver_id">
  787. <read_only/>
  788. </attribute>
  789. </flags>
  790. <transitions>
  791. <transition id="ev_timeout">
  792. <target>escalated_tto</target>
  793. <actions/>
  794. </transition>
  795. <transition id="ev_assign">
  796. <target>assigned</target>
  797. <actions>
  798. <action>
  799. <verb>SetCurrentDate</verb>
  800. <params>
  801. <param xsi:type="attcode">assignment_date</param>
  802. </params>
  803. </action>
  804. </actions>
  805. </transition>
  806. <transition id="ev_autoresolve">
  807. <target>resolved</target>
  808. <actions>
  809. <action>
  810. <verb>SetCurrentDate</verb>
  811. <params>
  812. <param xsi:type="attcode">resolution_date</param>
  813. </params>
  814. </action>
  815. <action>
  816. <verb>SetElapsedTime</verb>
  817. <params>
  818. <param xsi:type="attcode">time_spent</param>
  819. <param xsi:type="attcode">start_date</param>
  820. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  821. </params>
  822. </action>
  823. <action>
  824. <verb>ResolveChildTickets</verb>
  825. <params/>
  826. </action>
  827. </actions>
  828. </transition>
  829. </transitions>
  830. </state>
  831. <state id="rejected">
  832. <inherit_flags_from>new</inherit_flags_from>
  833. <flags>
  834. <attribute id="tto_escalation_deadline">
  835. <hidden/>
  836. </attribute>
  837. <attribute id="team_id"/>
  838. </flags>
  839. <transitions>
  840. <transition id="ev_reopen">
  841. <target>new</target>
  842. <actions/>
  843. </transition>
  844. </transitions>
  845. </state>
  846. <state id="pending">
  847. <inherit_flags_from>assigned</inherit_flags_from>
  848. <flags>
  849. <attribute id="last_pending_date">
  850. <read_only/>
  851. </attribute>
  852. <attribute id="pending_reason">
  853. <mandatory/>
  854. <must_prompt/>
  855. </attribute>
  856. <attribute id="ttr_escalation_deadline">
  857. <hidden/>
  858. </attribute>
  859. </flags>
  860. <transitions>
  861. <transition id="ev_assign">
  862. <target>assigned</target>
  863. <actions>
  864. </actions>
  865. </transition>
  866. <transition id="ev_autoresolve">
  867. <target>resolved</target>
  868. <actions>
  869. <action>
  870. <verb>SetCurrentDate</verb>
  871. <params>
  872. <param xsi:type="attcode">resolution_date</param>
  873. </params>
  874. </action>
  875. <action>
  876. <verb>SetElapsedTime</verb>
  877. <params>
  878. <param xsi:type="attcode">time_spent</param>
  879. <param xsi:type="attcode">start_date</param>
  880. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  881. </params>
  882. </action>
  883. <action>
  884. <verb>ResolveChildTickets</verb>
  885. <params/>
  886. </action>
  887. </actions>
  888. </transition>
  889. </transitions>
  890. </state>
  891. <state id="resolved">
  892. <highlight>
  893. <code>closed</code>
  894. </highlight>
  895. <inherit_flags_from>assigned</inherit_flags_from>
  896. <flags>
  897. <attribute id="caller_id">
  898. <read_only/>
  899. </attribute>
  900. <attribute id="origin">
  901. <read_only/>
  902. </attribute>
  903. <attribute id="impact">
  904. <read_only/>
  905. </attribute>
  906. <attribute id="urgency">
  907. <read_only/>
  908. </attribute>
  909. <attribute id="service_id">
  910. <mandatory/>
  911. <must_prompt/>
  912. </attribute>
  913. <attribute id="servicesubcategory_id">
  914. <must_prompt/>
  915. </attribute>
  916. <attribute id="escalation_flag">
  917. <read_only/>
  918. </attribute>
  919. <attribute id="escalation_reason">
  920. <read_only/>
  921. </attribute>
  922. <attribute id="parent_request_id">
  923. <read_only/>
  924. </attribute>
  925. <attribute id="parent_change_id">
  926. <read_only/>
  927. </attribute>
  928. <attribute id="parent_problem_id">
  929. <read_only/>
  930. </attribute>
  931. <attribute id="title">
  932. <read_only/>
  933. </attribute>
  934. <attribute id="description">
  935. <read_only/>
  936. </attribute>
  937. <attribute id="org_id">
  938. <read_only/>
  939. </attribute>
  940. <attribute id="team_id">
  941. <read_only/>
  942. </attribute>
  943. <attribute id="agent_id">
  944. <read_only/>
  945. </attribute>
  946. <attribute id="request_type">
  947. <read_only/>
  948. </attribute>
  949. <attribute id="resolution_date">
  950. <read_only/>
  951. </attribute>
  952. <attribute id="time_spent">
  953. <read_only/>
  954. </attribute>
  955. <attribute id="resolution_code">
  956. <mandatory/>
  957. <must_prompt/>
  958. </attribute>
  959. <attribute id="solution">
  960. <mandatory/>
  961. <must_prompt/>
  962. </attribute>
  963. <attribute id="pending_reason">
  964. <read_only/>
  965. </attribute>
  966. <attribute id="sla_ttr_passed">
  967. <read_only/>
  968. </attribute>
  969. <attribute id="ttr_escalation_deadline">
  970. <hidden/>
  971. </attribute>
  972. <attribute id="sla_ttr_over">
  973. <read_only/>
  974. </attribute>
  975. </flags>
  976. <transitions>
  977. <transition id="ev_close">
  978. <target>closed</target>
  979. <actions>
  980. <action>
  981. <verb>SetCurrentDate</verb>
  982. <params>
  983. <param xsi:type="attcode">close_date</param>
  984. </params>
  985. </action>
  986. </actions>
  987. </transition>
  988. <transition id="ev_reopen">
  989. <target>assigned</target>
  990. <actions>
  991. </actions>
  992. </transition>
  993. <transition id="ev_autoresolve">
  994. <target>resolved</target>
  995. <actions>
  996. <action>
  997. <verb>SetCurrentDate</verb>
  998. <params>
  999. <param xsi:type="attcode">resolution_date</param>
  1000. </params>
  1001. </action>
  1002. <action>
  1003. <verb>SetElapsedTime</verb>
  1004. <params>
  1005. <param xsi:type="attcode">time_spent</param>
  1006. <param xsi:type="attcode">start_date</param>
  1007. <param xsi:type="string">DefaultWorkingTimeComputer</param>
  1008. </params>
  1009. </action>
  1010. <action>
  1011. <verb>ResolveChildTickets</verb>
  1012. <params/>
  1013. </action>
  1014. </actions>
  1015. </transition>
  1016. </transitions>
  1017. </state>
  1018. <state id="closed">
  1019. <highlight>
  1020. <code>closed</code>
  1021. </highlight>
  1022. <inherit_flags_from>resolved</inherit_flags_from>
  1023. <flags>
  1024. <attribute id="private_log">
  1025. <read_only/>
  1026. </attribute>
  1027. <attribute id="public_log">
  1028. <read_only/>
  1029. </attribute>
  1030. <attribute id="functionalcis_list">
  1031. <read_only/>
  1032. </attribute>
  1033. <attribute id="contacts_list">
  1034. <read_only/>
  1035. </attribute>
  1036. <attribute id="service_id">
  1037. <read_only/>
  1038. </attribute>
  1039. <attribute id="servicesubcategory_id">
  1040. <read_only/>
  1041. </attribute>
  1042. <attribute id="close_date">
  1043. <read_only/>
  1044. </attribute>
  1045. <attribute id="resolution_code">
  1046. <read_only/>
  1047. </attribute>
  1048. <attribute id="solution">
  1049. <read_only/>
  1050. </attribute>
  1051. <attribute id="pending_reason">
  1052. <read_only/>
  1053. <read_only/>
  1054. </attribute>
  1055. <attribute id="user_satisfaction">
  1056. <must_prompt/>
  1057. </attribute>
  1058. <attribute id="user_comment">
  1059. <must_prompt/>
  1060. </attribute>
  1061. </flags>
  1062. <transitions/>
  1063. </state>
  1064. </states>
  1065. </lifecycle>
  1066. <methods>
  1067. <method id="SetAssignedDate">
  1068. <comment><![CDATA[/**
  1069. * To be deprecated: use SetCurrentDate() instead
  1070. * @return void
  1071. */]]></comment>
  1072. <static>false</static>
  1073. <access>public</access>
  1074. <type>LifecycleAction</type>
  1075. <code><![CDATA[ public function SetAssignedDate($sStimulusCode)
  1076. {
  1077. $this->Set('assignment_date', time());
  1078. return true;
  1079. }]]></code>
  1080. </method>
  1081. <method id="SetLastPendingDate">
  1082. <comment><![CDATA[/**
  1083. * To be deprecated: use SetCurrentDate() instead
  1084. * @return void
  1085. */]]></comment>
  1086. <static>false</static>
  1087. <access>public</access>
  1088. <type>LifecycleAction</type>
  1089. <code><![CDATA[ public function SetLastPendingDate($sStimulusCode)
  1090. {
  1091. $this->Set('last_pending_date', time());
  1092. return true;
  1093. }]]></code>
  1094. </method>
  1095. <method id="SetResolveDate">
  1096. <comment><![CDATA[/**
  1097. * To be deprecated: use SetCurrentDate() and SetElapsedTime() instead
  1098. * @return void
  1099. */]]></comment>
  1100. <static>false</static>
  1101. <access>public</access>
  1102. <type>LifecycleAction</type>
  1103. <code><![CDATA[ public function SetResolveDate($sStimulusCode)
  1104. {
  1105. $this->Set('resolution_date', time());
  1106. $iTimeSpent = time() - AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  1107. $this->Set('time_spent', $iTimeSpent);
  1108. return true;
  1109. }]]></code>
  1110. </method>
  1111. <method id="SetClosureDate">
  1112. <comment><![CDATA[/**
  1113. * To be deprecated: use SetCurrentDate() instead
  1114. * @return void
  1115. */]]></comment>
  1116. <static>false</static>
  1117. <access>public</access>
  1118. <type>LifecycleAction</type>
  1119. <code><![CDATA[ public function SetClosureDate($sStimulusCode)
  1120. {
  1121. $this->Set('close_date', time());
  1122. return true;
  1123. }]]></code>
  1124. </method>
  1125. <method id="SetApprover">
  1126. <comment><![CDATA[/**
  1127. * To be deprecated: use SetCurrentUser() instead
  1128. * @return void
  1129. */]]></comment>
  1130. <static>false</static>
  1131. <access>public</access>
  1132. <type>LifecycleAction</type>
  1133. <code><![CDATA[ public function SetApprover($sStimulusCode)
  1134. {
  1135. $this->Set('approver_id', UserRights::GetUserId());
  1136. return true;
  1137. }]]></code>
  1138. </method>
  1139. <method id="DoCheckToWrite">
  1140. <static>false</static>
  1141. <access>public</access>
  1142. <type>Overload-DBObject</type>
  1143. <code><![CDATA[public function DoCheckToWrite()
  1144. {
  1145. parent::DoCheckToWrite();
  1146. if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
  1147. {
  1148. $this->m_aCheckIssues[] = Dict::Format('Class:UserRequest/Error:CannotAssignParentRequestIdToSelf');
  1149. }
  1150. }]]></code>
  1151. </method>
  1152. <method id="ComputePriority">
  1153. <comment>/** Compute the priority of the ticket based on its impact and urgency&#13;
  1154. * @return integer The priority of the ticket 1(high) .. 3(low)&#13;
  1155. */</comment>
  1156. <static>false</static>
  1157. <access>public</access>
  1158. <type>LifecycleAction</type>
  1159. <code><![CDATA[ public function ComputePriority()
  1160. {
  1161. // priority[impact][urgency]
  1162. $aPriorities = array(
  1163. // single person
  1164. 1 => array(
  1165. 1 => 1,
  1166. 2 => 1,
  1167. 3 => 2,
  1168. 4 => 4,
  1169. ),
  1170. // a group
  1171. 2 => array(
  1172. 1 => 1,
  1173. 2 => 2,
  1174. 3 => 3,
  1175. 4 => 4,
  1176. ),
  1177. // a departement!
  1178. 3 => array(
  1179. 1 => 2,
  1180. 2 => 3,
  1181. 3 => 3,
  1182. 4 => 4,
  1183. ),
  1184. );
  1185. $iPriority = 1;
  1186. if (isset($aPriorities[(int)$this->Get('impact')][(int)$this->Get('urgency')]))
  1187. {
  1188. $iPriority = $aPriorities[(int)$this->Get('impact')][(int)$this->Get('urgency')];
  1189. }
  1190. return $iPriority;
  1191. }]]></code>
  1192. </method>
  1193. <method id="ComputeValues">
  1194. <static>false</static>
  1195. <access>public</access>
  1196. <type>Overload-DBObject</type>
  1197. <code><![CDATA[ public function ComputeValues()
  1198. {
  1199. // Compute the priority of the ticket
  1200. $this->Set('priority', $this->ComputePriority());
  1201. return parent::ComputeValues();
  1202. }]]></code>
  1203. </method>
  1204. <method id="DisplayBareRelations">
  1205. <static>false</static>
  1206. <access>public</access>
  1207. <type>Overload-cmdbAbstractObject</type>
  1208. <code><![CDATA[ function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
  1209. {
  1210. parent::DisplayBareRelations($oPage, $bEditMode);
  1211. if (!$bEditMode)
  1212. {
  1213. if (MetaModel::IsValidClass('KnownError'))
  1214. {
  1215. //Search for known errors
  1216. $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList'));
  1217. $iTicketID = $this->GetKey();;
  1218. $oKnownErrorSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT KnownError AS ke JOIN lnkErrorToFunctionalCI AS l1 ON l1.error_id=ke.id JOIN FunctionalCI AS ci ON l1.functionalci_id=ci.id JOIN lnkFunctionalCIToTicket AS l2 ON l2.functionalci_id=ci.id WHERE l2.ticket_id=$iTicketID"));
  1219. $iNumberKE=$oKnownErrorSet->count();
  1220. if ($iNumberKE > 0)
  1221. {
  1222. $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)");
  1223. }
  1224. else
  1225. {
  1226. $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList'));
  1227. }
  1228. self::DisplaySet($oPage, $oKnownErrorSet, array ('menu' => false));
  1229. }
  1230. }
  1231. }]]></code>
  1232. </method>
  1233. <method id="resolveChilds">
  1234. <comment><![CDATA[/**
  1235. * To be deprecated: use ResolveChildTickets() instead
  1236. */]]></comment>
  1237. <static>false</static>
  1238. <access>public</access>
  1239. <type>LifecycleAction</type>
  1240. <code><![CDATA[ public function resolveChilds($sStimulusCode)
  1241. {
  1242. $sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
  1243. $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
  1244. array(),
  1245. array(
  1246. 'ticket' => $this->GetKey(),
  1247. )
  1248. );
  1249. while($oRequest = $oChildRequestSet->Fetch())
  1250. {
  1251. if ( $oRequest->Get('status') != 'resolved')
  1252. {
  1253. $oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id'));
  1254. $oRequest->set('service_id',$this->Get('service_id'));
  1255. $oRequest->set('team_id',$this->Get('team_id'));
  1256. $oRequest->set('agent_id',$this->Get('agent_id'));
  1257. $oRequest->set('resolution_code',$this->Get('resolution_code'));
  1258. $oRequest->set('solution','Automatically resolved by request:[[UserRequest:'.$this->Get('ref').']]');
  1259. $oRequest->ApplyStimulus('ev_autoresolve');
  1260. $oRequest->DBUpdate();
  1261. }
  1262. }
  1263. return true;
  1264. }]]></code>
  1265. </method>
  1266. <method id="ResolveChildTickets">
  1267. <comment><![CDATA[/**
  1268. * Cascade the resolution to child User Request
  1269. * @return true (returning false would stop the ongoing transition)
  1270. */]]></comment>
  1271. <static>false</static>
  1272. <access>public</access>
  1273. <type>LifecycleAction</type>
  1274. <arguments>
  1275. </arguments>
  1276. <code><![CDATA[ public function ResolveChildTickets()
  1277. {
  1278. // Automatically resolve child requests
  1279. $sOQL = "SELECT UserRequest WHERE parent_request_id = :ticket AND status != 'resolved'";
  1280. $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array(), array('ticket' => $this->GetKey()));
  1281. while($oRequest = $oChildRequestSet->Fetch())
  1282. {
  1283. $oRequest->ResolveFrom($this);
  1284. }
  1285. return true;
  1286. }]]></code>
  1287. </method>
  1288. <method id="ResolveFrom">
  1289. <comment><![CDATA[/**
  1290. * Resolve the ticket from another resolved ticket
  1291. * @return void
  1292. */]]></comment>
  1293. <static>false</static>
  1294. <access>public</access>
  1295. <type>Internal</type>
  1296. <code><![CDATA[ public function ResolveFrom($oParentTicket)
  1297. {
  1298. if ($this->Get('status') != 'resolved')
  1299. {
  1300. $this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
  1301. $this->Set('service_id', $oParentTicket->Get('service_id'));
  1302. $this->Set('team_id', $oParentTicket->Get('team_id'));
  1303. $this->Set('agent_id', $oParentTicket->Get('agent_id'));
  1304. $this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
  1305. $sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
  1306. $this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
  1307. $this->ApplyStimulus('ev_autoresolve');
  1308. $this->DBUpdate();
  1309. }
  1310. }]]></code>
  1311. </method>
  1312. <method id="UpdateChildRequestLog">
  1313. <static>false</static>
  1314. <access>public</access>
  1315. <type>LifecycleAction</type>
  1316. <code><![CDATA[ public function UpdateChildRequestLog()
  1317. {
  1318. $oLog = $this->Get('public_log');
  1319. $sLogPublic = $oLog->GetModifiedEntry();
  1320. if ($sLogPublic != '')
  1321. {
  1322. $sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
  1323. $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
  1324. array(),
  1325. array(
  1326. 'ticket' => $this->GetKey(),
  1327. )
  1328. );
  1329. while($oRequest = $oChildRequestSet->Fetch())
  1330. {
  1331. $oRequest->set('public_log',$sLogPublic);
  1332. $oRequest->DBUpdate();
  1333. }
  1334. }
  1335. $oLog = $this->Get('private_log');
  1336. $sLogPrivate = $oLog->GetModifiedEntry();
  1337. if ($sLogPrivate != '')
  1338. {
  1339. $sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
  1340. $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
  1341. array(),
  1342. array(
  1343. 'ticket' => $this->GetKey(),
  1344. )
  1345. );
  1346. while($oRequest = $oChildRequestSet->Fetch())
  1347. {
  1348. $oRequest->set('private_log',$sLogPrivate);
  1349. $oRequest->DBUpdate();
  1350. }
  1351. }
  1352. return true;
  1353. }]]></code>
  1354. </method>
  1355. <method id="ComputeImpactedItems">
  1356. <static>false</static>
  1357. <access>public</access>
  1358. <type>LifecycleAction</type>
  1359. <code><![CDATA[
  1360. public function ComputeImpactedItems()
  1361. {
  1362. // This method is kept for backward compatibility
  1363. // in case a delta redefines it, but you may call
  1364. // UpdateImpactedItems directly
  1365. $this->UpdateImpactedItems();
  1366. }]]></code>
  1367. </method>
  1368. <method id="OnInsert">
  1369. <static>false</static>
  1370. <access>protected</access>
  1371. <type>Overload-DBObject</type>
  1372. <code><![CDATA[
  1373. protected function OnInsert()
  1374. {
  1375. parent::OnInsert();
  1376. $this->ComputeImpactedItems();
  1377. $this->Set('last_update', time());
  1378. $this->Set('start_date', time());
  1379. }]]></code>
  1380. </method>
  1381. <method id="OnUpdate">
  1382. <static>false</static>
  1383. <access>protected</access>
  1384. <type>Overload-DBObject</type>
  1385. <code><![CDATA[
  1386. protected function OnUpdate()
  1387. {
  1388. parent::OnUpdate();
  1389. $aChanges = $this->ListChanges();
  1390. if (array_key_exists('functionalcis_list', $aChanges))
  1391. {
  1392. $this->UpdateImpactedItems();
  1393. }
  1394. $this->Set('last_update', time());
  1395. $this->UpdateChildRequestLog();
  1396. }]]></code>
  1397. </method>
  1398. </methods>
  1399. <presentation>
  1400. <details>
  1401. <items>
  1402. <item id="functionalcis_list">
  1403. <rank>10</rank>
  1404. </item>
  1405. <item id="contacts_list">
  1406. <rank>20</rank>
  1407. </item>
  1408. <item id="related_request_list">
  1409. <rank>30</rank>
  1410. </item>
  1411. <item id="workorders_list">
  1412. <rank>40</rank>
  1413. </item>
  1414. <item id="col:col1">
  1415. <rank>50</rank>
  1416. <items>
  1417. <item id="fieldset:Ticket:baseinfo">
  1418. <rank>10</rank>
  1419. <items>
  1420. <item id="org_id">
  1421. <rank>10</rank>
  1422. </item>
  1423. <item id="caller_id">
  1424. <rank>20</rank>
  1425. </item>
  1426. <item id="status">
  1427. <rank>30</rank>
  1428. </item>
  1429. <item id="origin">
  1430. <rank>40</rank>
  1431. </item>
  1432. <item id="title">
  1433. <rank>50</rank>
  1434. </item>
  1435. <item id="description">
  1436. <rank>60</rank>
  1437. </item>
  1438. </items>
  1439. </item>
  1440. <item id="fieldset:Ticket:moreinfo">
  1441. <rank>20</rank>
  1442. <items>
  1443. <item id="service_id">
  1444. <rank>10</rank>
  1445. </item>
  1446. <item id="servicesubcategory_id">
  1447. <rank>20</rank>
  1448. </item>
  1449. <item id="escalation_flag">
  1450. <rank>30</rank>
  1451. </item>
  1452. <item id="escalation_reason">
  1453. <rank>40</rank>
  1454. </item>
  1455. <item id="pending_reason">
  1456. <rank>50</rank>
  1457. </item>
  1458. </items>
  1459. </item>
  1460. </items>
  1461. </item>
  1462. <item id="col:col2">
  1463. <rank>60</rank>
  1464. <items>
  1465. <item id="fieldset:Ticket:Type">
  1466. <rank>10</rank>
  1467. <items>
  1468. <item id="request_type">
  1469. <rank>10</rank>
  1470. </item>
  1471. <item id="impact">
  1472. <rank>20</rank>
  1473. </item>
  1474. <item id="urgency">
  1475. <rank>30</rank>
  1476. </item>
  1477. <item id="priority">
  1478. <rank>40</rank>
  1479. </item>
  1480. </items>
  1481. </item>
  1482. <item id="fieldset:Ticket:contact">
  1483. <rank>20</rank>
  1484. <items>
  1485. <item id="team_id">
  1486. <rank>10</rank>
  1487. </item>
  1488. <item id="agent_id">
  1489. <rank>20</rank>
  1490. </item>
  1491. <item id="approver_id">
  1492. <rank>30</rank>
  1493. </item>
  1494. </items>
  1495. </item>
  1496. <item id="fieldset:Ticket:date">
  1497. <rank>30</rank>
  1498. <items>
  1499. <item id="start_date">
  1500. <rank>10</rank>
  1501. </item>
  1502. <item id="last_update">
  1503. <rank>20</rank>
  1504. </item>
  1505. <item id="assignment_date">
  1506. <rank>30</rank>
  1507. </item>
  1508. <item id="tto_escalation_deadline">
  1509. <rank>40</rank>
  1510. </item>
  1511. <item id="ttr_escalation_deadline">
  1512. <rank>50</rank>
  1513. </item>
  1514. <item id="last_pending_date">
  1515. <rank>60</rank>
  1516. </item>
  1517. <item id="resolution_date">
  1518. <rank>70</rank>
  1519. </item>
  1520. <item id="close_date">
  1521. <rank>80</rank>
  1522. </item>
  1523. </items>
  1524. </item>
  1525. </items>
  1526. </item>
  1527. <item id="col:col3">
  1528. <rank>70</rank>
  1529. <items>
  1530. <item id="fieldset:Ticket:relation">
  1531. <rank>10</rank>
  1532. <items>
  1533. <item id="parent_request_id">
  1534. <rank>10</rank>
  1535. </item>
  1536. <item id="parent_problem_id">
  1537. <rank>20</rank>
  1538. </item>
  1539. <item id="parent_change_id">
  1540. <rank>30</rank>
  1541. </item>
  1542. </items>
  1543. </item>
  1544. <item id="fieldset:Ticket:resolution">
  1545. <rank>20</rank>
  1546. <items>
  1547. <item id="resolution_code">
  1548. <rank>10</rank>
  1549. </item>
  1550. <item id="solution">
  1551. <rank>20</rank>
  1552. </item>
  1553. <item id="time_spent">
  1554. <rank>30</rank>
  1555. </item>
  1556. <item id="user_satisfaction">
  1557. <rank>40</rank>
  1558. </item>
  1559. <item id="user_comment">
  1560. <rank>50</rank>
  1561. </item>
  1562. </items>
  1563. </item>
  1564. <item id="fieldset:Ticket:SLA">
  1565. <rank>30</rank>
  1566. <items>
  1567. <item id="sla_tto_passed">
  1568. <rank>10</rank>
  1569. </item>
  1570. <item id="sla_tto_over">
  1571. <rank>20</rank>
  1572. </item>
  1573. <item id="sla_ttr_passed">
  1574. <rank>30</rank>
  1575. </item>
  1576. <item id="sla_ttr_over">
  1577. <rank>40</rank>
  1578. </item>
  1579. </items>
  1580. </item>
  1581. </items>
  1582. </item>
  1583. </items>
  1584. </details>
  1585. <search>
  1586. <items>
  1587. <item id="ref">
  1588. <rank>10</rank>
  1589. </item>
  1590. <item id="org_id">
  1591. <rank>20</rank>
  1592. </item>
  1593. <item id="title">
  1594. <rank>30</rank>
  1595. </item>
  1596. <item id="description">
  1597. <rank>40</rank>
  1598. </item>
  1599. <item id="start_date">
  1600. <rank>50</rank>
  1601. </item>
  1602. <item id="resolution_date">
  1603. <rank>70</rank>
  1604. </item>
  1605. <item id="close_date">
  1606. <rank>80</rank>
  1607. </item>
  1608. <item id="status">
  1609. <rank>90</rank>
  1610. </item>
  1611. <item id="caller_id">
  1612. <rank>100</rank>
  1613. </item>
  1614. <item id="origin">
  1615. <rank>110</rank>
  1616. </item>
  1617. <item id="request_type">
  1618. <rank>120</rank>
  1619. </item>
  1620. <item id="impact">
  1621. <rank>130</rank>
  1622. </item>
  1623. <item id="urgency">
  1624. <rank>140</rank>
  1625. </item>
  1626. <item id="priority">
  1627. <rank>150</rank>
  1628. </item>
  1629. <item id="service_id">
  1630. <rank>160</rank>
  1631. </item>
  1632. <item id="servicesubcategory_id">
  1633. <rank>170</rank>
  1634. </item>
  1635. <item id="team_id">
  1636. <rank>180</rank>
  1637. </item>
  1638. <item id="agent_id">
  1639. <rank>190</rank>
  1640. </item>
  1641. <item id="escalation_flag">
  1642. <rank>200</rank>
  1643. </item>
  1644. <item id="resolution_code">
  1645. <rank>210</rank>
  1646. </item>
  1647. <item id="user_satisfaction">
  1648. <rank>220</rank>
  1649. </item>
  1650. <item id="sla_tto_passed">
  1651. <rank>230</rank>
  1652. </item>
  1653. <item id="sla_ttr_passed">
  1654. <rank>240</rank>
  1655. </item>
  1656. </items>
  1657. </search>
  1658. <list>
  1659. <items>
  1660. <item id="title">
  1661. <rank>10</rank>
  1662. </item>
  1663. <item id="org_id">
  1664. <rank>20</rank>
  1665. </item>
  1666. <item id="caller_id">
  1667. <rank>30</rank>
  1668. </item>
  1669. <item id="start_date">
  1670. <rank>40</rank>
  1671. </item>
  1672. <item id="status">
  1673. <rank>50</rank>
  1674. </item>
  1675. <item id="agent_id">
  1676. <rank>60</rank>
  1677. </item>
  1678. </items>
  1679. </list>
  1680. </presentation>
  1681. </class>
  1682. </classes>
  1683. <menus>
  1684. <menu id="WelcomeMenuPage" xsi:type="DashboardMenuNode" _delta="must_exist">
  1685. <definition>
  1686. <cells>
  1687. <cell id="1" _delta="define">
  1688. <rank>1</rank>
  1689. <dashlets>
  1690. <dashlet id="9" xsi:type="DashletHeaderDynamic">
  1691. <rank>0</rank>
  1692. <title>Menu:RequestManagement</title>
  1693. <icon>itop-welcome-itil/images/user-request-deadline.png</icon>
  1694. <subtitle>Menu:UserRequest:OpenRequests</subtitle>
  1695. <query>SELECT UserRequest WHERE status != "closed"</query>
  1696. <group_by>status</group_by>
  1697. <values>new,assigned,escalated_tto,escalated_ttr,resolved</values>
  1698. </dashlet>
  1699. <dashlet id="10" xsi:type="DashletObjectList">
  1700. <rank>1</rank>
  1701. <title>UI:WelcomeMenu:MyCalls</title>
  1702. <query>SELECT UserRequest AS i WHERE i.agent_id = :current_contact_id AND status NOT IN ("closed", "resolved")</query>
  1703. <menu>true</menu>
  1704. </dashlet>
  1705. </dashlets>
  1706. </cell>
  1707. </cells>
  1708. </definition>
  1709. </menu>
  1710. <menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
  1711. <rank>30</rank>
  1712. <enable_stimulus/>
  1713. </menu>
  1714. <menu id="UserRequest:Overview" xsi:type="DashboardMenuNode" _delta="define">
  1715. <rank>0</rank>
  1716. <parent>RequestManagement</parent>
  1717. <definition>
  1718. <layout>DashboardLayoutTwoCols</layout>
  1719. <title>UI:RequestMgmtMenuOverview:Title</title>
  1720. <cells>
  1721. <cell id="0">
  1722. <rank>0</rank>
  1723. <dashlets>
  1724. <dashlet id="1" xsi:type="DashletGroupByPie">
  1725. <rank>0</rank>
  1726. <title>UI-RequestManagementOverview-RequestByType-last-14-days</title>
  1727. <query>SELECT UserRequest WHERE DATE_SUB(NOW(), INTERVAL 14 DAY) &lt; start_date</query>
  1728. <group_by>request_type</group_by>
  1729. <style>pie</style>
  1730. </dashlet>
  1731. </dashlets>
  1732. </cell>
  1733. <cell id="1">
  1734. <rank>1</rank>
  1735. <dashlets>
  1736. <dashlet id="2" xsi:type="DashletGroupByBars">
  1737. <rank>0</rank>
  1738. <title>UI-RequestManagementOverview-Last-14-days</title>
  1739. <query>SELECT UserRequest WHERE DATE_SUB(NOW(), INTERVAL 14 DAY) &lt; start_date</query>
  1740. <group_by>start_date:day_of_month</group_by>
  1741. <style>bars</style>
  1742. </dashlet>
  1743. </dashlets>
  1744. </cell>
  1745. <cell id="11">
  1746. <rank>2</rank>
  1747. <dashlets>
  1748. <dashlet id="3" xsi:type="DashletGroupByTable">
  1749. <rank>0</rank>
  1750. <title>UI-RequestManagementOverview-OpenRequestByStatus</title>
  1751. <query>SELECT UserRequest WHERE status NOT IN ('closed','rejected')</query>
  1752. <group_by>status</group_by>
  1753. <style>table</style>
  1754. </dashlet>
  1755. </dashlets>
  1756. </cell>
  1757. <cell id="2">
  1758. <rank>3</rank>
  1759. <dashlets>
  1760. <dashlet id="4" xsi:type="DashletGroupByTable">
  1761. <rank>0</rank>
  1762. <title>UI-RequestManagementOverview-OpenRequestByAgent</title>
  1763. <query>SELECT UserRequest WHERE status NOT IN ('closed','rejected')</query>
  1764. <group_by>agent_id</group_by>
  1765. <style>table</style>
  1766. </dashlet>
  1767. </dashlets>
  1768. </cell>
  1769. <cell id="3">
  1770. <rank>4</rank>
  1771. <dashlets>
  1772. <dashlet id="5" xsi:type="DashletGroupByTable">
  1773. <rank>0</rank>
  1774. <title>UI-RequestManagementOverview-OpenRequestByType</title>
  1775. <query>SELECT UserRequest WHERE status NOT IN ('closed','rejected')</query>
  1776. <group_by>finalclass</group_by>
  1777. <style>table</style>
  1778. </dashlet>
  1779. </dashlets>
  1780. </cell>
  1781. <cell id="4">
  1782. <rank>5</rank>
  1783. <dashlets>
  1784. <dashlet id="6" xsi:type="DashletGroupByTable">
  1785. <rank>0</rank>
  1786. <title>UI-RequestManagementOverview-OpenRequestByCustomer</title>
  1787. <query>SELECT UserRequest WHERE status NOT IN ('closed','rejected')</query>
  1788. <group_by>org_id</group_by>
  1789. <style>table</style>
  1790. </dashlet>
  1791. </dashlets>
  1792. </cell>
  1793. </cells>
  1794. </definition>
  1795. </menu>
  1796. <menu id="NewUserRequest" xsi:type="NewObjectMenuNode" _delta="define">
  1797. <rank>1</rank>
  1798. <parent>RequestManagement</parent>
  1799. <class>UserRequest</class>
  1800. </menu>
  1801. <menu id="SearchUserRequests" xsi:type="SearchMenuNode" _delta="define">
  1802. <rank>2</rank>
  1803. <parent>RequestManagement</parent>
  1804. <class>UserRequest</class>
  1805. </menu>
  1806. <menu id="UserRequest:Shortcuts" xsi:type="TemplateMenuNode" _delta="define">
  1807. <rank>3</rank>
  1808. <parent>RequestManagement</parent>
  1809. <template_file/>
  1810. </menu>
  1811. <menu id="UserRequest:MyRequests" xsi:type="OQLMenuNode" _delta="define">
  1812. <rank>0</rank>
  1813. <parent>UserRequest:Shortcuts</parent>
  1814. <oql><![CDATA[SELECT UserRequest WHERE agent_id = :current_contact_id AND status NOT IN ("closed","resolved")]]></oql>
  1815. <do_search/>
  1816. <auto_reload>fast</auto_reload>
  1817. </menu>
  1818. <menu id="UserRequest:EscalatedRequests" xsi:type="OQLMenuNode" _delta="define">
  1819. <rank>1</rank>
  1820. <parent>UserRequest:Shortcuts</parent>
  1821. <oql><![CDATA[SELECT UserRequest WHERE status IN ("escalated_tto", "escalated_ttr") OR escalation_flag="yes"]]></oql>
  1822. <do_search/>
  1823. <auto_reload>fast</auto_reload>
  1824. </menu>
  1825. <menu id="UserRequest:OpenRequests" xsi:type="OQLMenuNode" _delta="define">
  1826. <rank>2</rank>
  1827. <parent>UserRequest:Shortcuts</parent>
  1828. <oql><![CDATA[SELECT UserRequest WHERE status NOT IN ("closed")]]></oql>
  1829. <do_search>1</do_search>
  1830. <auto_reload>fast</auto_reload>
  1831. </menu>
  1832. <menu id="UserRequest:MySupportRequests" xsi:type="OQLMenuNode" _delta="define">
  1833. <rank>3</rank>
  1834. <parent>UserRequest:Shortcuts</parent>
  1835. <oql><![CDATA[SELECT UserRequest WHERE caller_id = :current_contact_id AND status NOT IN ("closed")]]></oql>
  1836. <do_search/>
  1837. <auto_reload>fast</auto_reload>
  1838. </menu>
  1839. </menus>
  1840. </itop_design>