datamodel.itop-tickets.xml 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457
  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. <module_designs>
  959. <module_design id="itop-portal" xsi:type="portal" _delta="define">
  960. <properties>
  961. <name>portal:itop-portal</name>
  962. <!-- Can be either a fileref or a relative path to the file (To be tested). Takes over env-xxx/branding/portal-logo.png -->
  963. <!--<fileref ref="brt_6a2be154b2a62659d3332c513bdad715" />-->
  964. <!--<logo>../images/itop-logo.png</logo>-->
  965. <!-- Can be either a fileref or a relative path to the file from /env-xxx -->
  966. <!-- Available themes must have a unique id. Some ids are loaded in a specific order : bootstrap/portal/custom. Other ids are loaded after them, but their order cannot be predicted -->
  967. <themes/>
  968. <!-- Can be either a fileref or a relative path to the file from /env-xxx -->
  969. <!-- Available templates are id="layout|home" -->
  970. <templates/>
  971. <!-- An OQL query to determine which TriggerOnPortalUpdate to use within THIS instance of the portal. This is mostly needed to enable different triggers on several portal instances -->
  972. <!-- Note : ":parent_classes" parameter is a reserved name that will be used for the current object class name (and its ancestors) -->
  973. <triggers_query><![CDATA[SELECT TriggerOnPortalUpdate AS t WHERE t.target_class IN (:parent_classes)]]></triggers_query>
  974. <attachments>
  975. <allow_delete>true</allow_delete>
  976. </attachments>
  977. </properties>
  978. <bricks>
  979. <brick id="user-profile" xsi:type="Combodo\iTop\Portal\Brick\UserProfileBrick">
  980. <rank>
  981. <default>1</default>
  982. </rank>
  983. <title>
  984. <default>Brick:Portal:UserProfile:Navigation:Dropdown:MyProfil</default>
  985. </title>
  986. <decoration_class>
  987. <default>glyphicon glyphicon-user</default>
  988. </decoration_class>
  989. <form>
  990. <!-- Optionnal tag to list the fields -->
  991. <fields />
  992. <!-- Optionnal tag to specify the form layout. Fields that are not positionned in the layout will be placed at the end of the form -->
  993. <twig>
  994. <!-- data-field-id attribute must be an attribute code of the class -->
  995. <!-- data-field-flags attribute contains flags among read_only/hidden/mandatory/must_prompt/must_change -->
  996. <div class="form_field" data-field-id="first_name" data-field-flags="read_only">
  997. </div>
  998. <div class="form_field" data-field-id="name" data-field-flags="read_only">
  999. </div>
  1000. <div class="form_field" data-field-id="org_id" data-field-flags="read_only">
  1001. </div>
  1002. <div class="form_field" data-field-id="email" data-field-flags="read_only">
  1003. </div>
  1004. <div class="form_field" data-field-id="phone">
  1005. </div>
  1006. <div class="form_field" data-field-id="location_id">
  1007. </div>
  1008. <div class="form_field" data-field-id="function">
  1009. </div>
  1010. <div class="form_field" data-field-id="manager_id" data-field-flags="read_only">
  1011. </div>
  1012. </twig>
  1013. </form>
  1014. </brick>
  1015. <brick id="services" xsi:type="Combodo\iTop\Portal\Brick\BrowseBrick">
  1016. <active>true</active>
  1017. <width>6</width>
  1018. <rank>
  1019. <default>10</default>
  1020. </rank>
  1021. <title>
  1022. <default>Portal:CreateNewRequest</default>
  1023. </title>
  1024. <description>Portal:CreateNewRequest+</description>
  1025. <decoration_class>
  1026. <default>fa fa-map fa-2x</default>
  1027. </decoration_class>
  1028. <!-- <fields /> Optional tag to add attributes to the table by their code, can be specified for each level -->
  1029. <levels>
  1030. <level id="1">
  1031. <class>ServiceFamily</class>
  1032. <levels>
  1033. <!-- Level IDs must be numeric -->
  1034. <level id="1">
  1035. <!-- Can be either a class tag with the class name or an oql tag with the query -->
  1036. <class>Service</class>
  1037. <!-- Attribute code of the above class that point to the upper level class -->
  1038. <parent_att>servicefamily_id</parent_att>
  1039. <!-- Attribute code to use to display the object name, default is 'name'. -->
  1040. <name_att/>
  1041. <!-- Description text from attribute of above class [from the OQL] -->
  1042. <tooltip_att>description</tooltip_att>
  1043. <!-- Title of the level, will be display in lists and others browse modes -->
  1044. <title>Service</title>
  1045. <!-- Optional tag to add attributes to the table by their code, can be specified for each level -->
  1046. <!-- <fields /> -->
  1047. <!-- Can be empty on intermediate levels, default is drilldown -->
  1048. <actions>
  1049. <action id="drilldown" xsi:type="drilldown"/>
  1050. </actions>
  1051. <levels>
  1052. <level id="1">
  1053. <!-- Note : We could have used just a class tag and putted the OQL in the scope for everybody -->
  1054. <oql><![CDATA[SELECT ServiceSubcategory WHERE ServiceSubcategory.status != 'obsolete']]></oql>
  1055. <parent_att>service_id</parent_att>
  1056. <name_att/>
  1057. <tooltip_att>description</tooltip_att>
  1058. <title>Sous-Service</title>
  1059. <actions>
  1060. <action id="view" xsi:type="view"/>
  1061. <action id="create_from_this" xsi:type="create_from_this">
  1062. <!-- Can be either a class tag containing the class of the object to create, or a static method taking the origin object as a parameter and that will return a object of the desired class -->
  1063. <!-- (eg. \Ticket::FromServiceSubcategory($oOrigin) that should return either a UserRequest or Incident regarding the request type) -->
  1064. <class>UserRequest</class>
  1065. <!-- Optional tag that can be used on any action type -->
  1066. <!--<title>Créer un ticket</title>-->
  1067. <!--<icon_class>glyphicon glyphicon-plus</icon_class>-->
  1068. <rules>
  1069. <rule id="contact-to-userrequest"/>
  1070. <rule id="servicesubcategory-to-userrequest"/>
  1071. </rules>
  1072. </action>
  1073. </actions>
  1074. <levels/>
  1075. </level>
  1076. </levels>
  1077. </level>
  1078. </levels>
  1079. </level>
  1080. </levels>
  1081. <browse_modes>
  1082. <availables>
  1083. <mode id="list"/>
  1084. <mode id="tree"/>
  1085. </availables>
  1086. <default>tree</default>
  1087. </browse_modes>
  1088. <data_loading>auto</data_loading>
  1089. <!-- lazy|full|auto. Let the consultant choose if the list/tree data are load progressivly at each page/level or in one-shot or if it is up to the system regarding the "lazy_loading_threshold" parameter -->
  1090. </brick>
  1091. <brick id="ongoing-tickets-for-portal-user" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick">
  1092. <active>true</active>
  1093. <rank>
  1094. <default>20</default>
  1095. </rank>
  1096. <width>6</width>
  1097. <title>
  1098. <default>Portal:ShowOngoing</default>
  1099. </title>
  1100. <description>Portal:ShowOngoing+</description>
  1101. <decoration_class>
  1102. <default>fa fa-pencil-square fa-2x</default>
  1103. </decoration_class>
  1104. <oql><![CDATA[SELECT Ticket WHERE org_id = :current_contact->org_id AND caller_id = :current_contact_id]]></oql>
  1105. <!-- Can be either a class tag with the class name or an oql tag with the query -->
  1106. <!-- <class>Ticket</class> -->
  1107. <fields>
  1108. <field id="title"/>
  1109. <field id="start_date"/>
  1110. <field id="status"/>
  1111. <field id="service_id"/>
  1112. <field id="servicesubcategory_id"/>
  1113. <field id="priority"/>
  1114. <field id="caller_id"/>
  1115. </fields>
  1116. <!-- Optional tag to add attributes to the table by their code -->
  1117. <grouping>
  1118. <!-- Optionnal -->
  1119. <tabs>
  1120. <!-- Optionnal. Grouping by tabs -->
  1121. <!--<attribute>operational_status</attribute>-->
  1122. <!-- attribute xor groups tag -->
  1123. <groups>
  1124. <!-- Can be used only with ../oql tag, not ../class tag. Reason is that we can't know the class alias to apply to the condition's fields. We might have an exception saying that the field in ambigious for the generated query. -->
  1125. <group id="opened">
  1126. <rank>1</rank>
  1127. <title>En cours</title>
  1128. <condition><![CDATA[SELECT Ticket AS T WHERE operational_status NOT IN ('closed', 'resolved')]]></condition>
  1129. </group>
  1130. <group id="resolved">
  1131. <rank>2</rank>
  1132. <title>Résolues</title>
  1133. <condition><![CDATA[SELECT Ticket AS T WHERE org_id = :current_contact->org_id AND operational_status = 'resolved']]></condition>
  1134. </group>
  1135. </groups>
  1136. </tabs>
  1137. <!-- Implicit grouping on y axis by finalclass -->
  1138. </grouping>
  1139. <data_loading>full</data_loading>
  1140. </brick>
  1141. <brick id="closed-tickets-for-portal-user" xsi:type="Combodo\iTop\Portal\Brick\ManageBrick">
  1142. <active>true</active>
  1143. <rank>
  1144. <menu>50</menu>
  1145. </rank>
  1146. <visible>
  1147. <home>false</home>
  1148. </visible>
  1149. <width>12</width>
  1150. <title>
  1151. <default>Portal:ShowClosed</default>
  1152. </title>
  1153. <description>Portal:ShowClosed+</description>
  1154. <decoration_class>
  1155. <default>fa fa-pencil-square fa-2x</default>
  1156. </decoration_class>
  1157. <oql><![CDATA[SELECT UserRequest WHERE org_id = :current_contact->org_id AND caller_id = :current_contact_id AND status = 'closed']]></oql>
  1158. <!-- Can be either a class tag with the class name or an oql tag with the query -->
  1159. <!-- <class>Ticket</class> -->
  1160. <fields>
  1161. <field id="finalclass"/>
  1162. <field id="title"/>
  1163. <field id="start_date"/>
  1164. <field id="status"/>
  1165. <field id="servicesubcategory_id"/>
  1166. <field id="priority"/>
  1167. <field id="caller_id"/>
  1168. </fields>
  1169. <data_loading>auto</data_loading>
  1170. </brick>
  1171. </bricks>
  1172. <forms>
  1173. <form id="servicesubcategory">
  1174. <class>ServiceSubcategory</class>
  1175. <!-- Optionnal tag to list the fields -->
  1176. <fields />
  1177. <!-- Optionnal tag to specify the form layout. Fields that are not positionned in the layout will be placed at the end of the form -->
  1178. <twig>
  1179. <div class="row">
  1180. <div class="col-sm-6">
  1181. <!-- data-field-id attribute must be an attribute code of the class -->
  1182. <div class="form_field" data-field-id="service_id">
  1183. </div>
  1184. <!-- data-field-flags attribute contains flags among read_only/hidden/mandatory/must_prompt/must_change -->
  1185. <div class="form_field" data-field-id="name" data-field-flags="read_only">
  1186. </div>
  1187. <div class="form_field" data-field-id="status" data-field-flags="read_only">
  1188. </div>
  1189. </div>
  1190. <div class="col-sm-6">
  1191. <div class="form_field" data-field-id="service_org_id">
  1192. </div>
  1193. <div class="form_field" data-field-id="request_type">
  1194. </div>
  1195. </div>
  1196. </div>
  1197. <div>
  1198. <div class="form_field" data-field-id="description">
  1199. </div>
  1200. </div>
  1201. </twig>
  1202. </form>
  1203. <form id="user-request-view">
  1204. <class>UserRequest</class>
  1205. <fields>
  1206. <field id="title"/>
  1207. <field id="description">
  1208. <mandatory>true</mandatory>
  1209. </field>
  1210. <field id="status"/>
  1211. <field id="agent_id">
  1212. <read_only>true</read_only>
  1213. </field>
  1214. <field id="related_request_list">
  1215. <hidden>true</hidden>
  1216. </field>
  1217. <field id="contacts_list">
  1218. <hidden>true</hidden>
  1219. </field>
  1220. </fields>
  1221. <modes>
  1222. <mode id="view"/>
  1223. </modes>
  1224. </form>
  1225. <form id="ticket-create">
  1226. <class>Ticket</class>
  1227. <fields />
  1228. <twig>
  1229. <div class="row">
  1230. <div class="col-sm-6">
  1231. <div class="form_field" data-field-id="service_id" data-field-flags="mandatory">
  1232. </div>
  1233. </div>
  1234. <div class="col-sm-6">
  1235. <div class="form_field" data-field-id="servicesubcategory_id" data-field-flags="mandatory">
  1236. </div>
  1237. </div>
  1238. </div>
  1239. <div id="service_details_placeholder">
  1240. </div>
  1241. <div class="row">
  1242. <div class="col-sm-6">
  1243. <div class="form_field" data-field-id="impact">
  1244. </div>
  1245. </div>
  1246. <div class="col-sm-6">
  1247. <div class="form_field" data-field-id="urgency">
  1248. </div>
  1249. </div>
  1250. </div>
  1251. <div>
  1252. <div class="form_field" data-field-id="title">
  1253. </div>
  1254. <div class="form_field" data-field-id="description">
  1255. </div>
  1256. <div class="form_field" data-field-id="contacts_list">
  1257. </div>
  1258. </div>
  1259. </twig>
  1260. <modes>
  1261. <!-- mode id can among create / edit / view -->
  1262. <mode id="create"/>
  1263. </modes>
  1264. </form>
  1265. <form id="ticket-edit">
  1266. <class>Ticket</class>
  1267. <fields></fields>
  1268. <twig>
  1269. <div class="row">
  1270. <div class="col-sm-6">
  1271. <div class="form_field" data-field-id="caller_id" data-field-flags="read_only">
  1272. </div>
  1273. <div class="form_field" data-field-id="service_id" data-field-flags="read_only">
  1274. </div>
  1275. <div class="form_field" data-field-id="servicesubcategory_id" data-field-flags="read_only">
  1276. </div>
  1277. <div class="form_field" data-field-id="title" data-field-flags="read_only">
  1278. </div>
  1279. <div class="form_field" data-field-id="description" data-field-flags="read_only">
  1280. </div>
  1281. <div class="form_field" data-field-id="solution" data-field-flags="read_only">
  1282. </div>
  1283. <div class="form_field" data-field-id="user_satisfaction" data-field-flags="read_only">
  1284. </div>
  1285. <div class="form_field" data-field-id="user_comment" data-field-flags="read_only">
  1286. </div>
  1287. </div>
  1288. <div class="col-sm-6">
  1289. <div class="form_field" data-field-id="status" data-field-flags="read_only">
  1290. </div>
  1291. <div class="form_field" data-field-id="impact" data-field-flags="read_only">
  1292. </div>
  1293. <div class="form_field" data-field-id="urgency" data-field-flags="read_only">
  1294. </div>
  1295. <div class="form_field" data-field-id="priority" data-field-flags="read_only">
  1296. </div>
  1297. <div class="form_field" data-field-id="start_date" data-field-flags="read_only">
  1298. </div>
  1299. <div class="form_field" data-field-id="last_update" data-field-flags="read_only">
  1300. </div>
  1301. <!--<div class="form_field" data-field-id="resolution_date" data-field-flags="read_only">
  1302. </div>-->
  1303. </div>
  1304. </div>
  1305. <div>
  1306. <div class="form_field" data-field-id="contacts_list">
  1307. </div>
  1308. <div class="form_field" data-field-id="public_log">
  1309. </div>
  1310. </div>
  1311. </twig>
  1312. <modes>
  1313. <mode id="edit"/>
  1314. </modes>
  1315. </form>
  1316. </forms>
  1317. <classes>
  1318. <!-- Note : A class (or one of its ancestors) MUST be declared here to be displayed in the portal -->
  1319. <class id="User">
  1320. <!-- Allow <allowed_profile>s to apply the <transition>s below. Flags on <field>s will be merged with those from datamodel -->
  1321. <!-- See example in UserRequest class -->
  1322. <!--<lifecycle/>-->
  1323. <scopes>
  1324. <!-- Note : Silos apply to those scope queries -->
  1325. <scope id="all">
  1326. <oql_view><![CDATA[SELECT User AS U JOIN Person AS P ON U.contactid=P.id WHERE P.id = :current_contact_id]]></oql_view>
  1327. <!-- No object of this class can be edited -->
  1328. <!--<oql_edit />-->
  1329. <!-- Everybody -->
  1330. <!--<allowed_profiles />-->
  1331. </scope>
  1332. </scopes>
  1333. </class>
  1334. <class id="Organization">
  1335. <scopes>
  1336. <scope id="all">
  1337. <oql_view><![CDATA[SELECT Organization]]></oql_view>
  1338. </scope>
  1339. </scopes>
  1340. </class>
  1341. <class id="Contact">
  1342. <scopes>
  1343. <scope id="all">
  1344. <oql_view><![CDATA[SELECT Contact]]></oql_view>
  1345. </scope>
  1346. </scopes>
  1347. </class>
  1348. <class id="Person">
  1349. <scopes>
  1350. <scope id="all">
  1351. <oql_view><![CDATA[SELECT Person AS P WHERE P.org_id = :current_contact->org_id OR P.id = :current_contact_id]]></oql_view>
  1352. <oql_edit><![CDATA[SELECT Person AS P WHERE P.id = :current_contact_id]]></oql_edit>
  1353. </scope>
  1354. <scope id="administrator">
  1355. <oql_view><![CDATA[SELECT Person AS P]]></oql_view>
  1356. <allowed_profiles>
  1357. <allowed_profile id="Administrator"/>
  1358. </allowed_profiles>
  1359. </scope>
  1360. </scopes>
  1361. </class>
  1362. <class id="ServiceFamily">
  1363. <scopes>
  1364. <scope id="all">
  1365. <oql_view><![CDATA[SELECT ServiceFamily]]></oql_view>
  1366. </scope>
  1367. </scopes>
  1368. </class>
  1369. <class id="Service">
  1370. <scopes>
  1371. <scope id="all">
  1372. <oql_view><![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 = :current_contact->org_id AND s.status != 'obsolete']]></oql_view>
  1373. </scope>
  1374. </scopes>
  1375. </class>
  1376. <class id="ServiceSubcategory">
  1377. <scopes>
  1378. <scope id="all">
  1379. <oql_view><![CDATA[SELECT ServiceSubcategory WHERE status != 'obsolete']]></oql_view>
  1380. </scope>
  1381. </scopes>
  1382. </class>
  1383. <class id="Ticket">
  1384. <lifecycle>
  1385. <transitions>
  1386. <transition id="ev_resolve">
  1387. <fields>
  1388. <field id="agent_id">
  1389. <must_prompt/>
  1390. </field>
  1391. </fields>
  1392. <allowed_profiles>
  1393. <allowed_profile id="Portal user"/>
  1394. </allowed_profiles>
  1395. </transition>
  1396. </transitions>
  1397. </lifecycle>
  1398. <scopes>
  1399. <scope id="all">
  1400. <oql_view><![CDATA[SELECT Ticket AS T WHERE T.caller_id = :current_contact_id AND T.finalclass IN ('UserRequest', 'Incident')]]></oql_view>
  1401. <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
  1402. </scope>
  1403. <scope id="portal-power-user">
  1404. <oql_view><![CDATA[SELECT Ticket AS T WHERE T.finalclass IN ('UserRequest', 'Incident')]]></oql_view>
  1405. <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
  1406. <allowed_profiles>
  1407. <allowed_profile id="Portal power user"/>
  1408. </allowed_profiles>
  1409. </scope>
  1410. <scope id="admin">
  1411. <oql_view><![CDATA[SELECT Ticket AS T]]></oql_view>
  1412. <oql_edit><![CDATA[SELECT Ticket AS T]]></oql_edit>
  1413. <allowed_profiles>
  1414. <allowed_profile id="Administrator"/>
  1415. </allowed_profiles>
  1416. </scope>
  1417. </scopes>
  1418. </class>
  1419. </classes>
  1420. <action_rules>
  1421. <action_rule id="contact-to-userrequest">
  1422. <!-- source_oql|source_class is only necessary if there is some copy preset|retrofit -->
  1423. <source_oql><![CDATA[SELECT Contact AS C WHERE C.id = :current_contact_id]]></source_oql>
  1424. <presets>
  1425. <!-- Only set() and copy() are supported for now -->
  1426. <preset id="1">set(caller_id, $current_contact_id$)</preset>
  1427. <preset id="2">copy(org_id, org_id)</preset>
  1428. </presets>
  1429. <retrofits/>
  1430. </action_rule>
  1431. <action_rule id="service-to-userrequest">
  1432. <source_class>Service</source_class>
  1433. <presets>
  1434. <preset id="1">copy(id, service_id)</preset>
  1435. </presets>
  1436. </action_rule>
  1437. <action_rule id="servicesubcategory-to-userrequest">
  1438. <source_class>ServiceSubcategory</source_class>
  1439. <presets>
  1440. <preset id="1">copy(id, servicesubcategory_id)</preset>
  1441. <preset id="2">copy(service_id, service_id)</preset>
  1442. </presets>
  1443. </action_rule>
  1444. </action_rules>
  1445. </module_design>
  1446. </module_designs>
  1447. <module_parameters>
  1448. <parameters id="itop-portal" _delta="define">
  1449. <lazy_loading_threshold>500</lazy_loading_threshold><!-- Will be placed in the conf/<env>/config-itop.php file under the itop-portal module's settings -->
  1450. </parameters>
  1451. </module_parameters>
  1452. </itop_design>