datamodel.itop-request-mgmt.xml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classes>
  3. <class name="UserRequest" category="bizmodel,searchable,requestmgmt" parent="ResponseTicket" abstract="false" key_type="autoincrement" db_table="ticket_request" db_key_field="id" db_final_class_field="">
  4. <properties>
  5. <comment><![CDATA[/**
  6. * Persistent classes for a CMDB
  7. *
  8. * @author Erwan Taloc <erwan.taloc@combodo.com>
  9. * @author Romain Quetiez <romain.quetiez@combodo.com>
  10. * @author Denis Flaven <denis.flaven@combodo.com>
  11. * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
  12. */]]></comment>
  13. <naming format="%1$s">
  14. <attributes>
  15. <attribute name="ref"/>
  16. </attributes>
  17. </naming>
  18. <display_template></display_template>
  19. <icon>images/user-request.png</icon>
  20. <reconciliation>
  21. <attributes>
  22. <attribute name="ref"/>
  23. </attributes>
  24. </reconciliation>
  25. <order>
  26. <columns>
  27. <column name="ref" ascending="false" />
  28. </columns>
  29. </order>
  30. </properties>
  31. <fields>
  32. <field name="request_type" type="Enum" sql="request_type" default_value="service request" is_null_allowed="false">
  33. <values>
  34. <value>service request</value>
  35. <value>issue</value>
  36. <value>information</value>
  37. </values>
  38. </field>
  39. <field name="freeze_reason" type="String" sql="freeze_reason" default_value="" is_null_allowed="true"/>
  40. </fields>
  41. <lifecycle attribute="status">
  42. <stimuli>
  43. <stimulus name="ev_assign" type="StimulusUserAction"/>
  44. <stimulus name="ev_reassign" type="StimulusUserAction"/>
  45. <stimulus name="ev_timeout" type="StimulusInternal"/>
  46. <stimulus name="ev_resolve" type="StimulusUserAction"/>
  47. <stimulus name="ev_close" type="StimulusUserAction"/>
  48. <stimulus name="ev_freeze" type="StimulusUserAction"/>
  49. </stimuli>
  50. <states>
  51. <state name="new">
  52. <flags>
  53. <attribute name="ref" read_only="1"/>
  54. <attribute name="title"/>
  55. <attribute name="description" must_change="1"/>
  56. <attribute name="ticket_log"/>
  57. <attribute name="start_date" read_only="1"/>
  58. <attribute name="document_list"/>
  59. <attribute name="ci_list"/>
  60. <attribute name="contact_list"/>
  61. <attribute name="incident_list"/>
  62. <attribute name="status"/>
  63. <attribute name="caller_id" mandatory="1"/>
  64. <attribute name="caller_email"/>
  65. <attribute name="org_id" must_change="1"/>
  66. <attribute name="org_name"/>
  67. <attribute name="service_id" must_change="1"/>
  68. <attribute name="service_name"/>
  69. <attribute name="servicesubcategory_id" must_change="1"/>
  70. <attribute name="servicesubcategory_name"/>
  71. <attribute name="product" must_prompt="1"/>
  72. <attribute name="impact" must_change="1"/>
  73. <attribute name="urgency" must_change="1"/>
  74. <attribute name="priority" read_only="1"/>
  75. <attribute name="workgroup_id" must_change="1"/>
  76. <attribute name="workgroup_name"/>
  77. <attribute name="agent_id"/>
  78. <attribute name="agent_name"/>
  79. <attribute name="agent_email" hidden="1"/>
  80. <attribute name="related_problem_id" hidden="1"/>
  81. <attribute name="related_problem_ref"/>
  82. <attribute name="related_change_id" hidden="1"/>
  83. <attribute name="related_change_ref"/>
  84. <attribute name="close_date" hidden="1"/>
  85. <attribute name="last_update" read_only="1"/>
  86. <attribute name="assignment_date" hidden="1"/>
  87. <attribute name="resolution_date" hidden="1"/>
  88. <attribute name="tto_escalation_deadline" read_only="1"/>
  89. <attribute name="ttr_escalation_deadline" hidden="1"/>
  90. <attribute name="closure_deadline" hidden="1"/>
  91. <attribute name="resolution_code" hidden="1"/>
  92. <attribute name="solution" hidden="1"/>
  93. <attribute name="user_satisfaction" hidden="1"/>
  94. <attribute name="user_commment" hidden="1"/>
  95. <attribute name="request_type" mandatory="1"/>
  96. <attribute name="freeze_reason" hidden="1"/>
  97. <attribute name="related_change_id_finalclass_recall"/>
  98. </flags>
  99. <transitions>
  100. <transition stimulus="ev_assign" target="assigned">
  101. <actions>
  102. <action verb="SetAssignedDate"/>
  103. </actions>
  104. </transition>
  105. <transition stimulus="ev_timeout" target="escalated_tto">
  106. <actions/>
  107. </transition>
  108. </transitions>
  109. </state>
  110. <state name="escalated_tto">
  111. <flags>
  112. <attribute name="ref" read_only="1"/>
  113. <attribute name="title"/>
  114. <attribute name="description"/>
  115. <attribute name="ticket_log"/>
  116. <attribute name="start_date" read_only="1"/>
  117. <attribute name="document_list"/>
  118. <attribute name="ci_list"/>
  119. <attribute name="contact_list"/>
  120. <attribute name="incident_list"/>
  121. <attribute name="status"/>
  122. <attribute name="caller_id" mandatory="1"/>
  123. <attribute name="caller_email"/>
  124. <attribute name="org_id"/>
  125. <attribute name="org_name"/>
  126. <attribute name="service_id"/>
  127. <attribute name="service_name"/>
  128. <attribute name="servicesubcategory_id"/>
  129. <attribute name="servicesubcategory_name"/>
  130. <attribute name="product"/>
  131. <attribute name="impact"/>
  132. <attribute name="urgency"/>
  133. <attribute name="priority" read_only="1"/>
  134. <attribute name="workgroup_id"/>
  135. <attribute name="workgroup_name"/>
  136. <attribute name="agent_id"/>
  137. <attribute name="agent_name"/>
  138. <attribute name="agent_email" hidden="1"/>
  139. <attribute name="related_problem_id" hidden="1"/>
  140. <attribute name="related_problem_ref"/>
  141. <attribute name="related_change_id" hidden="1"/>
  142. <attribute name="related_change_ref"/>
  143. <attribute name="close_date" hidden="1"/>
  144. <attribute name="last_update" read_only="1"/>
  145. <attribute name="assignment_date" hidden="1"/>
  146. <attribute name="resolution_date" hidden="1"/>
  147. <attribute name="tto_escalation_deadline" read_only="1"/>
  148. <attribute name="ttr_escalation_deadline" hidden="1"/>
  149. <attribute name="closure_deadline" hidden="1"/>
  150. <attribute name="resolution_code" hidden="1"/>
  151. <attribute name="solution" hidden="1"/>
  152. <attribute name="user_satisfaction" hidden="1"/>
  153. <attribute name="user_commment" hidden="1"/>
  154. <attribute name="request_type" mandatory="1"/>
  155. <attribute name="freeze_reason" hidden="1"/>
  156. <attribute name="related_change_id_finalclass_recall"/>
  157. </flags>
  158. <transitions>
  159. <transition stimulus="ev_assign" target="assigned">
  160. <actions>
  161. <action verb="SetAssignedDate"/>
  162. </actions>
  163. </transition>
  164. </transitions>
  165. </state>
  166. <state name="assigned">
  167. <flags>
  168. <attribute name="ref" read_only="1"/>
  169. <attribute name="title" read_only="1"/>
  170. <attribute name="description" read_only="1"/>
  171. <attribute name="ticket_log"/>
  172. <attribute name="start_date" read_only="1"/>
  173. <attribute name="document_list"/>
  174. <attribute name="ci_list"/>
  175. <attribute name="contact_list"/>
  176. <attribute name="incident_list"/>
  177. <attribute name="status"/>
  178. <attribute name="caller_id" read_only="1"/>
  179. <attribute name="caller_email"/>
  180. <attribute name="org_id" read_only="1"/>
  181. <attribute name="org_name"/>
  182. <attribute name="service_id"/>
  183. <attribute name="service_name"/>
  184. <attribute name="servicesubcategory_id"/>
  185. <attribute name="servicesubcategory_name"/>
  186. <attribute name="product"/>
  187. <attribute name="impact"/>
  188. <attribute name="urgency"/>
  189. <attribute name="priority" read_only="1"/>
  190. <attribute name="workgroup_id" mandatory="1" must_prompt="1"/>
  191. <attribute name="workgroup_name"/>
  192. <attribute name="agent_id" mandatory="1" must_prompt="1"/>
  193. <attribute name="agent_name"/>
  194. <attribute name="agent_email" read_only="1"/>
  195. <attribute name="related_problem_id"/>
  196. <attribute name="related_problem_ref"/>
  197. <attribute name="related_change_id"/>
  198. <attribute name="related_change_ref"/>
  199. <attribute name="close_date" hidden="1"/>
  200. <attribute name="last_update" read_only="1"/>
  201. <attribute name="assignment_date" hidden="1"/>
  202. <attribute name="resolution_date" hidden="1"/>
  203. <attribute name="tto_escalation_deadline" hidden="1"/>
  204. <attribute name="ttr_escalation_deadline" read_only="1"/>
  205. <attribute name="closure_deadline" hidden="1"/>
  206. <attribute name="resolution_code" hidden="1"/>
  207. <attribute name="solution" hidden="1"/>
  208. <attribute name="user_satisfaction" hidden="1"/>
  209. <attribute name="user_commment" hidden="1"/>
  210. <attribute name="request_type" mandatory="1"/>
  211. <attribute name="freeze_reason" hidden="1"/>
  212. <attribute name="related_change_id_finalclass_recall"/>
  213. </flags>
  214. <transitions>
  215. <transition stimulus="ev_reassign" target="assigned">
  216. <actions/>
  217. </transition>
  218. <transition stimulus="ev_timeout" target="escalated_ttr">
  219. <actions/>
  220. </transition>
  221. <transition stimulus="ev_resolve" target="resolved">
  222. <actions>
  223. <action verb="SetResolveDate"/>
  224. <action verb="SetClosureDeadline"/>
  225. </actions>
  226. </transition>
  227. <transition stimulus="ev_freeze" target="frozen">
  228. <actions/>
  229. </transition>
  230. </transitions>
  231. </state>
  232. <state name="escalated_ttr">
  233. <flags>
  234. <attribute name="ref" read_only="1"/>
  235. <attribute name="title" read_only="1"/>
  236. <attribute name="description" read_only="1"/>
  237. <attribute name="ticket_log"/>
  238. <attribute name="start_date" read_only="1"/>
  239. <attribute name="document_list"/>
  240. <attribute name="ci_list"/>
  241. <attribute name="contact_list"/>
  242. <attribute name="incident_list"/>
  243. <attribute name="status"/>
  244. <attribute name="caller_id" read_only="1"/>
  245. <attribute name="caller_email"/>
  246. <attribute name="org_id" read_only="1"/>
  247. <attribute name="org_name"/>
  248. <attribute name="service_id"/>
  249. <attribute name="service_name"/>
  250. <attribute name="servicesubcategory_id"/>
  251. <attribute name="servicesubcategory_name"/>
  252. <attribute name="product"/>
  253. <attribute name="impact"/>
  254. <attribute name="urgency"/>
  255. <attribute name="priority" read_only="1"/>
  256. <attribute name="workgroup_id" mandatory="1" must_prompt="1"/>
  257. <attribute name="workgroup_name"/>
  258. <attribute name="agent_id" mandatory="1" must_prompt="1"/>
  259. <attribute name="agent_name"/>
  260. <attribute name="agent_email" read_only="1"/>
  261. <attribute name="related_problem_id"/>
  262. <attribute name="related_problem_ref"/>
  263. <attribute name="related_change_id"/>
  264. <attribute name="related_change_ref"/>
  265. <attribute name="close_date" hidden="1"/>
  266. <attribute name="last_update" read_only="1"/>
  267. <attribute name="assignment_date" hidden="1"/>
  268. <attribute name="resolution_date" hidden="1"/>
  269. <attribute name="tto_escalation_deadline" hidden="1"/>
  270. <attribute name="ttr_escalation_deadline" read_only="1"/>
  271. <attribute name="closure_deadline" hidden="1"/>
  272. <attribute name="resolution_code" hidden="1"/>
  273. <attribute name="solution" hidden="1"/>
  274. <attribute name="user_satisfaction" hidden="1"/>
  275. <attribute name="user_commment" hidden="1"/>
  276. <attribute name="request_type" mandatory="1"/>
  277. <attribute name="freeze_reason" hidden="1"/>
  278. <attribute name="related_change_id_finalclass_recall"/>
  279. </flags>
  280. <transitions>
  281. <transition stimulus="ev_reassign" target="escalated_ttr">
  282. <actions/>
  283. </transition>
  284. <transition stimulus="ev_resolve" target="resolved">
  285. <actions>
  286. <action verb="SetResolveDate"/>
  287. <action verb="SetClosureDeadline"/>
  288. </actions>
  289. </transition>
  290. </transitions>
  291. </state>
  292. <state name="frozen">
  293. <flags>
  294. <attribute name="ref" read_only="1"/>
  295. <attribute name="title" read_only="1"/>
  296. <attribute name="description" read_only="1"/>
  297. <attribute name="ticket_log"/>
  298. <attribute name="start_date" read_only="1"/>
  299. <attribute name="document_list"/>
  300. <attribute name="ci_list"/>
  301. <attribute name="contact_list"/>
  302. <attribute name="incident_list"/>
  303. <attribute name="status"/>
  304. <attribute name="caller_id" read_only="1"/>
  305. <attribute name="caller_email"/>
  306. <attribute name="org_id" read_only="1"/>
  307. <attribute name="org_name"/>
  308. <attribute name="service_id"/>
  309. <attribute name="service_name"/>
  310. <attribute name="servicesubcategory_id"/>
  311. <attribute name="servicesubcategory_name"/>
  312. <attribute name="product"/>
  313. <attribute name="impact"/>
  314. <attribute name="urgency"/>
  315. <attribute name="priority" read_only="1"/>
  316. <attribute name="workgroup_id" mandatory="1"/>
  317. <attribute name="workgroup_name"/>
  318. <attribute name="agent_id" mandatory="1"/>
  319. <attribute name="agent_name"/>
  320. <attribute name="agent_email" read_only="1"/>
  321. <attribute name="related_problem_id"/>
  322. <attribute name="related_problem_ref"/>
  323. <attribute name="related_change_id"/>
  324. <attribute name="related_change_ref"/>
  325. <attribute name="close_date" hidden="1"/>
  326. <attribute name="last_update" read_only="1"/>
  327. <attribute name="assignment_date" hidden="1"/>
  328. <attribute name="resolution_date" hidden="1"/>
  329. <attribute name="tto_escalation_deadline" hidden="1"/>
  330. <attribute name="ttr_escalation_deadline" read_only="1"/>
  331. <attribute name="closure_deadline" hidden="1"/>
  332. <attribute name="resolution_code" hidden="1"/>
  333. <attribute name="solution" hidden="1"/>
  334. <attribute name="user_satisfaction" hidden="1"/>
  335. <attribute name="user_commment" hidden="1"/>
  336. <attribute name="request_type" mandatory="1"/>
  337. <attribute name="freeze_reason" mandatory="1" must_prompt="1"/>
  338. <attribute name="related_change_id_finalclass_recall"/>
  339. </flags>
  340. <transitions>
  341. <transition stimulus="ev_timeout" target="escalated_ttr">
  342. <actions/>
  343. </transition>
  344. <transition stimulus="ev_assign" target="assigned">
  345. <actions/>
  346. </transition>
  347. <transition stimulus="ev_resolve" target="resolved">
  348. <actions/>
  349. </transition>
  350. </transitions>
  351. </state>
  352. <state name="resolved">
  353. <flags>
  354. <attribute name="ref" read_only="1"/>
  355. <attribute name="title" read_only="1"/>
  356. <attribute name="description" read_only="1"/>
  357. <attribute name="ticket_log"/>
  358. <attribute name="start_date" read_only="1"/>
  359. <attribute name="document_list"/>
  360. <attribute name="ci_list"/>
  361. <attribute name="contact_list"/>
  362. <attribute name="incident_list"/>
  363. <attribute name="status"/>
  364. <attribute name="caller_id" read_only="1"/>
  365. <attribute name="caller_email"/>
  366. <attribute name="org_id" read_only="1"/>
  367. <attribute name="org_name"/>
  368. <attribute name="service_id" read_only="1"/>
  369. <attribute name="service_name"/>
  370. <attribute name="servicesubcategory_id" read_only="1"/>
  371. <attribute name="servicesubcategory_name"/>
  372. <attribute name="product" read_only="1"/>
  373. <attribute name="impact" read_only="1"/>
  374. <attribute name="urgency" read_only="1"/>
  375. <attribute name="priority" read_only="1"/>
  376. <attribute name="workgroup_id" read_only="1"/>
  377. <attribute name="workgroup_name"/>
  378. <attribute name="agent_id" read_only="1"/>
  379. <attribute name="agent_name"/>
  380. <attribute name="agent_email" read_only="1"/>
  381. <attribute name="related_problem_id"/>
  382. <attribute name="related_problem_ref"/>
  383. <attribute name="related_change_id"/>
  384. <attribute name="related_change_ref"/>
  385. <attribute name="close_date" hidden="1"/>
  386. <attribute name="last_update" read_only="1"/>
  387. <attribute name="assignment_date" hidden="1"/>
  388. <attribute name="resolution_date" hidden="1"/>
  389. <attribute name="tto_escalation_deadline" hidden="1"/>
  390. <attribute name="ttr_escalation_deadline" hidden="1"/>
  391. <attribute name="closure_deadline" read_only="1"/>
  392. <attribute name="resolution_code" must_prompt="1"/>
  393. <attribute name="solution" must_prompt="1"/>
  394. <attribute name="user_satisfaction" hidden="1"/>
  395. <attribute name="user_commment" hidden="1"/>
  396. <attribute name="request_type" mandatory="1"/>
  397. <attribute name="freeze_reason" hidden="1"/>
  398. <attribute name="related_change_id_finalclass_recall"/>
  399. </flags>
  400. <transitions>
  401. <transition stimulus="ev_reassign" target="assigned">
  402. <actions/>
  403. </transition>
  404. <transition stimulus="ev_close" target="closed">
  405. <actions>
  406. <action verb="SetClosureDate"/>
  407. </actions>
  408. </transition>
  409. </transitions>
  410. </state>
  411. <state name="closed">
  412. <flags>
  413. <attribute name="ref" read_only="1"/>
  414. <attribute name="title" read_only="1"/>
  415. <attribute name="description" read_only="1"/>
  416. <attribute name="ticket_log" read_only="1"/>
  417. <attribute name="start_date" read_only="1"/>
  418. <attribute name="document_list"/>
  419. <attribute name="ci_list"/>
  420. <attribute name="contact_list"/>
  421. <attribute name="incident_list"/>
  422. <attribute name="status"/>
  423. <attribute name="caller_id" read_only="1"/>
  424. <attribute name="caller_email"/>
  425. <attribute name="org_id" read_only="1"/>
  426. <attribute name="org_name"/>
  427. <attribute name="service_id" read_only="1"/>
  428. <attribute name="service_name"/>
  429. <attribute name="servicesubcategory_id" read_only="1"/>
  430. <attribute name="servicesubcategory_name"/>
  431. <attribute name="product" read_only="1"/>
  432. <attribute name="impact" read_only="1"/>
  433. <attribute name="urgency" read_only="1"/>
  434. <attribute name="priority" read_only="1"/>
  435. <attribute name="workgroup_id" read_only="1"/>
  436. <attribute name="workgroup_name"/>
  437. <attribute name="agent_id" read_only="1"/>
  438. <attribute name="agent_name"/>
  439. <attribute name="agent_email" read_only="1"/>
  440. <attribute name="related_problem_id"/>
  441. <attribute name="related_problem_ref"/>
  442. <attribute name="related_change_id"/>
  443. <attribute name="related_change_ref"/>
  444. <attribute name="close_date" read_only="1"/>
  445. <attribute name="last_update" read_only="1"/>
  446. <attribute name="assignment_date" hidden="1"/>
  447. <attribute name="resolution_date" hidden="1"/>
  448. <attribute name="tto_escalation_deadline" hidden="1"/>
  449. <attribute name="ttr_escalation_deadline" hidden="1"/>
  450. <attribute name="closure_deadline" hidden="1"/>
  451. <attribute name="resolution_code" read_only="1"/>
  452. <attribute name="solution" read_only="1"/>
  453. <attribute name="user_satisfaction" must_prompt="1"/>
  454. <attribute name="user_commment" must_prompt="1"/>
  455. <attribute name="request_type" read_only="1"/>
  456. <attribute name="freeze_reason" hidden="1"/>
  457. <attribute name="related_change_id_finalclass_recall"/>
  458. </flags>
  459. <transitions/>
  460. </state>
  461. </states>
  462. </lifecycle>
  463. <methods>
  464. <method name="ComputeValues" static="false" access="public" type="Overload-DBObject"><![CDATA[ public function ComputeValues()
  465. {
  466. $sCurrRef = $this->Get('ref');
  467. if (strlen($sCurrRef) == 0)
  468. {
  469. $iKey = $this->GetKey();
  470. if ($iKey < 0)
  471. {
  472. // Object not yet in the Database
  473. $iKey = MetaModel::GetNextKey(get_class($this));
  474. }
  475. $sName = sprintf('R-%06d', $iKey);
  476. $this->Set('ref', $sName);
  477. }
  478. return parent::ComputeValues();
  479. }]]></method>
  480. <method name="GetIcon" static="false" access="public" type="Overload-DBObject"><comment><![CDATA[/**
  481. * Get the icon representing this object
  482. * @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
  483. * @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
  484. */]]></comment><![CDATA[ public function GetIcon($bImgTag = true)
  485. {
  486. $sStatus = $this->Get('status');
  487. switch($this->GetState())
  488. {
  489. case 'escalated_tto':
  490. case 'escalated_ttr':
  491. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  492. break;
  493. case 'resolved':
  494. case 'closed':
  495. $sIcon = self::MakeIconFromName('user-request-closed.png');
  496. break;
  497. case 'new':
  498. $sIcon = self::MakeIconFromName('user-request.png');
  499. $oEscalationDeadline = $this->Get('tto_escalation_deadline');
  500. if ($oEscalationDeadline != null)
  501. {
  502. // A SLA is running
  503. $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  504. $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
  505. $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
  506. if ($ratio <= 0)
  507. {
  508. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  509. }
  510. else if ($ratio <= 0.25)
  511. {
  512. $sIcon = self::MakeIconFromName('user-request-deadline.png');
  513. }
  514. }
  515. break;
  516. case 'assigned':
  517. $sIcon = self::MakeIconFromName('user-request.png');
  518. $oEscalationDeadline = $this->Get('ttr_escalation_deadline');
  519. if ($oEscalationDeadline != null)
  520. {
  521. // A SLA is running
  522. $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  523. $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
  524. $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
  525. if ($ratio <= 0)
  526. {
  527. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  528. }
  529. else if ($ratio <= 0.25)
  530. {
  531. $sIcon = self::MakeIconFromName('user-request-deadline.png');
  532. }
  533. }
  534. break;
  535. default:
  536. $sIcon = MetaModel::GetClassIcon(get_class($this), $bImgTag);
  537. }
  538. return $sIcon;
  539. }]]></method>
  540. <method name="MakeIconFromName" static="true" access="protected" type="Overload-DBObject"><![CDATA[ protected static function MakeIconFromName($sIconName, $bImgTag = true)
  541. {
  542. $sIcon = '';
  543. if ($sIconName != '')
  544. {
  545. $sPath = utils::GetAbsoluteUrlModulesRoot().'itop-request-mgmt-1.0.0/images/'.$sIconName;
  546. if ($bImgTag)
  547. {
  548. $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
  549. }
  550. else
  551. {
  552. $sIcon = $sPath;
  553. }
  554. }
  555. return $sIcon;
  556. }]]></method>
  557. </methods>
  558. <presentation>
  559. <details>
  560. <items>
  561. <item>document_list</item>
  562. <item>ci_list</item>
  563. <item>contact_list</item>
  564. <item>incident_list</item>
  565. <item key="col:col1">
  566. <items>
  567. <item key="fieldset:Ticket:baseinfo">
  568. <items>
  569. <item>ref</item>
  570. <item>title</item>
  571. <item>org_id</item>
  572. <item>status</item>
  573. <item>priority</item>
  574. <item>request_type</item>
  575. <item>service_id</item>
  576. <item>servicesubcategory_id</item>
  577. <item>product</item>
  578. </items>
  579. </item>
  580. <item key="fieldset:Ticket:moreinfo">
  581. <items>
  582. <item>impact</item>
  583. <item>urgency</item>
  584. <item>description</item>
  585. <item>resolution_code</item>
  586. <item>solution</item>
  587. <item>user_satisfaction</item>
  588. <item>user_commment</item>
  589. <item>freeze_reason</item>
  590. </items>
  591. </item>
  592. </items>
  593. </item>
  594. <item key="col:col2">
  595. <items>
  596. <item key="fieldset:Ticket:date">
  597. <items>
  598. <item>start_date</item>
  599. <item>last_update</item>
  600. <item>assignment_date</item>
  601. <item>tto_escalation_deadline</item>
  602. <item>ttr_escalation_deadline</item>
  603. <item>close_date</item>
  604. <item>closure_deadline</item>
  605. </items>
  606. </item>
  607. <item key="fieldset:Ticket:contact">
  608. <items>
  609. <item>caller_id</item>
  610. <item>workgroup_id</item>
  611. <item>agent_id</item>
  612. </items>
  613. </item>
  614. <item key="fieldset:Ticket:relation">
  615. <items>
  616. <item>related_problem_id</item>
  617. <item>related_change_id</item>
  618. </items>
  619. </item>
  620. </items>
  621. </item>
  622. </items>
  623. </details>
  624. <search>
  625. <items>
  626. <item>ref</item>
  627. <item>title</item>
  628. <item>org_id</item>
  629. <item>request_type</item>
  630. <item>start_date</item>
  631. <item>status</item>
  632. <item>caller_id</item>
  633. <item>service_id</item>
  634. <item>servicesubcategory_id</item>
  635. <item>product</item>
  636. <item>impact</item>
  637. <item>urgency</item>
  638. <item>priority</item>
  639. <item>workgroup_id</item>
  640. <item>agent_id</item>
  641. <item>agent_email</item>
  642. <item>close_date</item>
  643. <item>resolution_code</item>
  644. <item>solution</item>
  645. <item>user_satisfaction</item>
  646. <item>user_commment</item>
  647. </items>
  648. </search>
  649. <list>
  650. <items>
  651. <item>title</item>
  652. <item>org_id</item>
  653. <item>start_date</item>
  654. <item>status</item>
  655. <item>service_id</item>
  656. <item>priority</item>
  657. <item>workgroup_id</item>
  658. <item>agent_id</item>
  659. </items>
  660. </list>
  661. </presentation>
  662. </class>
  663. </classes>