1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353 |
- <?xml version="1.0" encoding="UTF-8"?>
- <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
- <classes>
- <class id="UserRequest" _delta="define">
- <parent>Ticket</parent>
- <properties>
- <comment><![CDATA[/**
- * Persistent classes for a CMDB
- *
- * @copyright Copyright (C) 2010-2012 Combodo SARL
- * @license http://opensource.org/licenses/AGPL-3.0
- */]]></comment>
- <category>bizmodel,searchable,requestmgmt</category>
- <abstract>false</abstract>
- <key_type>autoincrement</key_type>
- <db_table>ticket_request</db_table>
- <db_key_field>id</db_key_field>
- <db_final_class_field/>
- <naming>
- <format>%1$s</format>
- <attributes>
- <attribute id="ref"/>
- </attributes>
- </naming>
- <display_template/>
- <icon>images/user-request.png</icon>
- <reconciliation>
- <attributes>
- <attribute id="ref"/>
- </attributes>
- </reconciliation>
- <order>
- <columns>
- <column id="ref" ascending="false"/>
- </columns>
- </order>
- </properties>
- <fields>
- <field id="status" xsi:type="AttributeEnum">
- <values>
- <value>new</value>
- <value>waiting_for_approval</value>
- <value>approved</value>
- <value>rejected</value>
- <value>assigned</value>
- <value>pending</value>
- <value>escalated_tto</value>
- <value>escalated_ttr</value>
- <value>resolved</value>
- <value>closed</value>
- </values>
- <sql>status</sql>
- <default_value>new</default_value>
- <is_null_allowed>false</is_null_allowed>
- </field>
- <field id="request_type" xsi:type="AttributeEnum">
- <values>
- <value>service_request</value>
- </values>
- <sql>request_type</sql>
- <default_value>service_request</default_value>
- <is_null_allowed>true</is_null_allowed>
- <display_style>list</display_style>
- </field>
- <field id="impact" xsi:type="AttributeEnum">
- <values>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </values>
- <sql>impact</sql>
- <default_value>1</default_value>
- <is_null_allowed>false</is_null_allowed>
- <display_style>list</display_style>
- </field>
- <field id="priority" xsi:type="AttributeEnum">
- <values>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- <value>4</value>
- </values>
- <sql>priority</sql>
- <default_value>4</default_value>
- <is_null_allowed>false</is_null_allowed>
- </field>
- <field id="urgency" xsi:type="AttributeEnum">
- <values>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- <value>4</value>
- </values>
- <sql>urgency</sql>
- <default_value>4</default_value>
- <is_null_allowed>false</is_null_allowed>
- </field>
- <field id="origin" xsi:type="AttributeEnum">
- <values>
- <value>mail</value>
- <value>phone</value>
- <value>portal</value>
- </values>
- <sql>origin</sql>
- <default_value>phone</default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="approver_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Person WHERE org_id= :this->org_id]]></filter>
- <dependencies>
- <attribute id="org_id"/>
- </dependencies>
- <sql>approver_id</sql>
- <target_class>Person</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- </field>
- <field id="approver_email" xsi:type="AttributeExternalField">
- <extkey_attcode>approver_id</extkey_attcode>
- <target_attcode>email</target_attcode>
- </field>
- <field id="service_id" xsi:type="AttributeExternalKey">
- <filter><![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 = :this->org_id]]></filter>
- <dependencies>
- <attribute id="org_id"/>
- </dependencies>
- <sql>service_id</sql>
- <target_class>Service</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- </field>
- <field id="service_name" xsi:type="AttributeExternalField">
- <extkey_attcode>service_id</extkey_attcode>
- <target_attcode>name</target_attcode>
- </field>
- <field id="servicesubcategory_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT ServiceSubcategory WHERE service_id = :this->service_id AND request_type = :this->request_type]]></filter>
- <dependencies>
- <attribute id="service_id"/>
- <attribute id="request_type"/>
- </dependencies>
- <sql>servicesubcategory_id</sql>
- <target_class>ServiceSubcategory</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- <jointype/>
- </field>
- <field id="servicesubcategory_name" xsi:type="AttributeExternalField">
- <extkey_attcode>servicesubcategory_id</extkey_attcode>
- <target_attcode>name</target_attcode>
- </field>
- <field id="escalation_flag" xsi:type="AttributeEnum">
- <values>
- <value>yes</value>
- <value>no</value>
- </values>
- <sql>escalation_flag</sql>
- <default_value>no</default_value>
- <is_null_allowed>true</is_null_allowed>
- <display_style>list</display_style>
- </field>
- <field id="escalation_reason" xsi:type="AttributeString">
- <sql>escalation_reason</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="assignment_date" xsi:type="AttributeDateTime">
- <sql>assignment_date</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="resolution_date" xsi:type="AttributeDateTime">
- <sql>resolution_date</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="last_pending_date" xsi:type="AttributeDateTime">
- <sql>last_pending_date</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="cumulatedpending" xsi:type="AttributeStopWatch">
- <states>
- <state id="pending"/>
- </states>
- <working_time/>
- <thresholds/>
- <goal/>
- </field>
- <field id="tto" xsi:type="AttributeStopWatch">
- <states>
- <state id="new"/>
- <state id="escalated_tto"/>
- </states>
- <working_time/>
- <goal>ResponseTicketTTO</goal>
- <thresholds>
- <threshold>
- <percent>75</percent>
- <actions>
- </actions>
- </threshold>
- <threshold>
- <percent>100</percent>
- <actions>
- <action>
- <verb>ApplyStimulus</verb>
- <params>
- <param>ev_timeout</param>
- </params>
- </action>
- </actions>
- </threshold>
- </thresholds>
- </field>
- <field id="ttr" xsi:type="AttributeStopWatch">
- <states>
- <state id="new"/>
- <state id="escalated_tto"/>
- <state id="assigned"/>
- <state id="approved"/>
- <state id="escalated_ttr"/>
- </states>
- <working_time/>
- <goal>ResponseTicketTTR</goal>
- <thresholds>
- <threshold>
- <percent>75</percent>
- <actions>
- </actions>
- </threshold>
- <threshold>
- <percent>100</percent>
- <actions>
- <action>
- <verb>ApplyStimulus</verb>
- <params>
- <param>ev_timeout</param>
- </params>
- </action>
- </actions>
- </threshold>
- </thresholds>
- </field>
- <field id="tto_escalation_deadline" xsi:type="AttributeSubItem">
- <target_attcode>tto</target_attcode>
- <item_code>100_deadline</item_code>
- </field>
- <field id="sla_tto_passed" xsi:type="AttributeSubItem">
- <target_attcode>tto</target_attcode>
- <item_code>100_passed</item_code>
- </field>
- <field id="sla_tto_over" xsi:type="AttributeSubItem">
- <target_attcode>tto</target_attcode>
- <item_code>100_overrun</item_code>
- </field>
- <field id="ttr_escalation_deadline" xsi:type="AttributeSubItem">
- <target_attcode>ttr</target_attcode>
- <item_code>100_deadline</item_code>
- </field>
- <field id="sla_ttr_passed" xsi:type="AttributeSubItem">
- <target_attcode>ttr</target_attcode>
- <item_code>100_passed</item_code>
- </field>
- <field id="sla_ttr_over" xsi:type="AttributeSubItem">
- <target_attcode>ttr</target_attcode>
- <item_code>100_overrun</item_code>
- </field>
- <field id="time_spent" xsi:type="AttributeDuration">
- <sql>time_spent</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="resolution_code" xsi:type="AttributeEnum">
- <values>
- <value>assistance</value>
- <value>other</value>
- <value>software patch</value>
- <value>training</value>
- <value>hardware repair</value>
- <value>system update</value>
- <value>bug fixed</value>
- </values>
- <sql>resolution_code</sql>
- <default_value>assistance</default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="solution" xsi:type="AttributeText">
- <sql>solution</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="pending_reason" xsi:type="AttributeText">
- <sql>pending_reason</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="parent_request_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT UserRequest WHERE id != :this->id AND status NOT IN ('rejected','resolved','closed')]]></filter>
- <dependencies>
- <attribute id="service_id"/>
- </dependencies>
- <sql>parent_request_id</sql>
- <target_class>UserRequest</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- </field>
- <field id="parent_request_ref" xsi:type="AttributeExternalField">
- <extkey_attcode>parent_request_id</extkey_attcode>
- <target_attcode>ref</target_attcode>
- </field>
- <field id="parent_incident_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Incident WHERE status != "closed"]]></filter>
- <sql>parent_incident_id</sql>
- <target_class>Incident</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- </field>
- <field id="parent_incident_ref" xsi:type="AttributeExternalField">
- <extkey_attcode>parent_incident_id</extkey_attcode>
- <target_attcode>ref</target_attcode>
- </field>
- <field id="parent_problem_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Problem WHERE status != "closed"]]></filter>
- <sql>parent_problem_id</sql>
- <target_class>Problem</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- </field>
- <field id="parent_problem_ref" xsi:type="AttributeExternalField">
- <extkey_attcode>parent_problem_id</extkey_attcode>
- <target_attcode>ref</target_attcode>
- </field>
- <field id="parent_change_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Change WHERE status != "closed"]]></filter>
- <sql>parent_change_id</sql>
- <target_class>Change</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- </field>
- <field id="parent_change_ref" xsi:type="AttributeExternalField">
- <extkey_attcode>parent_change_id</extkey_attcode>
- <target_attcode>ref</target_attcode>
- </field>
- <field id="related_request_list" xsi:type="AttributeLinkedSet">
- <linked_class>UserRequest</linked_class>
- <ext_key_to_me>parent_request_id</ext_key_to_me>
- <edit_mode>none</edit_mode>
- <count_min>0</count_min>
- <count_max>0</count_max>
- </field>
- <field id="public_log" xsi:type="AttributeCaseLog">
- <sql>public_log</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="user_satisfaction" xsi:type="AttributeEnum">
- <values>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- <value>4</value>
- </values>
- <sql>user_satisfaction</sql>
- <default_value>1</default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="user_comment" xsi:type="AttributeText">
- <sql>user_commment</sql>
- <default_value/>
- <is_null_allowed>true</is_null_allowed>
- </field>
- </fields>
- <lifecycle>
- <attribute>status</attribute>
- <stimuli>
- <stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_approve" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_reject" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_pending" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_timeout" xsi:type="StimulusInternal"/>
- <stimulus id="ev_autoresolve" xsi:type="StimulusInternal"/>
- <stimulus id="ev_autoclose" xsi:type="StimulusInternal"/>
- <stimulus id="ev_resolve" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_close" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_reopen" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_wait_for_approval" xsi:type="StimulusUserAction"/>
- </stimuli>
- <states>
- <state id="new">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </attribute>
- <attribute id="team_id">
- <hidden/>
- </attribute>
- <attribute id="agent_id">
- <hidden/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="approver_id">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="escalation_flag">
- <hidden/>
- </attribute>
- <attribute id="escalation_reason">
- <hidden/>
- </attribute>
- <attribute id="assignment_date">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_passed">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_over">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_assign</stimulus>
- <target>assigned</target>
- <actions>
- <action>
- <verb>SetAssignedDate</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_timeout</stimulus>
- <target>escalated_tto</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_wait_for_approval</stimulus>
- <target>waiting_for_approval</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_autoresolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="escalated_tto">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <hidden/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="approver_id">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="escalation_flag">
- <hidden/>
- </attribute>
- <attribute id="escalation_reason">
- <hidden/>
- </attribute>
- <attribute id="assignment_date">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_passed">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_over">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_assign</stimulus>
- <target>assigned</target>
- <actions>
- <action>
- <verb>SetAssignedDate</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="assigned">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="team_id">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="agent_id">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="approver_id">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_passed">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_over">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_pending</stimulus>
- <target>pending</target>
- <actions>
- <action>
- <verb>SetLastPendingDate</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_resolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_reassign</stimulus>
- <target>assigned</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_timeout</stimulus>
- <target>escalated_ttr</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_autoresolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="escalated_ttr">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="team_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <mandatory/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="approver_id">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_passed">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_over">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_pending</stimulus>
- <target>pending</target>
- <actions>
- <action>
- <verb>SetLastPendingDate</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_resolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_reassign</stimulus>
- <target>assigned</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_autoresolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="waiting_for_approval">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <hidden/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="approver_id">
- <must_prompt/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="escalation_flag">
- <hidden/>
- </attribute>
- <attribute id="escalation_reason">
- <hidden/>
- </attribute>
- <attribute id="assignment_date">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_passed">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_over">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_approve</stimulus>
- <target>approved</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_reject</stimulus>
- <target>rejected</target>
- <actions/>
- </transition>
- </transitions>
- </state>
- <state id="approved">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <hidden/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="approver_id">
- <read_only/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="escalation_flag">
- <hidden/>
- </attribute>
- <attribute id="escalation_reason">
- <hidden/>
- </attribute>
- <attribute id="assignment_date">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_passed">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_over">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_timeout</stimulus>
- <target>escalated_tto</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_assign</stimulus>
- <target>assigned</target>
- <actions>
- <action>
- <verb>SetAssignedDate</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_autoresolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="rejected">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <hidden/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="approver_id">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="escalation_flag">
- <hidden/>
- </attribute>
- <attribute id="escalation_reason">
- <hidden/>
- </attribute>
- <attribute id="assignment_date">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_passed">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_over">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_reopen</stimulus>
- <target>new</target>
- <actions/>
- </transition>
- </transitions>
- </state>
- <state id="pending">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <mandatory/>
- </attribute>
- <attribute id="team_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <mandatory/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="approver_id">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="last_pending_date">
- <read_only/>
- </attribute>
- <attribute id="time_spent">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="pending_reason">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_passed">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_over">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_assign</stimulus>
- <target>assigned</target>
- <actions>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_autoresolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="resolved">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <read_only/>
- </attribute>
- <attribute id="caller_id">
- <read_only/>
- </attribute>
- <attribute id="origin">
- <read_only/>
- </attribute>
- <attribute id="team_id">
- <read_only/>
- </attribute>
- <attribute id="agent_id">
- <read_only/>
- </attribute>
- <attribute id="impact">
- <read_only/>
- </attribute>
- <attribute id="urgency">
- <read_only/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="approver_id">
- <read_only/>
- </attribute>
- <attribute id="service_id">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="servicesubcategory_id">
- <must_prompt/>
- </attribute>
- <attribute id="escalation_flag">
- <read_only/>
- </attribute>
- <attribute id="escalation_reason">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <read_only/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <read_only/>
- </attribute>
- <attribute id="resolution_code">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="solution">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="pending_reason">
- <read_only/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_comment">
- <hidden/>
- </attribute>
- <attribute id="parent_request_id">
- <read_only/>
- </attribute>
- <attribute id="parent_change_id">
- <read_only/>
- </attribute>
- <attribute id="parent_problem_id">
- <read_only/>
- </attribute>
- <attribute id="title">
- <read_only/>
- </attribute>
- <attribute id="description">
- <read_only/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_passed">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_over">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <read_only/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <read_only/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_close</stimulus>
- <target>closed</target>
- <actions>
- <action>
- <verb>SetClosureDate</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_reopen</stimulus>
- <target>assigned</target>
- <actions>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_autoresolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>resolveChilds</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="closed">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <read_only/>
- </attribute>
- <attribute id="caller_id">
- <read_only/>
- </attribute>
- <attribute id="origin">
- <read_only/>
- </attribute>
- <attribute id="team_id">
- <read_only/>
- </attribute>
- <attribute id="agent_id">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="private_log">
- <read_only/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="impact">
- <read_only/>
- </attribute>
- <attribute id="urgency">
- <read_only/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="approver_id">
- <read_only/>
- </attribute>
- <attribute id="service_id">
- <read_only/>
- </attribute>
- <attribute id="servicesubcategory_id">
- <read_only/>
- </attribute>
- <attribute id="escalation_flag">
- <read_only/>
- </attribute>
- <attribute id="escalation_reason">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <read_only/>
- </attribute>
- <attribute id="last_pending_date">
- <hidden/>
- </attribute>
- <attribute id="time_spent">
- <read_only/>
- </attribute>
- <attribute id="resolution_code">
- <read_only/>
- </attribute>
- <attribute id="solution">
- <read_only/>
- </attribute>
- <attribute id="pending_reason">
- <read_only/>
- </attribute>
- <attribute id="public_log">
- <read_only/>
- </attribute>
- <attribute id="user_satisfaction">
- <must_prompt/>
- </attribute>
- <attribute id="user_comment">
- <must_prompt/>
- </attribute>
- <attribute id="pending_reason">
- <read_only/>
- </attribute>
- <attribute id="parent_request_id">
- <read_only/>
- </attribute>
- <attribute id="parent_change_id">
- <read_only/>
- </attribute>
- <attribute id="parent_problem_id">
- <read_only/>
- </attribute>
- <attribute id="title">
- <read_only/>
- </attribute>
- <attribute id="description">
- <read_only/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_tto_passed">
- <read_only/>
- </attribute>
- <attribute id="sla_tto_over">
- <read_only/>
- </attribute>
- <attribute id="sla_ttr_passed">
- <read_only/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="sla_ttr_over">
- <read_only/>
- </attribute>
- </flags>
- <transitions/>
- </state>
- </states>
- </lifecycle>
- <methods>
- <method id="SetAssignedDate">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function SetAssignedDate($sStimulusCode)
- {
- $this->Set('assignment_date', time());
- return true;
- }]]></code>
- </method>
- <method id="SetLastPendingDate">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function SetLastPendingDate($sStimulusCode)
- {
- $this->Set('last_pending_date', time());
- return true;
- }]]></code>
- </method>
- <method id="SetResolveDate">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function SetResolveDate($sStimulusCode)
- {
- $this->Set('resolution_date', time());
- $iTimeSpent = time() - AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
- $this->Set('time_spent', $iTimeSpent);
- return true;
- }]]></code>
- </method>
- <method id="SetClosureDate">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function SetClosureDate($sStimulusCode)
- {
- $this->Set('close_date', time());
- return true;
- }]]></code>
- </method>
- <method id="SetApprover">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function SetApprover($sStimulusCode)
- {
- $this->Set('approver_id', UserRights::GetUserId());
- return true;
- }]]></code>
- </method>
- <method id="ComputePriority">
- <comment>/** Compute the priority of the ticket based on its impact and urgency
- * @return integer The priority of the ticket 1(high) .. 3(low)
- */</comment>
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function ComputePriority()
- {
- // priority[impact][urgency]
- $aPriorities = array(
- // single person
- 1 => array(
- 1 => 1,
- 2 => 1,
- 3 => 2,
- 4 => 4,
- ),
- // a group
- 2 => array(
- 1 => 1,
- 2 => 2,
- 3 => 3,
- 4 => 4,
- ),
- // a departement!
- 3 => array(
- 1 => 2,
- 2 => 3,
- 3 => 3,
- 4 => 4,
- ),
- );
- $iPriority = $aPriorities[(int)$this->Get('impact')][(int)$this->Get('urgency')];
- return $iPriority;
- }]]></code>
- </method>
- <method id="ComputeValues">
- <static>false</static>
- <access>public</access>
- <type>Overload-DBObject</type>
- <code><![CDATA[ public function ComputeValues()
- {
- // Compute the priority of the ticket
- $this->Set('priority', $this->ComputePriority());
- $sCurrRef = $this->Get('ref');
- if (strlen($sCurrRef) == 0)
- {
- $iKey = $this->GetKey();
- if ($iKey < 0)
- {
- // Object not yet in the Database
- $iKey = MetaModel::GetNextKey(get_class($this));
- }
- $sName = sprintf('R-%06d', $iKey);
- $this->Set('ref', $sName);
- }
- return parent::ComputeValues();
- }]]></code>
- </method>
- <method id="DisplayBareRelations">
- <static>false</static>
- <access>public</access>
- <type>Overload-cmdbAbstractObject</type>
- <code><![CDATA[ function DisplayBareRelations(WebPage $oPage, $bEditMode = false)
- {
- parent::DisplayBareRelations($oPage, $bEditMode);
- if (!$bEditMode)
- {
- if (MetaModel::IsValidClass('KnownError'))
- {
- //Search for known errors
- $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList'));
- $iTicketID = $this->GetKey();;
- $oKnownErrorSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT KnownError AS ke JOIN lnkErrorToFunctionalCI AS l1 ON l1.error_id=ke.id JOIN FunctionalCI AS ci ON l1.functionalci_id=ci.id JOIN lnkFunctionalCIToTicket AS l2 ON l2.functionalci_id=ci.id WHERE l2.ticket_id=$iTicketID"));
- $iNumberKE=$oKnownErrorSet->count();
- if ($iNumberKE > 0)
- {
- $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList')." ($iNumberKE)");
- }
- else
- {
- $oPage->SetCurrentTab(Dict::S('Class:UserRequest:KnownErrorList'));
- }
- self::DisplaySet($oPage, $oKnownErrorSet, array ('menu' => false));
- }
- }
- }]]></code>
- </method>
- <method id="GetIcon">
- <comment>/**
- * Get the icon representing this object
- * @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
- * @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
- */</comment>
- <static>false</static>
- <access>public</access>
- <type>Overload-DBObject</type>
- <code><![CDATA[ public function GetIcon($bImgTag = true)
- {
- $sStatus = $this->Get('status');
- switch($this->GetState())
- {
- case 'escalated_tto':
- case 'escalated_ttr':
- $sIcon = self::MakeIconFromName('user-request-escalated.png');
- break;
-
- case 'resolved':
- case 'closed':
- $sIcon = self::MakeIconFromName('user-request-closed.png');
- break;
- case 'new':
- case 'approved':
- $sIcon = self::MakeIconFromName('user-request.png');
- $iEscalationDeadline = $this->Get('tto_escalation_deadline');
- if ($iEscalationDeadline != null)
- {
- // A SLA is running
- $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
-
- $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
- if ($ratio <= 0)
- {
- $sIcon = self::MakeIconFromName('user-request-escalated.png');
- }
- else if ($ratio <= 0.25)
- {
- $sIcon = self::MakeIconFromName('user-request-deadline.png');
- }
- }
- break;
-
- case 'assigned':
- $sIcon = self::MakeIconFromName('user-request.png');
- $iEscalationDeadline = $this->Get('ttr_escalation_deadline');
- if ($iEscalationDeadline != null)
- {
- // A SLA is running
- $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
- $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
- if ($ratio <= 0)
- {
- $sIcon = self::MakeIconFromName('user-request-escalated.png');
- }
- else if ($ratio <= 0.25)
- {
- $sIcon = self::MakeIconFromName('user-request-deadline.png');
- }
- }
- break;
-
-
- default:
- $sIcon = MetaModel::GetClassIcon(get_class($this), $bImgTag);
- }
- return $sIcon;
- }]]></code>
- </method>
- <method id="MakeIconFromName">
- <static>true</static>
- <access>protected</access>
- <type>Overload-DBObject</type>
- <code><![CDATA[ protected static function MakeIconFromName($sIconName, $bImgTag = true)
- {
- $sIcon = '';
- if ($sIconName != '')
- {
- $sPath = '../env-'.utils::GetCurrentEnvironment().'/itop-request-mgmt-itil/images/'.$sIconName;
- if ($bImgTag)
- {
- $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
- }
- else
- {
- $sIcon = $sPath;
- }
- }
- return $sIcon;
- }]]></code>
- </method>
- <method id="GetHilightClass">
- <static>false</static>
- <access>public</access>
- <type>Overload-iDisplay</type>
- <code><![CDATA[ public function GetHilightClass()
- {
- $sHilightClass = '';
- switch($this->GetState())
- {
- case 'new':
- case 'approved':
- $iEscalationDeadline = $this->Get('tto_escalation_deadline');
- if ($iEscalationDeadline != null)
- {
- // A SLA is running
- $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
- $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
- if ($ratio <= 0)
- {
- $sHilightClass = HILIGHT_CLASS_CRITICAL;
- }
- else if ($ratio <= 0.25)
- {
- $sHilightClass = HILIGHT_CLASS_WARNING;
- }
- }
- break;
- case 'assigned':
- $iEscalationDeadline = $this->Get('ttr_escalation_deadline');
- if ($iEscalationDeadline != null)
- {
- // A SLA is running
- $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
- $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
- if ($ratio <= 0)
- {
- $sHilightClass = HILIGHT_CLASS_CRITICAL;
- }
- else if ($ratio <= 0.25)
- {
- $sHilightClass = HILIGHT_CLASS_WARNING;
- }
- }
- break;
-
- case 'escalated_tto':
- case 'escalated_ttr':
- $sHilightClass = HILIGHT_CLASS_CRITICAL;
- break;
- }
- return $sHilightClass;
- }]]></code>
- </method>
- <method id="resolveChilds">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function resolveChilds($sStimulusCode)
- {
-
- $oMyChange = MetaModel::NewObject("CMDBChange");
- $oMyChange->Set("date", time());
- $sUserString = CMDBChange::GetCurrentUserName();
- $oMyChange->Set("userinfo", $sUserString."(automatic resolution)");
- $iChangeId = $oMyChange->DBInsert();
- $sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
- $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
- array(),
- array(
- 'ticket' => $this->GetKey(),
- )
- );
- while($oRequest = $oChildRequestSet->Fetch())
- {
- if ( $oRequest->Get('status') != 'resolved')
- {
- $oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id'));
- $oRequest->set('service_id',$this->Get('service_id'));
- $oRequest->set('team_id',$this->Get('team_id'));
- $oRequest->set('agent_id',$this->Get('agent_id'));
- $oRequest->set('resolution_code',$this->Get('resolution_code'));
- $oRequest->set('solution','Automatically resolved by request:[[UserRequest:'.$this->Get('ref').']]');
- $oRequest->ApplyStimulus('ev_autoresolve');
- $oRequest->DBUpdateTracked($oMyChange);
- }
- }
- return true;
- }]]></code>
- </method>
- <method id="UpdateChildRequestLog">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function UpdateChildRequestLog()
- {
- $sLogPublic = utils::ReadPostedParam('attr_public_log', null,false,'raw_data');
- if ( $sLogPublic != null)
- {
- $oMyChange = MetaModel::NewObject("CMDBChange");
- $oMyChange->Set("date", time());
- $sUserString = CMDBChange::GetCurrentUserName();
- $oMyChange->Set("userinfo", $sUserString."(automatic update)");
- $iChangeId = $oMyChange->DBInsert();
- $sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
- $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
- array(),
- array(
- 'ticket' => $this->GetKey(),
- )
- );
- while($oRequest = $oChildRequestSet->Fetch())
- {
- $oRequest->set('public_log',$sLogPublic);
- $oRequest->DBUpdateTracked($oMyChange);
- }
- }
- $sLogPrivate = utils::ReadPostedParam('attr_private_log', null,false,'raw_data');
- if ( $sLogPrivate != null)
- {
- $oMyChange = MetaModel::NewObject("CMDBChange");
- $oMyChange->Set("date", time());
- $sUserString = CMDBChange::GetCurrentUserName();
- $oMyChange->Set("userinfo", $sUserString."(automatic update)");
- $iChangeId = $oMyChange->DBInsert();
- $sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
- $oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
- array(),
- array(
- 'ticket' => $this->GetKey(),
- )
- );
- while($oRequest = $oChildRequestSet->Fetch())
- {
- $oRequest->set('private_log',$sLogPrivate);
- $oRequest->DBUpdateTracked($oMyChange);
- }
- }
- return true;
- }]]></code>
- </method>
- <method id="ComputeImpactedItems">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function ComputeImpactedItems()
- {
- $oToNotify = $this->Get('contacts_list');
- $oToImpact = $this->Get('functionalcis_list');
- $oImpactedInfras = DBObjectSet::FromLinkSet($this, 'functionalcis_list', 'functionalci_id');
- $aComputed = $oImpactedInfras->GetRelatedObjects('impacts', 10);
- if (isset($aComputed['FunctionalCI']) && is_array($aComputed['FunctionalCI']))
- {
- foreach($aComputed['FunctionalCI'] as $iKey => $oObject)
- {
- $oNewLink = new lnkFunctionalCIToTicket();
- $oNewLink->Set('functionalci_id', $iKey);
- $oNewLink->Set('impact', 'potentially impacted (automatically computed)');
- $oToImpact->AddObject($oNewLink);
- }
- }
- if (isset($aComputed['Contact']) && is_array($aComputed['Contact']))
- {
- foreach($aComputed['Contact'] as $iKey => $oObject)
- {
- $oNewLink = new lnkContactToTicket();
- $oNewLink->Set('contact_id', $iKey);
- $oNewLink->Set('role', 'contact automatically computed');
- $oToNotify->AddObject($oNewLink);
- }
- }
- parent::OnInsert();
- }]]></code>
- </method>
- <method id="OnInsert">
- <static>false</static>
- <access>protected</access>
- <type>Overload-DBObject</type>
- <code><![CDATA[ protected function OnInsert()
- {
- $this->ComputeImpactedItems();
- $this->Set('last_update', time());
- $this->Set('start_date', time());
- }]]></code>
- </method>
- <method id="OnUpdate">
- <static>false</static>
- <access>protected</access>
- <type>Overload-DBObject</type>
- <code><![CDATA[ protected function OnUpdate()
- {
- $this->Set('last_update', time());
- $this->UpdateChildRequestLog();
- }]]></code>
- </method>
- </methods>
- <presentation>
- <details>
- <items>
- <item id="functionalcis_list">
- <rank>10</rank>
- </item>
- <item id="contacts_list">
- <rank>20</rank>
- </item>
- <item id="related_request_list">
- <rank>30</rank>
- </item>
- <item id="workorders_list">
- <rank>40</rank>
- </item>
- <item id="col:col1">
- <rank>50</rank>
- <items>
- <item id="fieldset:Ticket:baseinfo">
- <rank>10</rank>
- <items>
- <item id="org_id">
- <rank>10</rank>
- </item>
- <item id="caller_id">
- <rank>20</rank>
- </item>
- <item id="status">
- <rank>30</rank>
- </item>
- <item id="origin">
- <rank>40</rank>
- </item>
- <item id="title">
- <rank>50</rank>
- </item>
- <item id="description">
- <rank>60</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:moreinfo">
- <rank>20</rank>
- <items>
- <item id="service_id">
- <rank>10</rank>
- </item>
- <item id="servicesubcategory_id">
- <rank>20</rank>
- </item>
- <item id="escalation_flag">
- <rank>30</rank>
- </item>
- <item id="escalation_reason">
- <rank>40</rank>
- </item>
- <item id="pending_reason">
- <rank>50</rank>
- </item>
- </items>
- </item>
- </items>
- </item>
- <item id="col:col2">
- <rank>60</rank>
- <items>
- <item id="fieldset:Ticket:Type">
- <rank>10</rank>
- <items>
- <item id="request_type">
- <rank>10</rank>
- </item>
- <item id="impact">
- <rank>20</rank>
- </item>
- <item id="urgency">
- <rank>30</rank>
- </item>
- <item id="priority">
- <rank>40</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:contact">
- <rank>20</rank>
- <items>
- <item id="team_id">
- <rank>10</rank>
- </item>
- <item id="agent_id">
- <rank>20</rank>
- </item>
- <item id="approver_id">
- <rank>30</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:date">
- <rank>30</rank>
- <items>
- <item id="start_date">
- <rank>10</rank>
- </item>
- <item id="last_update">
- <rank>20</rank>
- </item>
- <item id="assignment_date">
- <rank>30</rank>
- </item>
- <item id="tto_escalation_deadline">
- <rank>40</rank>
- </item>
- <item id="ttr_escalation_deadline">
- <rank>50</rank>
- </item>
- <item id="last_pending_date">
- <rank>60</rank>
- </item>
- <item id="resolution_date">
- <rank>70</rank>
- </item>
- <item id="close_date">
- <rank>80</rank>
- </item>
- </items>
- </item>
- </items>
- </item>
- <item id="col:col3">
- <rank>70</rank>
- <items>
- <item id="fieldset:Relations">
- <rank>10</rank>
- <items>
- <item id="parent_request_id">
- <rank>10</rank>
- </item>
- <item id="parent_incident_id">
- <rank>20</rank>
- </item>
- <item id="parent_problem_id">
- <rank>30</rank>
- </item>
- <item id="parent_change_id">
- <rank>40</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:resolution">
- <rank>20</rank>
- <items>
- <item id="resolution_code">
- <rank>10</rank>
- </item>
- <item id="solution">
- <rank>20</rank>
- </item>
- <item id="time_spent">
- <rank>30</rank>
- </item>
- <item id="user_satisfaction">
- <rank>40</rank>
- </item>
- <item id="user_comment">
- <rank>50</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:SLA">
- <rank>30</rank>
- <items>
- <item id="sla_tto_passed">
- <rank>10</rank>
- </item>
- <item id="sla_tto_over">
- <rank>20</rank>
- </item>
- <item id="sla_ttr_passed">
- <rank>30</rank>
- </item>
- <item id="sla_ttr_over">
- <rank>40</rank>
- </item>
- </items>
- </item>
- </items>
- </item>
- </items>
- </details>
- <search>
- <items>
- <item id="ref">
- <rank>10</rank>
- </item>
- <item id="org_id">
- <rank>20</rank>
- </item>
- <item id="title">
- <rank>30</rank>
- </item>
- <item id="description">
- <rank>40</rank>
- </item>
- <item id="start_date">
- <rank>50</rank>
- </item>
- <item id="end_date">
- <rank>60</rank>
- </item>
- <item id="resolution_date">
- <rank>70</rank>
- </item>
- <item id="close_date">
- <rank>80</rank>
- </item>
- <item id="status">
- <rank>90</rank>
- </item>
- <item id="caller_id">
- <rank>100</rank>
- </item>
- <item id="origin">
- <rank>110</rank>
- </item>
- <item id="request_type">
- <rank>120</rank>
- </item>
- <item id="impact">
- <rank>130</rank>
- </item>
- <item id="urgency">
- <rank>140</rank>
- </item>
- <item id="priority">
- <rank>150</rank>
- </item>
- <item id="service_id">
- <rank>160</rank>
- </item>
- <item id="servicesubcategory_id">
- <rank>170</rank>
- </item>
- <item id="team_id">
- <rank>180</rank>
- </item>
- <item id="agent_id">
- <rank>190</rank>
- </item>
- <item id="escalation_flag">
- <rank>200</rank>
- </item>
- <item id="resolution_code">
- <rank>210</rank>
- </item>
- <item id="user_satisfaction">
- <rank>220</rank>
- </item>
- <item id="sla_tto_passed">
- <rank>230</rank>
- </item>
- <item id="sla_ttr_passed">
- <rank>240</rank>
- </item>
- </items>
- </search>
- <list>
- <items>
- <item id="title">
- <rank>10</rank>
- </item>
- <item id="org_id">
- <rank>20</rank>
- </item>
- <item id="caller_id">
- <rank>30</rank>
- </item>
- <item id="start_date">
- <rank>40</rank>
- </item>
- <item id="status">
- <rank>50</rank>
- </item>
- <item id="agent_id">
- <rank>60</rank>
- </item>
- </items>
- </list>
- </presentation>
- </class>
- </classes>
- <menus>
- <menu id="WelcomeMenuPage" xsi:type="DashboardMenuNode" _delta="must_exist">
- <definition>
- <cells>
- <cell id="1" _delta="define">
- <rank>1</rank>
- <dashlets>
- <dashlet id="11" xsi:type="DashletHeaderDynamic">
- <rank>0</rank>
- <title>Menu:RequestManagement</title>
- <icon>itop-welcome-itil/images/user-request-deadline.png</icon>
- <subtitle>Open Requests</subtitle>
- <query>SELECT UserRequest WHERE status != "closed"</query>
- <group_by>status</group_by>
- <values>new,assigned,escalated_tto,escalated_ttr,resolved</values>
- </dashlet>
- <dashlet id="12" xsi:type="DashletObjectList">
- <rank>1</rank>
- <title>UI:WelcomeMenu:MyCalls</title>
- <query>SELECT UserRequest AS i WHERE i.agent_id = :current_contact_id AND status NOT IN ("closed", "resolved")</query>
- <menu>true</menu>
- </dashlet>
- </dashlets>
- </cell>
- </cells>
- </definition>
- </menu>
- <menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
- <rank>30</rank>
- <enable_stimulus/>
- </menu>
- <menu id="UserRequest:Overview" xsi:type="DashboardMenuNode" _delta="define">
- <rank>0</rank>
- <parent>RequestManagement</parent>
- <definition_file>overview.xml</definition_file>
- </menu>
- <menu id="NewUserRequest" xsi:type="NewObjectMenuNode" _delta="define">
- <rank>1</rank>
- <parent>RequestManagement</parent>
- <class>UserRequest</class>
- </menu>
- <menu id="SearchUserRequests" xsi:type="SearchMenuNode" _delta="define">
- <rank>2</rank>
- <parent>RequestManagement</parent>
- <class>UserRequest</class>
- </menu>
- <menu id="UserRequest:Shortcuts" xsi:type="TemplateMenuNode" _delta="define">
- <rank>3</rank>
- <parent>RequestManagement</parent>
- <template_file/>
- </menu>
- <menu id="UserRequest:MyRequests" xsi:type="OQLMenuNode" _delta="define">
- <rank>0</rank>
- <parent>UserRequest:Shortcuts</parent>
- <oql><![CDATA[SELECT UserRequest WHERE agent_id = :current_contact_id AND status NOT IN ("closed","resolved")]]></oql>
- <do_search/>
- <auto_reload>fast</auto_reload>
- </menu>
- <menu id="UserRequest:EscalatedRequests" xsi:type="OQLMenuNode" _delta="define">
- <rank>1</rank>
- <parent>UserRequest:Shortcuts</parent>
- <oql><![CDATA[SELECT UserRequest WHERE status IN ("escalated_tto", "escalated_ttr") OR escalation_flag="yes"]]></oql>
- <do_search/>
- <auto_reload>fast</auto_reload>
- </menu>
- <menu id="UserRequest:OpenRequests" xsi:type="OQLMenuNode" _delta="define">
- <rank>2</rank>
- <parent>UserRequest:Shortcuts</parent>
- <oql><![CDATA[SELECT UserRequest WHERE status NOT IN ("closed")]]></oql>
- <do_search>1</do_search>
- <auto_reload>fast</auto_reload>
- </menu>
- <menu id="UserRequest:MySupportRequests" xsi:type="OQLMenuNode" _delta="define">
- <rank>3</rank>
- <parent>UserRequest:Shortcuts</parent>
- <oql><![CDATA[SELECT UserRequest WHERE caller_id = :current_contact_id AND status NOT IN ("closed")]]></oql>
- <do_search/>
- <auto_reload>fast</auto_reload>
- </menu>
- </menus>
- </itop_design>
|