datamodel.itop-request-mgmt.xml 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
  3. <classes>
  4. <class id="UserRequest" _delta="define">
  5. <parent>ResponseTicket</parent>
  6. <properties>
  7. <comment><![CDATA[/**
  8. * Persistent classes for a CMDB
  9. *
  10. * @copyright Copyright (C) 2010-2012 Combodo SARL
  11. * @license http://opensource.org/licenses/AGPL-3.0
  12. */]]></comment>
  13. <category>bizmodel,searchable,requestmgmt</category>
  14. <abstract>false</abstract>
  15. <key_type>autoincrement</key_type>
  16. <db_table>ticket_request</db_table>
  17. <db_key_field>id</db_key_field>
  18. <db_final_class_field/>
  19. <naming>
  20. <format>%1$s</format>
  21. <attributes>
  22. <attribute id="ref"/>
  23. </attributes>
  24. </naming>
  25. <display_template/>
  26. <icon>images/user-request.png</icon>
  27. <reconciliation>
  28. <attributes>
  29. <attribute id="ref"/>
  30. </attributes>
  31. </reconciliation>
  32. <order>
  33. <columns>
  34. <column id="ref" order="0">
  35. <ascending>false</ascending>
  36. </column>
  37. </columns>
  38. </order>
  39. </properties>
  40. <fields>
  41. <field id="request_type" xsi:type="AttributeEnum">
  42. <values>
  43. <value>service request</value>
  44. <value>issue</value>
  45. <value>information</value>
  46. </values>
  47. <sql>request_type</sql>
  48. <default_value>service request</default_value>
  49. <is_null_allowed>false</is_null_allowed>
  50. </field>
  51. <field id="freeze_reason" xsi:type="AttributeString">
  52. <sql>freeze_reason</sql>
  53. <default_value/>
  54. <is_null_allowed>true</is_null_allowed>
  55. </field>
  56. </fields>
  57. <lifecycle>
  58. <attribute>status</attribute>
  59. <stimuli>
  60. <stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
  61. <stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
  62. <stimulus id="ev_timeout" xsi:type="StimulusInternal"/>
  63. <stimulus id="ev_resolve" xsi:type="StimulusUserAction"/>
  64. <stimulus id="ev_close" xsi:type="StimulusUserAction"/>
  65. <stimulus id="ev_freeze" xsi:type="StimulusUserAction"/>
  66. </stimuli>
  67. <states>
  68. <state id="new">
  69. <flags>
  70. <attribute id="ref">
  71. <read_only/>
  72. </attribute>
  73. <attribute id="description">
  74. <must_change/>
  75. </attribute>
  76. <attribute id="start_date">
  77. <read_only/>
  78. </attribute>
  79. <attribute id="caller_id">
  80. <mandatory/>
  81. </attribute>
  82. <attribute id="org_id">
  83. <must_change/>
  84. </attribute>
  85. <attribute id="service_id">
  86. <must_change/>
  87. </attribute>
  88. <attribute id="servicesubcategory_id">
  89. <must_change/>
  90. </attribute>
  91. <attribute id="product">
  92. <must_prompt/>
  93. </attribute>
  94. <attribute id="impact">
  95. <must_change/>
  96. </attribute>
  97. <attribute id="urgency">
  98. <must_change/>
  99. </attribute>
  100. <attribute id="priority">
  101. <read_only/>
  102. </attribute>
  103. <attribute id="workgroup_id">
  104. <must_change/>
  105. </attribute>
  106. <attribute id="agent_email">
  107. <hidden/>
  108. </attribute>
  109. <attribute id="related_problem_id">
  110. <hidden/>
  111. </attribute>
  112. <attribute id="related_change_id">
  113. <hidden/>
  114. </attribute>
  115. <attribute id="close_date">
  116. <hidden/>
  117. </attribute>
  118. <attribute id="last_update">
  119. <read_only/>
  120. </attribute>
  121. <attribute id="assignment_date">
  122. <hidden/>
  123. </attribute>
  124. <attribute id="resolution_date">
  125. <hidden/>
  126. </attribute>
  127. <attribute id="tto_escalation_deadline">
  128. <read_only/>
  129. </attribute>
  130. <attribute id="ttr_escalation_deadline">
  131. <hidden/>
  132. </attribute>
  133. <attribute id="closure_deadline">
  134. <hidden/>
  135. </attribute>
  136. <attribute id="resolution_code">
  137. <hidden/>
  138. </attribute>
  139. <attribute id="solution">
  140. <hidden/>
  141. </attribute>
  142. <attribute id="user_satisfaction">
  143. <hidden/>
  144. </attribute>
  145. <attribute id="user_commment">
  146. <hidden/>
  147. </attribute>
  148. <attribute id="request_type">
  149. <mandatory/>
  150. </attribute>
  151. <attribute id="freeze_reason">
  152. <hidden/>
  153. </attribute>
  154. </flags>
  155. <transitions>
  156. <transition>
  157. <stimulus>ev_assign</stimulus>
  158. <target>assigned</target>
  159. <actions>
  160. <action>
  161. <verb>SetAssignedDate</verb>
  162. </action>
  163. </actions>
  164. </transition>
  165. <transition>
  166. <stimulus>ev_timeout</stimulus>
  167. <target>escalated_tto</target>
  168. <actions/>
  169. </transition>
  170. </transitions>
  171. </state>
  172. <state id="escalated_tto">
  173. <flags>
  174. <attribute id="ref">
  175. <read_only/>
  176. </attribute>
  177. <attribute id="start_date">
  178. <read_only/>
  179. </attribute>
  180. <attribute id="caller_id">
  181. <mandatory/>
  182. </attribute>
  183. <attribute id="priority">
  184. <read_only/>
  185. </attribute>
  186. <attribute id="agent_email">
  187. <hidden/>
  188. </attribute>
  189. <attribute id="related_problem_id">
  190. <hidden/>
  191. </attribute>
  192. <attribute id="related_change_id">
  193. <hidden/>
  194. </attribute>
  195. <attribute id="close_date">
  196. <hidden/>
  197. </attribute>
  198. <attribute id="last_update">
  199. <read_only/>
  200. </attribute>
  201. <attribute id="assignment_date">
  202. <hidden/>
  203. </attribute>
  204. <attribute id="resolution_date">
  205. <hidden/>
  206. </attribute>
  207. <attribute id="tto_escalation_deadline">
  208. <read_only/>
  209. </attribute>
  210. <attribute id="ttr_escalation_deadline">
  211. <hidden/>
  212. </attribute>
  213. <attribute id="closure_deadline">
  214. <hidden/>
  215. </attribute>
  216. <attribute id="resolution_code">
  217. <hidden/>
  218. </attribute>
  219. <attribute id="solution">
  220. <hidden/>
  221. </attribute>
  222. <attribute id="user_satisfaction">
  223. <hidden/>
  224. </attribute>
  225. <attribute id="user_commment">
  226. <hidden/>
  227. </attribute>
  228. <attribute id="request_type">
  229. <mandatory/>
  230. </attribute>
  231. <attribute id="freeze_reason">
  232. <hidden/>
  233. </attribute>
  234. </flags>
  235. <transitions>
  236. <transition>
  237. <stimulus>ev_assign</stimulus>
  238. <target>assigned</target>
  239. <actions>
  240. <action>
  241. <verb>SetAssignedDate</verb>
  242. </action>
  243. </actions>
  244. </transition>
  245. </transitions>
  246. </state>
  247. <state id="assigned">
  248. <flags>
  249. <attribute id="ref">
  250. <read_only/>
  251. </attribute>
  252. <attribute id="title">
  253. <read_only/>
  254. </attribute>
  255. <attribute id="description">
  256. <read_only/>
  257. </attribute>
  258. <attribute id="start_date">
  259. <read_only/>
  260. </attribute>
  261. <attribute id="caller_id">
  262. <read_only/>
  263. </attribute>
  264. <attribute id="org_id">
  265. <read_only/>
  266. </attribute>
  267. <attribute id="priority">
  268. <read_only/>
  269. </attribute>
  270. <attribute id="workgroup_id">
  271. <mandatory/>
  272. <must_prompt/>
  273. </attribute>
  274. <attribute id="agent_id">
  275. <mandatory/>
  276. <must_prompt/>
  277. </attribute>
  278. <attribute id="agent_email">
  279. <read_only/>
  280. </attribute>
  281. <attribute id="close_date">
  282. <hidden/>
  283. </attribute>
  284. <attribute id="last_update">
  285. <read_only/>
  286. </attribute>
  287. <attribute id="assignment_date">
  288. <hidden/>
  289. </attribute>
  290. <attribute id="resolution_date">
  291. <hidden/>
  292. </attribute>
  293. <attribute id="tto_escalation_deadline">
  294. <hidden/>
  295. </attribute>
  296. <attribute id="ttr_escalation_deadline">
  297. <read_only/>
  298. </attribute>
  299. <attribute id="closure_deadline">
  300. <hidden/>
  301. </attribute>
  302. <attribute id="resolution_code">
  303. <hidden/>
  304. </attribute>
  305. <attribute id="solution">
  306. <hidden/>
  307. </attribute>
  308. <attribute id="user_satisfaction">
  309. <hidden/>
  310. </attribute>
  311. <attribute id="user_commment">
  312. <hidden/>
  313. </attribute>
  314. <attribute id="request_type">
  315. <mandatory/>
  316. </attribute>
  317. <attribute id="freeze_reason">
  318. <hidden/>
  319. </attribute>
  320. </flags>
  321. <transitions>
  322. <transition>
  323. <stimulus>ev_reassign</stimulus>
  324. <target>assigned</target>
  325. <actions/>
  326. </transition>
  327. <transition>
  328. <stimulus>ev_timeout</stimulus>
  329. <target>escalated_ttr</target>
  330. <actions/>
  331. </transition>
  332. <transition>
  333. <stimulus>ev_resolve</stimulus>
  334. <target>resolved</target>
  335. <actions>
  336. <action>
  337. <verb>SetResolveDate</verb>
  338. </action>
  339. <action>
  340. <verb>SetClosureDeadline</verb>
  341. </action>
  342. </actions>
  343. </transition>
  344. <transition>
  345. <stimulus>ev_freeze</stimulus>
  346. <target>frozen</target>
  347. <actions/>
  348. </transition>
  349. </transitions>
  350. </state>
  351. <state id="escalated_ttr">
  352. <flags>
  353. <attribute id="ref">
  354. <read_only/>
  355. </attribute>
  356. <attribute id="title">
  357. <read_only/>
  358. </attribute>
  359. <attribute id="description">
  360. <read_only/>
  361. </attribute>
  362. <attribute id="start_date">
  363. <read_only/>
  364. </attribute>
  365. <attribute id="caller_id">
  366. <read_only/>
  367. </attribute>
  368. <attribute id="org_id">
  369. <read_only/>
  370. </attribute>
  371. <attribute id="priority">
  372. <read_only/>
  373. </attribute>
  374. <attribute id="workgroup_id">
  375. <mandatory/>
  376. <must_prompt/>
  377. </attribute>
  378. <attribute id="agent_id">
  379. <mandatory/>
  380. <must_prompt/>
  381. </attribute>
  382. <attribute id="agent_email">
  383. <read_only/>
  384. </attribute>
  385. <attribute id="close_date">
  386. <hidden/>
  387. </attribute>
  388. <attribute id="last_update">
  389. <read_only/>
  390. </attribute>
  391. <attribute id="assignment_date">
  392. <hidden/>
  393. </attribute>
  394. <attribute id="resolution_date">
  395. <hidden/>
  396. </attribute>
  397. <attribute id="tto_escalation_deadline">
  398. <hidden/>
  399. </attribute>
  400. <attribute id="ttr_escalation_deadline">
  401. <read_only/>
  402. </attribute>
  403. <attribute id="closure_deadline">
  404. <hidden/>
  405. </attribute>
  406. <attribute id="resolution_code">
  407. <hidden/>
  408. </attribute>
  409. <attribute id="solution">
  410. <hidden/>
  411. </attribute>
  412. <attribute id="user_satisfaction">
  413. <hidden/>
  414. </attribute>
  415. <attribute id="user_commment">
  416. <hidden/>
  417. </attribute>
  418. <attribute id="request_type">
  419. <mandatory/>
  420. </attribute>
  421. <attribute id="freeze_reason">
  422. <hidden/>
  423. </attribute>
  424. </flags>
  425. <transitions>
  426. <transition>
  427. <stimulus>ev_reassign</stimulus>
  428. <target>escalated_ttr</target>
  429. <actions/>
  430. </transition>
  431. <transition>
  432. <stimulus>ev_resolve</stimulus>
  433. <target>resolved</target>
  434. <actions>
  435. <action>
  436. <verb>SetResolveDate</verb>
  437. </action>
  438. <action>
  439. <verb>SetClosureDeadline</verb>
  440. </action>
  441. </actions>
  442. </transition>
  443. </transitions>
  444. </state>
  445. <state id="frozen">
  446. <flags>
  447. <attribute id="ref">
  448. <read_only/>
  449. </attribute>
  450. <attribute id="title">
  451. <read_only/>
  452. </attribute>
  453. <attribute id="description">
  454. <read_only/>
  455. </attribute>
  456. <attribute id="start_date">
  457. <read_only/>
  458. </attribute>
  459. <attribute id="caller_id">
  460. <read_only/>
  461. </attribute>
  462. <attribute id="org_id">
  463. <read_only/>
  464. </attribute>
  465. <attribute id="priority">
  466. <read_only/>
  467. </attribute>
  468. <attribute id="workgroup_id">
  469. <mandatory/>
  470. </attribute>
  471. <attribute id="agent_id">
  472. <mandatory/>
  473. </attribute>
  474. <attribute id="agent_email">
  475. <read_only/>
  476. </attribute>
  477. <attribute id="close_date">
  478. <hidden/>
  479. </attribute>
  480. <attribute id="last_update">
  481. <read_only/>
  482. </attribute>
  483. <attribute id="assignment_date">
  484. <hidden/>
  485. </attribute>
  486. <attribute id="resolution_date">
  487. <hidden/>
  488. </attribute>
  489. <attribute id="tto_escalation_deadline">
  490. <hidden/>
  491. </attribute>
  492. <attribute id="ttr_escalation_deadline">
  493. <read_only/>
  494. </attribute>
  495. <attribute id="closure_deadline">
  496. <hidden/>
  497. </attribute>
  498. <attribute id="resolution_code">
  499. <hidden/>
  500. </attribute>
  501. <attribute id="solution">
  502. <hidden/>
  503. </attribute>
  504. <attribute id="user_satisfaction">
  505. <hidden/>
  506. </attribute>
  507. <attribute id="user_commment">
  508. <hidden/>
  509. </attribute>
  510. <attribute id="request_type">
  511. <mandatory/>
  512. </attribute>
  513. <attribute id="freeze_reason">
  514. <mandatory/>
  515. <must_prompt/>
  516. </attribute>
  517. </flags>
  518. <transitions>
  519. <transition>
  520. <stimulus>ev_timeout</stimulus>
  521. <target>escalated_ttr</target>
  522. <actions/>
  523. </transition>
  524. <transition>
  525. <stimulus>ev_assign</stimulus>
  526. <target>assigned</target>
  527. <actions/>
  528. </transition>
  529. <transition>
  530. <stimulus>ev_resolve</stimulus>
  531. <target>resolved</target>
  532. <actions/>
  533. </transition>
  534. </transitions>
  535. </state>
  536. <state id="resolved">
  537. <flags>
  538. <attribute id="ref">
  539. <read_only/>
  540. </attribute>
  541. <attribute id="title">
  542. <read_only/>
  543. </attribute>
  544. <attribute id="description">
  545. <read_only/>
  546. </attribute>
  547. <attribute id="start_date">
  548. <read_only/>
  549. </attribute>
  550. <attribute id="caller_id">
  551. <read_only/>
  552. </attribute>
  553. <attribute id="org_id">
  554. <read_only/>
  555. </attribute>
  556. <attribute id="service_id">
  557. <read_only/>
  558. </attribute>
  559. <attribute id="servicesubcategory_id">
  560. <read_only/>
  561. </attribute>
  562. <attribute id="product">
  563. <read_only/>
  564. </attribute>
  565. <attribute id="impact">
  566. <read_only/>
  567. </attribute>
  568. <attribute id="urgency">
  569. <read_only/>
  570. </attribute>
  571. <attribute id="priority">
  572. <read_only/>
  573. </attribute>
  574. <attribute id="workgroup_id">
  575. <read_only/>
  576. </attribute>
  577. <attribute id="agent_id">
  578. <read_only/>
  579. </attribute>
  580. <attribute id="agent_email">
  581. <read_only/>
  582. </attribute>
  583. <attribute id="close_date">
  584. <hidden/>
  585. </attribute>
  586. <attribute id="last_update">
  587. <read_only/>
  588. </attribute>
  589. <attribute id="assignment_date">
  590. <hidden/>
  591. </attribute>
  592. <attribute id="resolution_date">
  593. <hidden/>
  594. </attribute>
  595. <attribute id="tto_escalation_deadline">
  596. <hidden/>
  597. </attribute>
  598. <attribute id="ttr_escalation_deadline">
  599. <hidden/>
  600. </attribute>
  601. <attribute id="closure_deadline">
  602. <read_only/>
  603. </attribute>
  604. <attribute id="resolution_code">
  605. <must_prompt/>
  606. </attribute>
  607. <attribute id="solution">
  608. <must_prompt/>
  609. </attribute>
  610. <attribute id="user_satisfaction">
  611. <hidden/>
  612. </attribute>
  613. <attribute id="user_commment">
  614. <hidden/>
  615. </attribute>
  616. <attribute id="request_type">
  617. <mandatory/>
  618. </attribute>
  619. <attribute id="freeze_reason">
  620. <hidden/>
  621. </attribute>
  622. </flags>
  623. <transitions>
  624. <transition>
  625. <stimulus>ev_reassign</stimulus>
  626. <target>assigned</target>
  627. <actions/>
  628. </transition>
  629. <transition>
  630. <stimulus>ev_close</stimulus>
  631. <target>closed</target>
  632. <actions>
  633. <action>
  634. <verb>SetClosureDate</verb>
  635. </action>
  636. </actions>
  637. </transition>
  638. </transitions>
  639. </state>
  640. <state id="closed">
  641. <flags>
  642. <attribute id="ref">
  643. <read_only/>
  644. </attribute>
  645. <attribute id="title">
  646. <read_only/>
  647. </attribute>
  648. <attribute id="description">
  649. <read_only/>
  650. </attribute>
  651. <attribute id="ticket_log">
  652. <read_only/>
  653. </attribute>
  654. <attribute id="start_date">
  655. <read_only/>
  656. </attribute>
  657. <attribute id="caller_id">
  658. <read_only/>
  659. </attribute>
  660. <attribute id="org_id">
  661. <read_only/>
  662. </attribute>
  663. <attribute id="service_id">
  664. <read_only/>
  665. </attribute>
  666. <attribute id="servicesubcategory_id">
  667. <read_only/>
  668. </attribute>
  669. <attribute id="product">
  670. <read_only/>
  671. </attribute>
  672. <attribute id="impact">
  673. <read_only/>
  674. </attribute>
  675. <attribute id="urgency">
  676. <read_only/>
  677. </attribute>
  678. <attribute id="priority">
  679. <read_only/>
  680. </attribute>
  681. <attribute id="workgroup_id">
  682. <read_only/>
  683. </attribute>
  684. <attribute id="agent_id">
  685. <read_only/>
  686. </attribute>
  687. <attribute id="agent_email">
  688. <read_only/>
  689. </attribute>
  690. <attribute id="close_date">
  691. <read_only/>
  692. </attribute>
  693. <attribute id="last_update">
  694. <read_only/>
  695. </attribute>
  696. <attribute id="assignment_date">
  697. <hidden/>
  698. </attribute>
  699. <attribute id="resolution_date">
  700. <hidden/>
  701. </attribute>
  702. <attribute id="tto_escalation_deadline">
  703. <hidden/>
  704. </attribute>
  705. <attribute id="ttr_escalation_deadline">
  706. <hidden/>
  707. </attribute>
  708. <attribute id="closure_deadline">
  709. <hidden/>
  710. </attribute>
  711. <attribute id="resolution_code">
  712. <read_only/>
  713. </attribute>
  714. <attribute id="solution">
  715. <read_only/>
  716. </attribute>
  717. <attribute id="user_satisfaction">
  718. <must_prompt/>
  719. </attribute>
  720. <attribute id="user_commment">
  721. <must_prompt/>
  722. </attribute>
  723. <attribute id="request_type">
  724. <read_only/>
  725. </attribute>
  726. <attribute id="freeze_reason">
  727. <hidden/>
  728. </attribute>
  729. </flags>
  730. <transitions/>
  731. </state>
  732. </states>
  733. </lifecycle>
  734. <methods>
  735. <method id="ComputeValues">
  736. <static>false</static>
  737. <access>public</access>
  738. <type>Overload-DBObject</type>
  739. <code><![CDATA[ public function ComputeValues()
  740. {
  741. $sCurrRef = $this->Get('ref');
  742. if (strlen($sCurrRef) == 0)
  743. {
  744. $iKey = $this->GetKey();
  745. if ($iKey < 0)
  746. {
  747. // Object not yet in the Database
  748. $iKey = MetaModel::GetNextKey(get_class($this));
  749. }
  750. $sName = sprintf('R-%06d', $iKey);
  751. $this->Set('ref', $sName);
  752. }
  753. return parent::ComputeValues();
  754. }]]></code>
  755. </method>
  756. <method id="GetIcon">
  757. <comment>/**
  758. * Get the icon representing this object
  759. * @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
  760. * @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
  761. */</comment>
  762. <static>false</static>
  763. <access>public</access>
  764. <type>Overload-DBObject</type>
  765. <code><![CDATA[ public function GetIcon($bImgTag = true)
  766. {
  767. $sStatus = $this->Get('status');
  768. switch($this->GetState())
  769. {
  770. case 'escalated_tto':
  771. case 'escalated_ttr':
  772. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  773. break;
  774. case 'resolved':
  775. case 'closed':
  776. $sIcon = self::MakeIconFromName('user-request-closed.png');
  777. break;
  778. case 'new':
  779. $sIcon = self::MakeIconFromName('user-request.png');
  780. $oEscalationDeadline = $this->Get('tto_escalation_deadline');
  781. if ($oEscalationDeadline != null)
  782. {
  783. // A SLA is running
  784. $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  785. $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
  786. $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
  787. if ($ratio <= 0)
  788. {
  789. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  790. }
  791. else if ($ratio <= 0.25)
  792. {
  793. $sIcon = self::MakeIconFromName('user-request-deadline.png');
  794. }
  795. }
  796. break;
  797. case 'assigned':
  798. $sIcon = self::MakeIconFromName('user-request.png');
  799. $oEscalationDeadline = $this->Get('ttr_escalation_deadline');
  800. if ($oEscalationDeadline != null)
  801. {
  802. // A SLA is running
  803. $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  804. $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
  805. $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
  806. if ($ratio <= 0)
  807. {
  808. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  809. }
  810. else if ($ratio <= 0.25)
  811. {
  812. $sIcon = self::MakeIconFromName('user-request-deadline.png');
  813. }
  814. }
  815. break;
  816. default:
  817. $sIcon = MetaModel::GetClassIcon(get_class($this), $bImgTag);
  818. }
  819. return $sIcon;
  820. }]]></code>
  821. </method>
  822. <method id="MakeIconFromName">
  823. <static>true</static>
  824. <access>protected</access>
  825. <type>Overload-DBObject</type>
  826. <code><![CDATA[ protected static function MakeIconFromName($sIconName, $bImgTag = true)
  827. {
  828. $sIcon = '';
  829. if ($sIconName != '')
  830. {
  831. $sPath = utils::GetAbsoluteUrlModulesRoot().'itop-request-mgmt-1.0.0/images/'.$sIconName;
  832. if ($bImgTag)
  833. {
  834. $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
  835. }
  836. else
  837. {
  838. $sIcon = $sPath;
  839. }
  840. }
  841. return $sIcon;
  842. }]]></code>
  843. </method>
  844. </methods>
  845. <presentation>
  846. <details>
  847. <items>
  848. <item id="document_list">
  849. <rank>10</rank>
  850. </item>
  851. <item id="ci_list">
  852. <rank>20</rank>
  853. </item>
  854. <item id="contact_list">
  855. <rank>30</rank>
  856. </item>
  857. <item id="incident_list">
  858. <rank>40</rank>
  859. </item>
  860. <item id="col:col1">
  861. <rank>50</rank>
  862. <items>
  863. <item id="fieldset:Ticket:baseinfo">
  864. <rank>10</rank>
  865. <items>
  866. <item id="ref">
  867. <rank>10</rank>
  868. </item>
  869. <item id="title">
  870. <rank>20</rank>
  871. </item>
  872. <item id="org_id">
  873. <rank>30</rank>
  874. </item>
  875. <item id="status">
  876. <rank>40</rank>
  877. </item>
  878. <item id="priority">
  879. <rank>50</rank>
  880. </item>
  881. <item id="request_type">
  882. <rank>60</rank>
  883. </item>
  884. <item id="service_id">
  885. <rank>70</rank>
  886. </item>
  887. <item id="servicesubcategory_id">
  888. <rank>80</rank>
  889. </item>
  890. <item id="product">
  891. <rank>90</rank>
  892. </item>
  893. </items>
  894. </item>
  895. <item id="fieldset:Ticket:moreinfo">
  896. <rank>20</rank>
  897. <items>
  898. <item id="impact">
  899. <rank>10</rank>
  900. </item>
  901. <item id="urgency">
  902. <rank>20</rank>
  903. </item>
  904. <item id="description">
  905. <rank>30</rank>
  906. </item>
  907. <item id="resolution_code">
  908. <rank>40</rank>
  909. </item>
  910. <item id="solution">
  911. <rank>50</rank>
  912. </item>
  913. <item id="user_satisfaction">
  914. <rank>60</rank>
  915. </item>
  916. <item id="user_commment">
  917. <rank>70</rank>
  918. </item>
  919. <item id="freeze_reason">
  920. <rank>80</rank>
  921. </item>
  922. </items>
  923. </item>
  924. </items>
  925. </item>
  926. <item id="col:col2">
  927. <rank>60</rank>
  928. <items>
  929. <item id="fieldset:Ticket:date">
  930. <rank>10</rank>
  931. <items>
  932. <item id="start_date">
  933. <rank>10</rank>
  934. </item>
  935. <item id="last_update">
  936. <rank>20</rank>
  937. </item>
  938. <item id="assignment_date">
  939. <rank>30</rank>
  940. </item>
  941. <item id="tto_escalation_deadline">
  942. <rank>40</rank>
  943. </item>
  944. <item id="ttr_escalation_deadline">
  945. <rank>50</rank>
  946. </item>
  947. <item id="close_date">
  948. <rank>60</rank>
  949. </item>
  950. <item id="closure_deadline">
  951. <rank>70</rank>
  952. </item>
  953. </items>
  954. </item>
  955. <item id="fieldset:Ticket:contact">
  956. <rank>20</rank>
  957. <items>
  958. <item id="caller_id">
  959. <rank>10</rank>
  960. </item>
  961. <item id="workgroup_id">
  962. <rank>20</rank>
  963. </item>
  964. <item id="agent_id">
  965. <rank>30</rank>
  966. </item>
  967. </items>
  968. </item>
  969. <item id="fieldset:Ticket:relation">
  970. <rank>30</rank>
  971. <items>
  972. <item id="related_problem_id">
  973. <rank>10</rank>
  974. </item>
  975. <item id="related_change_id">
  976. <rank>20</rank>
  977. </item>
  978. </items>
  979. </item>
  980. </items>
  981. </item>
  982. </items>
  983. </details>
  984. <search>
  985. <items>
  986. <item id="ref">
  987. <rank>10</rank>
  988. </item>
  989. <item id="title">
  990. <rank>20</rank>
  991. </item>
  992. <item id="org_id">
  993. <rank>30</rank>
  994. </item>
  995. <item id="request_type">
  996. <rank>40</rank>
  997. </item>
  998. <item id="start_date">
  999. <rank>50</rank>
  1000. </item>
  1001. <item id="status">
  1002. <rank>60</rank>
  1003. </item>
  1004. <item id="caller_id">
  1005. <rank>70</rank>
  1006. </item>
  1007. <item id="service_id">
  1008. <rank>80</rank>
  1009. </item>
  1010. <item id="servicesubcategory_id">
  1011. <rank>90</rank>
  1012. </item>
  1013. <item id="product">
  1014. <rank>100</rank>
  1015. </item>
  1016. <item id="impact">
  1017. <rank>110</rank>
  1018. </item>
  1019. <item id="urgency">
  1020. <rank>120</rank>
  1021. </item>
  1022. <item id="priority">
  1023. <rank>130</rank>
  1024. </item>
  1025. <item id="workgroup_id">
  1026. <rank>140</rank>
  1027. </item>
  1028. <item id="agent_id">
  1029. <rank>150</rank>
  1030. </item>
  1031. <item id="agent_email">
  1032. <rank>160</rank>
  1033. </item>
  1034. <item id="close_date">
  1035. <rank>170</rank>
  1036. </item>
  1037. <item id="resolution_code">
  1038. <rank>180</rank>
  1039. </item>
  1040. <item id="solution">
  1041. <rank>190</rank>
  1042. </item>
  1043. <item id="user_satisfaction">
  1044. <rank>200</rank>
  1045. </item>
  1046. <item id="user_commment">
  1047. <rank>210</rank>
  1048. </item>
  1049. </items>
  1050. </search>
  1051. <list>
  1052. <items>
  1053. <item id="title">
  1054. <rank>10</rank>
  1055. </item>
  1056. <item id="org_id">
  1057. <rank>20</rank>
  1058. </item>
  1059. <item id="start_date">
  1060. <rank>30</rank>
  1061. </item>
  1062. <item id="status">
  1063. <rank>40</rank>
  1064. </item>
  1065. <item id="service_id">
  1066. <rank>50</rank>
  1067. </item>
  1068. <item id="priority">
  1069. <rank>60</rank>
  1070. </item>
  1071. <item id="workgroup_id">
  1072. <rank>70</rank>
  1073. </item>
  1074. <item id="agent_id">
  1075. <rank>80</rank>
  1076. </item>
  1077. </items>
  1078. </list>
  1079. </presentation>
  1080. </class>
  1081. </classes>
  1082. <menus>
  1083. <menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
  1084. <rank>30</rank>
  1085. </menu>
  1086. <menu id="UserRequest:Overview" xsi:type="DashboardMenuNode" _delta="define">
  1087. <rank>0</rank>
  1088. <parent>RequestManagement</parent>
  1089. <definition_file>request-dashboard.xml</definition_file>
  1090. </menu>
  1091. <menu id="NewUserRequest" xsi:type="NewObjectMenuNode" _delta="define">
  1092. <rank>1</rank>
  1093. <parent>RequestManagement</parent>
  1094. <class>UserRequest</class>
  1095. </menu>
  1096. <menu id="SearchUserRequests" xsi:type="SearchMenuNode" _delta="define">
  1097. <rank>2</rank>
  1098. <parent>RequestManagement</parent>
  1099. <class>UserRequest</class>
  1100. </menu>
  1101. <menu id="UserRequest:Shortcuts" xsi:type="TemplateMenuNode" _delta="define">
  1102. <rank>3</rank>
  1103. <parent>RequestManagement</parent>
  1104. <template_file/>
  1105. </menu>
  1106. <menu id="UserRequest:MyRequests" xsi:type="OQLMenuNode" _delta="define">
  1107. <rank>1</rank>
  1108. <parent>UserRequest:Shortcuts</parent>
  1109. <oql><![CDATA[SELECT UserRequest WHERE agent_id = :current_contact_id AND status NOT IN ("closed","resolved")]]></oql>
  1110. <do_search/>
  1111. <auto_reload>fast</auto_reload>
  1112. </menu>
  1113. <menu id="UserRequest:EscalatedRequests" xsi:type="OQLMenuNode" _delta="define">
  1114. <rank>2</rank>
  1115. <parent>UserRequest:Shortcuts</parent>
  1116. <oql><![CDATA[SELECT UserRequest WHERE status IN ("escalated_tto", "escalated_ttr")]]></oql>
  1117. <do_search/>
  1118. <auto_reload>fast</auto_reload>
  1119. </menu>
  1120. <menu id="UserRequest:OpenRequests" xsi:type="OQLMenuNode" _delta="define">
  1121. <rank>3</rank>
  1122. <parent>UserRequest:Shortcuts</parent>
  1123. <oql><![CDATA[SELECT UserRequest WHERE status IN ("new", "assigned", "escalated_tto", "escalated_ttr", "frozen", "resolved")]]></oql>
  1124. <do_search/>
  1125. <auto_reload>fast</auto_reload>
  1126. </menu>
  1127. </menus>
  1128. </itop_design>