datamodel.itop-request-mgmt.xml 31 KB

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