datamodel.itop-tickets.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3">
  3. <constants>
  4. <constant id="RESPONSE_TICKET_SLT_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT SLT AS slt JOIN lnkSLAToSLT AS l1 ON l1.slt_id=slt.id JOIN SLA AS sla ON l1.sla_id=sla.id JOIN lnkCustomerContractToService AS l2 ON l2.sla_id=sla.id JOIN CustomerContract AS sc ON l2.customercontract_id=sc.id WHERE slt.metric = :metric AND l2.service_id = :this->service_id AND sc.org_id = :this->org_id AND slt.request_type = :request_type AND slt.priority = :this->priority]]></constant>
  5. <constant id="PORTAL_POWER_USER_PROFILE" xsi:type="string" _delta="define"><![CDATA[Portal power user]]></constant>
  6. <constant id="PORTAL_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![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 = :org_id AND s.status != 'obsolete']]></constant>
  7. <constant id="PORTAL_SERVICE_SUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory WHERE service_id = :svc_id AND ServiceSubcategory.status != 'obsolete']]></constant>
  8. <constant id="PORTAL_VALIDATE_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![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 = :org_id AND s.id = :id AND s.status != 'obsolete']]></constant>
  9. <constant id="PORTAL_VALIDATE_SERVICESUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory AS Sub JOIN Service AS Svc ON Sub.service_id = Svc.id WHERE Sub.id=:id AND Sub.status != 'obsolete']]></constant>
  10. <constant id="PORTAL_ALL_PARAMS" xsi:type="string" _delta="define"><![CDATA[from_service_id,org_id,caller_id,service_id,servicesubcategory_id,title,description,impact,emergency,moreinfo,caller_id,start_date,end_date,duration,impact_duration]]></constant>
  11. <constant id="PORTAL_SET_TYPE_FROM" xsi:type="string" _delta="define"><![CDATA[request_type]]></constant>
  12. <constant id="PORTAL_TYPE_TO_CLASS" xsi:type="string" _delta="define"><![CDATA[]]></constant>
  13. <constant id="PORTAL_TICKETS_SEARCH_CRITERIA" xsi:type="string" _delta="define"><![CDATA[ref,start_date,close_date,service_id,caller_id]]></constant>
  14. <constant id="PORTAL_TICKETS_SEARCH_FILTER_service_id" xsi:type="string" _delta="define"><![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 = :org_id AND s.status != 'obsolete']]></constant>
  15. <constant id="PORTAL_TICKETS_SEARCH_FILTER_caller_id" xsi:type="string" _delta="define"><![CDATA[SELECT Person WHERE org_id = :org_id]]></constant>
  16. </constants>
  17. <classes>
  18. <class id="Ticket" _delta="define">
  19. <parent>cmdbAbstractObject</parent>
  20. <php_parent><name>_Ticket</name></php_parent>
  21. <properties>
  22. <comment><![CDATA[/**
  23. * Persistent classes for a CMDB
  24. *
  25. * @copyright Copyright (C) 2010-2012 Combodo SARL
  26. * @license http://opensource.org/licenses/AGPL-3.0
  27. */]]></comment>
  28. <category>bizmodel,searchable,structure</category>
  29. <abstract>true</abstract>
  30. <key_type>autoincrement</key_type>
  31. <db_table>ticket</db_table>
  32. <db_key_field>id</db_key_field>
  33. <db_final_class_field>finalclass</db_final_class_field>
  34. <naming>
  35. <attributes>
  36. <attribute id="ref"/>
  37. </attributes>
  38. </naming>
  39. <display_template/>
  40. <icon/>
  41. <reconciliation>
  42. <attributes>
  43. <attribute id="ref"/>
  44. </attributes>
  45. </reconciliation>
  46. </properties>
  47. <fields>
  48. <field id="operational_status" xsi:type="AttributeMetaEnum">
  49. <values>
  50. <value id="active">active</value>
  51. <value id="inactive">inactive</value>
  52. </values>
  53. <sql>operational_status</sql>
  54. <default_value>active</default_value>
  55. <mappings>
  56. <mapping id="Ticket">
  57. <attcode>status</attcode>
  58. <metavalues>
  59. <metavalue id="inactive">
  60. <values>
  61. <value id="resolved"/>
  62. <value id="closed"/>
  63. <value id="rejected"/>
  64. </values>
  65. </metavalue>
  66. </metavalues>
  67. </mapping>
  68. </mappings>
  69. </field>
  70. <field id="ref" xsi:type="AttributeString">
  71. <sql>ref</sql>
  72. <default_value/>
  73. <is_null_allowed>true</is_null_allowed>
  74. </field>
  75. <field id="org_id" xsi:type="AttributeExternalKey">
  76. <sql>org_id</sql>
  77. <target_class>Organization</target_class>
  78. <is_null_allowed>false</is_null_allowed>
  79. <on_target_delete>DEL_AUTO</on_target_delete>
  80. </field>
  81. <field id="org_name" xsi:type="AttributeExternalField">
  82. <extkey_attcode>org_id</extkey_attcode>
  83. <target_attcode>name</target_attcode>
  84. </field>
  85. <field id="caller_id" xsi:type="AttributeExternalKey">
  86. <filter><![CDATA[SELECT Person WHERE org_id = :this->org_id]]></filter>
  87. <dependencies>
  88. <attribute id="org_id"/>
  89. </dependencies>
  90. <sql>caller_id</sql>
  91. <target_class>Person</target_class>
  92. <is_null_allowed>true</is_null_allowed>
  93. <on_target_delete>DEL_AUTO</on_target_delete>
  94. </field>
  95. <field id="caller_name" xsi:type="AttributeExternalField">
  96. <extkey_attcode>caller_id</extkey_attcode>
  97. <target_attcode>name</target_attcode>
  98. </field>
  99. <field id="team_id" xsi:type="AttributeExternalKey">
  100. <sql>team_id</sql>
  101. <target_class>Team</target_class>
  102. <is_null_allowed>true</is_null_allowed>
  103. <on_target_delete>DEL_AUTO</on_target_delete>
  104. </field>
  105. <field id="team_name" xsi:type="AttributeExternalField">
  106. <extkey_attcode>team_id</extkey_attcode>
  107. <target_attcode>email</target_attcode>
  108. </field>
  109. <field id="agent_id" xsi:type="AttributeExternalKey">
  110. <filter><![CDATA[SELECT Person AS p JOIN lnkPersonToTeam AS l ON l.person_id=p.id JOIN Team AS t ON l.team_id=t.id WHERE t.id = :this->team_id]]></filter>
  111. <dependencies>
  112. <attribute id="team_id"/>
  113. </dependencies>
  114. <sql>agent_id</sql>
  115. <target_class>Person</target_class>
  116. <is_null_allowed>true</is_null_allowed>
  117. <on_target_delete>DEL_AUTO</on_target_delete>
  118. <allow_target_creation>false</allow_target_creation>
  119. </field>
  120. <field id="agent_name" xsi:type="AttributeExternalField">
  121. <extkey_attcode>agent_id</extkey_attcode>
  122. <target_attcode>name</target_attcode>
  123. </field>
  124. <field id="title" xsi:type="AttributeString">
  125. <sql>title</sql>
  126. <default_value/>
  127. <is_null_allowed>false</is_null_allowed>
  128. </field>
  129. <field id="description" xsi:type="AttributeText">
  130. <sql>description</sql>
  131. <default_value/>
  132. <is_null_allowed>false</is_null_allowed>
  133. <format>html</format>
  134. </field>
  135. <field id="start_date" xsi:type="AttributeDateTime">
  136. <always_load_in_tables>true</always_load_in_tables>
  137. <sql>start_date</sql>
  138. <default_value/>
  139. <is_null_allowed>true</is_null_allowed>
  140. </field>
  141. <field id="end_date" xsi:type="AttributeDateTime">
  142. <sql>end_date</sql>
  143. <default_value/>
  144. <is_null_allowed>true</is_null_allowed>
  145. </field>
  146. <field id="last_update" xsi:type="AttributeDateTime">
  147. <sql>last_update</sql>
  148. <default_value/>
  149. <is_null_allowed>true</is_null_allowed>
  150. <tracking_level>none</tracking_level>
  151. </field>
  152. <field id="close_date" xsi:type="AttributeDateTime">
  153. <sql>close_date</sql>
  154. <default_value/>
  155. <is_null_allowed>true</is_null_allowed>
  156. </field>
  157. <field id="private_log" xsi:type="AttributeCaseLog">
  158. <sql>private_log</sql>
  159. <default_value/>
  160. <is_null_allowed>true</is_null_allowed>
  161. </field>
  162. <field id="contacts_list" xsi:type="AttributeLinkedSetIndirect">
  163. <linked_class>lnkContactToTicket</linked_class>
  164. <ext_key_to_me>ticket_id</ext_key_to_me>
  165. <count_min>0</count_min>
  166. <count_max>0</count_max>
  167. <ext_key_to_remote>contact_id</ext_key_to_remote>
  168. <duplicates/>
  169. </field>
  170. <field id="functionalcis_list" xsi:type="AttributeLinkedSetIndirect">
  171. <linked_class>lnkFunctionalCIToTicket</linked_class>
  172. <ext_key_to_me>ticket_id</ext_key_to_me>
  173. <count_min>0</count_min>
  174. <count_max>0</count_max>
  175. <ext_key_to_remote>functionalci_id</ext_key_to_remote>
  176. <duplicates/>
  177. </field>
  178. <field id="workorders_list" xsi:type="AttributeLinkedSet">
  179. <linked_class>WorkOrder</linked_class>
  180. <ext_key_to_me>ticket_id</ext_key_to_me>
  181. <count_min>0</count_min>
  182. <count_max>0</count_max>
  183. </field>
  184. </fields>
  185. <methods>
  186. <method id="DBInsertNoReload">
  187. <static>false</static>
  188. <access>public</access>
  189. <type>Overload-DBObject</type>
  190. <code><![CDATA[
  191. public function DBInsertNoReload()
  192. {
  193. $oMutex = new iTopMutex('ticket_insert');
  194. $oMutex->Lock();
  195. $iNextId = MetaModel::GetNextKey(get_class($this));
  196. $sRef = $this->MakeTicketRef($iNextId);
  197. $this->Set('ref', $sRef);
  198. $iKey = parent::DBInsertNoReload();
  199. $oMutex->Unlock();
  200. return $iKey;
  201. }
  202. ]]></code>
  203. </method>
  204. <method id="MakeTicketRef">
  205. <static>false</static>
  206. <access>protected</access>
  207. <type>Overload-DBObject</type>
  208. <code><![CDATA[
  209. protected function MakeTicketRef($iNextId)
  210. {
  211. switch(get_class($this))
  212. {
  213. case 'UserRequest':
  214. $sFormat = 'R-%06d';
  215. break;
  216. case 'Incident':
  217. $sFormat = 'I-%06d';
  218. break;
  219. case 'Change':
  220. case 'RoutineChange':
  221. case 'EmergencyChange':
  222. case 'NormalChange':
  223. $sFormat = 'C-%06d';
  224. break;
  225. case 'Problem':
  226. $sFormat = 'P-%06d';
  227. break;
  228. default:
  229. $sFormat = 'T-%06d';
  230. }
  231. return sprintf($sFormat, $iNextId);
  232. }
  233. ]]></code>
  234. </method>
  235. </methods>
  236. <presentation>
  237. <details>
  238. <items>
  239. <item id="ref">
  240. <rank>10</rank>
  241. </item>
  242. <item id="org_id">
  243. <rank>20</rank>
  244. </item>
  245. <item id="caller_id">
  246. <rank>30</rank>
  247. </item>
  248. <item id="team_id">
  249. <rank>40</rank>
  250. </item>
  251. <item id="agent_id">
  252. <rank>50</rank>
  253. </item>
  254. <item id="title">
  255. <rank>60</rank>
  256. </item>
  257. <item id="description">
  258. <rank>70</rank>
  259. </item>
  260. <item id="operational_status">
  261. <rank>75</rank>
  262. </item>
  263. <item id="start_date">
  264. <rank>80</rank>
  265. </item>
  266. <item id="end_date">
  267. <rank>90</rank>
  268. </item>
  269. <item id="last_update">
  270. <rank>100</rank>
  271. </item>
  272. <item id="close_date">
  273. <rank>110</rank>
  274. </item>
  275. <item id="private_log">
  276. <rank>120</rank>
  277. </item>
  278. <item id="contacts_list">
  279. <rank>130</rank>
  280. </item>
  281. <item id="functionalcis_list">
  282. <rank>140</rank>
  283. </item>
  284. <item id="workorders_list">
  285. <rank>150</rank>
  286. </item>
  287. </items>
  288. </details>
  289. <search>
  290. <items>
  291. <item id="ref">
  292. <rank>10</rank>
  293. </item>
  294. <item id="title">
  295. <rank>20</rank>
  296. </item>
  297. <item id="description">
  298. <rank>30</rank>
  299. </item>
  300. <item id="operational_status">
  301. <rank>35</rank>
  302. </item>
  303. <item id="start_date">
  304. <rank>40</rank>
  305. </item>
  306. <item id="end_date">
  307. <rank>50</rank>
  308. </item>
  309. <item id="last_update">
  310. <rank>60</rank>
  311. </item>
  312. <item id="close_date">
  313. <rank>70</rank>
  314. </item>
  315. </items>
  316. </search>
  317. <list>
  318. <items>
  319. <item id="ref">
  320. <rank>10</rank>
  321. </item>
  322. <item id="org_id">
  323. <rank>20</rank>
  324. </item>
  325. <item id="title">
  326. <rank>30</rank>
  327. </item>
  328. <item id="caller_id">
  329. <rank>40</rank>
  330. </item>
  331. <item id="team_id">
  332. <rank>50</rank>
  333. </item>
  334. <item id="agent_id">
  335. <rank>60</rank>
  336. </item>
  337. <item id="operational_status">
  338. <rank>65</rank>
  339. </item>
  340. <item id="start_date">
  341. <rank>70</rank>
  342. </item>
  343. </items>
  344. </list>
  345. </presentation>
  346. </class>
  347. <class id="lnkContactToTicket" _delta="define">
  348. <parent>cmdbAbstractObject</parent>
  349. <properties>
  350. <is_link>1</is_link>
  351. <category>bizmodel</category>
  352. <abstract>false</abstract>
  353. <key_type>autoincrement</key_type>
  354. <db_table>lnkcontacttoticket</db_table>
  355. <db_key_field>id</db_key_field>
  356. <db_final_class_field/>
  357. <naming>
  358. <attributes>
  359. <attribute id="ticket_id"/>
  360. <attribute id="contact_id"/>
  361. </attributes>
  362. </naming>
  363. <display_template/>
  364. <icon/>
  365. <reconciliation>
  366. <attributes>
  367. <attribute id="ticket_id"/>
  368. <attribute id="contact_id"/>
  369. </attributes>
  370. </reconciliation>
  371. </properties>
  372. <fields>
  373. <field id="ticket_id" xsi:type="AttributeExternalKey">
  374. <sql>ticket_id</sql>
  375. <target_class>Ticket</target_class>
  376. <is_null_allowed>false</is_null_allowed>
  377. <on_target_delete>DEL_AUTO</on_target_delete>
  378. </field>
  379. <field id="ticket_ref" xsi:type="AttributeExternalField">
  380. <extkey_attcode>ticket_id</extkey_attcode>
  381. <target_attcode>ref</target_attcode>
  382. </field>
  383. <field id="contact_id" xsi:type="AttributeExternalKey">
  384. <sql>contact_id</sql>
  385. <target_class>Contact</target_class>
  386. <is_null_allowed>false</is_null_allowed>
  387. <on_target_delete>DEL_AUTO</on_target_delete>
  388. </field>
  389. <field id="contact_email" xsi:type="AttributeExternalField">
  390. <extkey_attcode>contact_id</extkey_attcode>
  391. <target_attcode>email</target_attcode>
  392. </field>
  393. <field id="role" xsi:type="AttributeString">
  394. <sql>role</sql>
  395. <default_value/>
  396. <is_null_allowed>true</is_null_allowed>
  397. </field>
  398. <field id="role_code" xsi:type="AttributeEnum">
  399. <values>
  400. <value id="manual">manual</value>
  401. <value id="computed">computed</value>
  402. <value id="do_not_notify">do_not_notify</value>
  403. </values>
  404. <sql>impact_code</sql>
  405. <default_value>manual</default_value>
  406. <is_null_allowed>false</is_null_allowed>
  407. <display_style>list</display_style>
  408. </field>
  409. </fields>
  410. <methods/>
  411. <presentation>
  412. <details>
  413. <items>
  414. <item id="ticket_id">
  415. <rank>10</rank>
  416. </item>
  417. <item id="contact_id">
  418. <rank>20</rank>
  419. </item>
  420. <item id="role_code">
  421. <rank>30</rank>
  422. </item>
  423. </items>
  424. </details>
  425. <search>
  426. <items>
  427. <item id="ticket_id">
  428. <rank>10</rank>
  429. </item>
  430. <item id="contact_id">
  431. <rank>20</rank>
  432. </item>
  433. <item id="role_code">
  434. <rank>30</rank>
  435. </item>
  436. </items>
  437. </search>
  438. <list>
  439. <items>
  440. <item id="ticket_id">
  441. <rank>10</rank>
  442. </item>
  443. <item id="contact_id">
  444. <rank>20</rank>
  445. </item>
  446. <item id="role_code">
  447. <rank>30</rank>
  448. </item>
  449. </items>
  450. </list>
  451. </presentation>
  452. </class>
  453. <class id="lnkFunctionalCIToTicket" _delta="define">
  454. <parent>cmdbAbstractObject</parent>
  455. <properties>
  456. <is_link>1</is_link>
  457. <category>bizmodel</category>
  458. <abstract>false</abstract>
  459. <key_type>autoincrement</key_type>
  460. <db_table>lnkfunctionalcitoticket</db_table>
  461. <db_key_field>id</db_key_field>
  462. <db_final_class_field/>
  463. <naming>
  464. <attributes>
  465. <attribute id="ticket_id"/>
  466. <attribute id="functionalci_id"/>
  467. </attributes>
  468. </naming>
  469. <display_template/>
  470. <icon/>
  471. <reconciliation>
  472. <attributes>
  473. <attribute id="ticket_id"/>
  474. <attribute id="functionalci_id"/>
  475. </attributes>
  476. </reconciliation>
  477. </properties>
  478. <fields>
  479. <field id="ticket_id" xsi:type="AttributeExternalKey">
  480. <sql>ticket_id</sql>
  481. <target_class>Ticket</target_class>
  482. <is_null_allowed>false</is_null_allowed>
  483. <on_target_delete>DEL_AUTO</on_target_delete>
  484. </field>
  485. <field id="ticket_ref" xsi:type="AttributeExternalField">
  486. <extkey_attcode>ticket_id</extkey_attcode>
  487. <target_attcode>ref</target_attcode>
  488. </field>
  489. <field id="ticket_title" xsi:type="AttributeExternalField">
  490. <extkey_attcode>ticket_id</extkey_attcode>
  491. <target_attcode>title</target_attcode>
  492. </field>
  493. <field id="functionalci_id" xsi:type="AttributeExternalKey">
  494. <sql>functionalci_id</sql>
  495. <target_class>FunctionalCI</target_class>
  496. <is_null_allowed>false</is_null_allowed>
  497. <on_target_delete>DEL_AUTO</on_target_delete>
  498. </field>
  499. <field id="functionalci_name" xsi:type="AttributeExternalField">
  500. <extkey_attcode>functionalci_id</extkey_attcode>
  501. <target_attcode>name</target_attcode>
  502. </field>
  503. <field id="impact" xsi:type="AttributeString">
  504. <sql>impact</sql>
  505. <default_value/>
  506. <is_null_allowed>true</is_null_allowed>
  507. </field>
  508. <field id="impact_code" xsi:type="AttributeEnum">
  509. <values>
  510. <value id="manual">manual</value>
  511. <value id="computed">computed</value>
  512. <value id="not_impacted">not_impacted</value>
  513. </values>
  514. <sql>impact_code</sql>
  515. <default_value>manual</default_value>
  516. <is_null_allowed>false</is_null_allowed>
  517. <display_style>list</display_style>
  518. </field>
  519. </fields>
  520. <methods/>
  521. <presentation>
  522. <details>
  523. <items>
  524. <item id="ticket_id">
  525. <rank>10</rank>
  526. </item>
  527. <item id="functionalci_id">
  528. <rank>20</rank>
  529. </item>
  530. <item id="impact_code">
  531. <rank>30</rank>
  532. </item>
  533. </items>
  534. </details>
  535. <search>
  536. <items>
  537. <item id="ticket_id">
  538. <rank>10</rank>
  539. </item>
  540. <item id="functionalci_id">
  541. <rank>20</rank>
  542. </item>
  543. <item id="impact_code">
  544. <rank>30</rank>
  545. </item>
  546. </items>
  547. </search>
  548. <list>
  549. <items>
  550. <item id="ticket_id">
  551. <rank>10</rank>
  552. </item>
  553. <item id="functionalci_id">
  554. <rank>20</rank>
  555. </item>
  556. <item id="impact_code">
  557. <rank>30</rank>
  558. </item>
  559. </items>
  560. </list>
  561. </presentation>
  562. </class>
  563. <class id="WorkOrder" _delta="define">
  564. <parent>cmdbAbstractObject</parent>
  565. <properties>
  566. <category>bizmodel,searchable,incidentmgmt,requestmgmt,changemgmt,m2prequest</category>
  567. <abstract>false</abstract>
  568. <key_type>autoincrement</key_type>
  569. <db_table>workorder</db_table>
  570. <db_key_field>id</db_key_field>
  571. <db_final_class_field/>
  572. <naming>
  573. <attributes>
  574. <attribute id="name"/>
  575. </attributes>
  576. </naming>
  577. <display_template/>
  578. <icon>images/workorder.png</icon>
  579. <reconciliation>
  580. <attributes>
  581. <attribute id="name"/>
  582. <attribute id="ticket_id"/>
  583. </attributes>
  584. </reconciliation>
  585. </properties>
  586. <fields>
  587. <field id="name" xsi:type="AttributeString">
  588. <sql>name</sql>
  589. <default_value/>
  590. <is_null_allowed>false</is_null_allowed>
  591. </field>
  592. <field id="status" xsi:type="AttributeEnum">
  593. <values>
  594. <value id="open">open</value>
  595. <value id="closed">closed</value>
  596. </values>
  597. <sql>status</sql>
  598. <default_value>open</default_value>
  599. <is_null_allowed>false</is_null_allowed>
  600. <display_style>list</display_style>
  601. </field>
  602. <field id="description" xsi:type="AttributeText">
  603. <sql>description</sql>
  604. <default_value/>
  605. <is_null_allowed>false</is_null_allowed>
  606. </field>
  607. <field id="ticket_id" xsi:type="AttributeExternalKey">
  608. <sql>ticket_id</sql>
  609. <target_class>Ticket</target_class>
  610. <is_null_allowed>false</is_null_allowed>
  611. <on_target_delete>DEL_AUTO</on_target_delete>
  612. </field>
  613. <field id="ticket_ref" xsi:type="AttributeExternalField">
  614. <extkey_attcode>ticket_id</extkey_attcode>
  615. <target_attcode>ref</target_attcode>
  616. </field>
  617. <field id="team_id" xsi:type="AttributeExternalKey">
  618. <filter>SELECT Team</filter>
  619. <sql>team_id</sql>
  620. <target_class>Team</target_class>
  621. <is_null_allowed>false</is_null_allowed>
  622. <on_target_delete>DEL_MANUAL</on_target_delete>
  623. </field>
  624. <field id="team_name" xsi:type="AttributeExternalField">
  625. <extkey_attcode>team_id</extkey_attcode>
  626. <target_attcode>email</target_attcode>
  627. </field>
  628. <field id="agent_id" xsi:type="AttributeExternalKey">
  629. <filter><![CDATA[SELECT Person AS p JOIN lnkPersonToTeam AS l ON l.person_id=p.id JOIN Team AS t ON l.team_id=t.id WHERE t.id = :this->team_id]]></filter>
  630. <dependencies>
  631. <attribute id="team_id"/>
  632. </dependencies>
  633. <sql>owner_id</sql>
  634. <target_class>Person</target_class>
  635. <is_null_allowed>true</is_null_allowed>
  636. <on_target_delete>DEL_MANUAL</on_target_delete>
  637. <allow_target_creation>false</allow_target_creation>
  638. </field>
  639. <field id="agent_email" xsi:type="AttributeExternalField">
  640. <extkey_attcode>agent_id</extkey_attcode>
  641. <target_attcode>email</target_attcode>
  642. </field>
  643. <field id="start_date" xsi:type="AttributeDateTime">
  644. <sql>start_date</sql>
  645. <default_value/>
  646. <is_null_allowed>false</is_null_allowed>
  647. </field>
  648. <field id="end_date" xsi:type="AttributeDateTime">
  649. <sql>end_date</sql>
  650. <default_value/>
  651. <is_null_allowed>false</is_null_allowed>
  652. </field>
  653. <field id="log" xsi:type="AttributeCaseLog">
  654. <sql>log</sql>
  655. <default_value/>
  656. <is_null_allowed>true</is_null_allowed>
  657. </field>
  658. </fields>
  659. <lifecycle>
  660. <attribute>status</attribute>
  661. <stimuli>
  662. <stimulus id="ev_close" xsi:type="StimulusUserAction"/>
  663. </stimuli>
  664. <states>
  665. <state id="open">
  666. <flags/>
  667. <transitions>
  668. <transition id="ev_close">
  669. <target>closed</target>
  670. <actions/>
  671. </transition>
  672. </transitions>
  673. </state>
  674. <state id="closed">
  675. <flags/>
  676. <transitions/>
  677. </state>
  678. </states>
  679. </lifecycle>
  680. <methods>
  681. <method id="UpdateParentTicketLog">
  682. <static>false</static>
  683. <access>public</access>
  684. <type>StimulusUserAction</type>
  685. <arguments>
  686. </arguments>
  687. <code><![CDATA[ public function UpdateParentTicketLog()
  688. {
  689. $oLog = $this->Get('log');
  690. $sLog = $oLog->GetModifiedEntry();
  691. if ($sLog != '')
  692. {
  693. $oTicket = MetaModel::GetObject('Ticket', $this->Get('ticket_id'), false);
  694. if ($oTicket)
  695. {
  696. $oTicket->Set('private_log', $sLog);
  697. $oTicket->DBUpdate();
  698. }
  699. }
  700. }]]></code>
  701. </method>
  702. <method id="OnUpdate">
  703. <static>false</static>
  704. <access>protected</access>
  705. <type>Overload-DBObject</type>
  706. <code><![CDATA[ protected function OnUpdate()
  707. {
  708. $this->UpdateParentTicketLog();
  709. }]]></code>
  710. </method>
  711. </methods>
  712. <presentation>
  713. <details>
  714. <items>
  715. <item id="name">
  716. <rank>10</rank>
  717. </item>
  718. <item id="status">
  719. <rank>20</rank>
  720. </item>
  721. <item id="ticket_id">
  722. <rank>30</rank>
  723. </item>
  724. <item id="team_id">
  725. <rank>40</rank>
  726. </item>
  727. <item id="agent_id">
  728. <rank>50</rank>
  729. </item>
  730. <item id="description">
  731. <rank>60</rank>
  732. </item>
  733. <item id="start_date">
  734. <rank>70</rank>
  735. </item>
  736. <item id="end_date">
  737. <rank>80</rank>
  738. </item>
  739. </items>
  740. </details>
  741. <search>
  742. <items>
  743. <item id="name">
  744. <rank>10</rank>
  745. </item>
  746. <item id="status">
  747. <rank>20</rank>
  748. </item>
  749. <item id="ticket_id">
  750. <rank>30</rank>
  751. </item>
  752. <item id="team_id">
  753. <rank>40</rank>
  754. </item>
  755. <item id="agent_id">
  756. <rank>50</rank>
  757. </item>
  758. <item id="start_date">
  759. <rank>60</rank>
  760. </item>
  761. <item id="end_date">
  762. <rank>70</rank>
  763. </item>
  764. </items>
  765. </search>
  766. <list>
  767. <items>
  768. <item id="status">
  769. <rank>10</rank>
  770. </item>
  771. <item id="ticket_id">
  772. <rank>20</rank>
  773. </item>
  774. <item id="start_date">
  775. <rank>30</rank>
  776. </item>
  777. <item id="end_date">
  778. <rank>40</rank>
  779. </item>
  780. <item id="team_id">
  781. <rank>50</rank>
  782. </item>
  783. <item id="agent_id">
  784. <rank>60</rank>
  785. </item>
  786. </items>
  787. </list>
  788. </presentation>
  789. </class>
  790. </classes>
  791. <meta>
  792. <classes>
  793. <class id="cmdbAbstractObject" _delta="define">
  794. <methods>
  795. <method id="Set">
  796. <arguments>
  797. <argument id="1">
  798. <type>attcode</type>
  799. <mandatory>true</mandatory>
  800. <type_restrictions>
  801. <operation>deny</operation>
  802. <types>
  803. <type id="AttributeStopWatch"/>
  804. <type id="AttributeSubItem"/>
  805. <type id="AttributeExternalField"/>
  806. <type id="AttributeLinkedSetIndirect"/>
  807. <type id="AttributeLinkedSet"/>
  808. </types>
  809. </type_restrictions>
  810. </argument>
  811. <argument id="2">
  812. <type>string</type>
  813. <mandatory>true</mandatory>
  814. </argument>
  815. </arguments>
  816. </method>
  817. <method id="SetCurrentDate">
  818. <arguments>
  819. <argument id="1">
  820. <type>attcode</type>
  821. <mandatory>true</mandatory>
  822. <type_restrictions>
  823. <operation>allow</operation>
  824. <types>
  825. <type id="AttributeDate"/>
  826. <type id="AttributeDateTime"/>
  827. <type id="AttributeString"/>
  828. </types>
  829. </type_restrictions>
  830. </argument>
  831. </arguments>
  832. </method>
  833. <method id="SetCurrentUser">
  834. <arguments>
  835. <argument id="1">
  836. <type>attcode</type>
  837. <mandatory>true</mandatory>
  838. <type_restrictions>
  839. <operation>allow</operation>
  840. <types>
  841. <type id="AttributeExternalKey"/>
  842. <type id="AttributeInteger"/>
  843. <type id="AttributeString"/>
  844. </types>
  845. </type_restrictions>
  846. </argument>
  847. </arguments>
  848. </method>
  849. <method id="SetCurrentPerson">
  850. <arguments>
  851. <argument id="1">
  852. <type>attcode</type>
  853. <mandatory>true</mandatory>
  854. <type_restrictions>
  855. <operation>allow</operation>
  856. <types>
  857. <type id="AttributeExternalKey"/>
  858. <type id="AttributeInteger"/>
  859. <type id="AttributeString"/>
  860. </types>
  861. </type_restrictions>
  862. </argument>
  863. </arguments>
  864. </method>
  865. <method id="SetElapsedTime">
  866. <arguments>
  867. <argument id="1">
  868. <type>attcode</type>
  869. <mandatory>true</mandatory>
  870. <type_restrictions>
  871. <operation>allow</operation>
  872. <types>
  873. <type id="AttributeDuration"/>
  874. </types>
  875. </type_restrictions>
  876. </argument>
  877. <argument id="2">
  878. <type>attcode</type>
  879. <mandatory>true</mandatory>
  880. <type_restrictions>
  881. <operation>allow</operation>
  882. <types>
  883. <type id="AttributeDate"/>
  884. <type id="AttributeDateTime"/>
  885. </types>
  886. </type_restrictions>
  887. </argument>
  888. <argument id="3">
  889. <type>string</type>
  890. <mandatory>false</mandatory>
  891. </argument>
  892. </arguments>
  893. </method>
  894. <method id="Reset">
  895. <arguments>
  896. <argument id="1">
  897. <type>attcode</type>
  898. <mandatory>true</mandatory>
  899. <type_restrictions>
  900. <operation>deny</operation>
  901. <types>
  902. <type id="AttributeStopWatch"/>
  903. <type id="AttributeSubItem"/>
  904. <type id="AttributeExternalField"/>
  905. </types>
  906. </type_restrictions>
  907. </argument>
  908. </arguments>
  909. </method>
  910. <method id="ResetStopWatch">
  911. <arguments>
  912. <argument id="1">
  913. <type>attcode</type>
  914. <mandatory>true</mandatory>
  915. <type_restrictions>
  916. <operation>allow</operation>
  917. <types>
  918. <type id="AttributeStopWatch"/>
  919. </types>
  920. </type_restrictions>
  921. </argument>
  922. </arguments>
  923. </method>
  924. <method id="Copy">
  925. <arguments>
  926. <argument id="1">
  927. <type>attcode</type>
  928. <mandatory>true</mandatory>
  929. <type_restrictions>
  930. <operation>deny</operation>
  931. <types>
  932. <type id="AttributeStopWatch"/>
  933. <type id="AttributeSubItem"/>
  934. <type id="AttributeExternalField"/>
  935. </types>
  936. </type_restrictions>
  937. </argument>
  938. <argument id="2">
  939. <type>attcode</type>
  940. <mandatory>true</mandatory>
  941. </argument>
  942. </arguments>
  943. </method>
  944. </methods>
  945. </class>
  946. <class id="ResponseTicketTTO" _delta="define">
  947. <interfaces>
  948. <interface id="iMetricComputer"/>
  949. </interfaces>
  950. </class>
  951. <class id="ResponseTicketTTR" _delta="define">
  952. <interfaces>
  953. <interface id="iMetricComputer"/>
  954. </interfaces>
  955. </class>
  956. </classes>
  957. </meta>
  958. </itop_design>