123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- <?xml version="1.0" encoding="UTF-8"?>
- <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <classes>
- <class id="Problem">
- <properties>
- <comment><![CDATA[/**
- * Persistent classes for a CMDB
- *
- * @author Erwan Taloc <erwan.taloc@combodo.com>
- * @author Romain Quetiez <romain.quetiez@combodo.com>
- * @author Denis Flaven <denis.flaven@combodo.com>
- * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
- */]]></comment>
- <category>bizmodel,searchable,problemmgmt</category>
- <parent>Ticket</parent>
- <abstract>false</abstract>
- <key_type>autoincrement</key_type>
- <db_table>ticket_problem</db_table>
- <db_key_field>id</db_key_field>
- <db_final_class_field></db_final_class_field>
- <naming>
- <format>%1$s</format>
- <attributes>
- <attribute id="ref"/>
- </attributes>
- </naming>
- <display_template></display_template>
- <icon>images/problem.png</icon>
- <reconciliation>
- <attributes>
- <attribute id="ref"/>
- </attributes>
- </reconciliation>
- <order>
- <columns>
- <column id="ref" order="0">
- <ascending>false</ascending>
- </column>
- </columns>
- </order>
- </properties>
- <fields>
- <field id="status" xsi:type="AttributeEnum">
- <values>
- <value>new</value>
- <value>assigned</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="org_id" xsi:type="AttributeExternalKey">
- <sql>org_id</sql>
- <target_class>Organization</target_class>
- <is_null_allowed>false</is_null_allowed>
- <on_target_delete>DEL_AUTO</on_target_delete>
- <jointype></jointype>
- </field>
- <field id="org_name" xsi:type="AttributeExternalField">
- <extkey_attcode>org_id</extkey_attcode>
- <target_attcode>name</target_attcode>
- </field>
- <field id="service_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Service AS s JOIN SLA AS sla ON sla.service_id=s.id JOIN lnkContractToSLA AS ln ON ln.sla_id=sla.id JOIN CustomerContract AS cc ON ln.contract_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>false</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- <jointype></jointype>
- </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]]></filter>
- <dependencies>
- <attribute id="service_id"/>
- </dependencies>
- <sql>servicesubcategory_id</sql>
- <target_class>ServiceSubcategory</target_class>
- <is_null_allowed>false</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- <jointype></jointype>
- </field>
- <field id="servicesubcategory_name" xsi:type="AttributeExternalField">
- <extkey_attcode>servicesubcategory_id</extkey_attcode>
- <target_attcode>name</target_attcode>
- </field>
- <field id="product" xsi:type="AttributeString">
- <sql>product</sql>
- <default_value></default_value>
- <is_null_allowed>true</is_null_allowed>
- </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>
- </field>
- <field id="urgency" xsi:type="AttributeEnum">
- <values>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </values>
- <sql>urgency</sql>
- <default_value>1</default_value>
- <is_null_allowed>false</is_null_allowed>
- </field>
- <field id="priority" xsi:type="AttributeEnum">
- <values>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </values>
- <sql>priority</sql>
- <default_value>1</default_value>
- <is_null_allowed>false</is_null_allowed>
- </field>
- <field id="workgroup_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Team AS t JOIN CustomerContract AS cc ON cc.support_team_id=t.id JOIN lnkContractToSLA AS ln ON ln.contract_id=cc.id JOIN SLA AS sla ON ln.sla_id=sla.id WHERE sla.service_id = :this->service_id AND cc.org_id = :this->org_id]]></filter>
- <dependencies>
- <attribute id="org_id"/>
- <attribute id="service_id"/>
- </dependencies>
- <sql>workgroup_id</sql>
- <target_class>Team</target_class>
- <is_null_allowed>false</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- <jointype></jointype>
- </field>
- <field id="workgroup_name" xsi:type="AttributeExternalField">
- <extkey_attcode>workgroup_id</extkey_attcode>
- <target_attcode>name</target_attcode>
- </field>
- <field id="agent_id" xsi:type="AttributeExternalKey">
- <filter><![CDATA[SELECT Person AS p JOIN lnkTeamToContact AS l ON l.contact_id=p.id JOIN Team AS t ON l.team_id=t.id WHERE t.id = :this->workgroup_id]]></filter>
- <dependencies>
- <attribute id="workgroup_id"/>
- </dependencies>
- <sql>agent_id</sql>
- <target_class>Person</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- <jointype></jointype>
- </field>
- <field id="agent_name" xsi:type="AttributeExternalField">
- <extkey_attcode>agent_id</extkey_attcode>
- <target_attcode>name</target_attcode>
- </field>
- <field id="agent_email" xsi:type="AttributeExternalField">
- <extkey_attcode>agent_id</extkey_attcode>
- <target_attcode>email</target_attcode>
- </field>
- <field id="related_change_id" xsi:type="AttributeExternalKey">
- <sql>related_change_id</sql>
- <target_class>Change</target_class>
- <is_null_allowed>true</is_null_allowed>
- <on_target_delete>DEL_MANUAL</on_target_delete>
- <jointype></jointype>
- </field>
- <field id="related_change_ref" xsi:type="AttributeExternalField">
- <extkey_attcode>related_change_id</extkey_attcode>
- <target_attcode>ref</target_attcode>
- </field>
- <field id="close_date" xsi:type="AttributeDateTime">
- <sql>close_date</sql>
- <default_value></default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="last_update" xsi:type="AttributeDateTime">
- <sql>last_update</sql>
- <default_value></default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="assignment_date" xsi:type="AttributeDateTime">
- <sql>assignment_date</sql>
- <default_value></default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="resolution_date" xsi:type="AttributeDateTime">
- <sql>resolution_date</sql>
- <default_value></default_value>
- <is_null_allowed>true</is_null_allowed>
- </field>
- <field id="knownerrors_list" xsi:type="AttributeLinkedSet">
- <linked_class>KnownError</linked_class>
- <ext_key_to_me>problem_id</ext_key_to_me>
- <count_min>0</count_min>
- <count_max>0</count_max>
- </field>
- </fields>
- <lifecycle>
- <attribute>status</attribute>
- <stimuli>
- <stimulus id="ev_assign" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_reassign" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_resolve" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_close" xsi:type="StimulusUserAction"/>
- </stimuli>
- <states>
- <state id="new">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="description">
- <must_change/>
- </attribute>
- <attribute id="ticket_log">
- <hidden/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <must_change/>
- </attribute>
- <attribute id="service_id">
- <must_change/>
- </attribute>
- <attribute id="servicesubcategory_id">
- <must_change/>
- </attribute>
- <attribute id="product">
- <must_prompt/>
- </attribute>
- <attribute id="impact">
- <must_change/>
- </attribute>
- <attribute id="urgency">
- <must_change/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="workgroup_id">
- <must_change/>
- </attribute>
- <attribute id="agent_id">
- <hidden/>
- </attribute>
- <attribute id="agent_email">
- <hidden/>
- </attribute>
- <attribute id="related_change_id">
- <hidden/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <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="title">
- <read_only/>
- </attribute>
- <attribute id="description">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <read_only/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="workgroup_id">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="agent_id">
- <mandatory/>
- <must_prompt/>
- </attribute>
- <attribute id="agent_email">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_reassign</stimulus>
- <target>assigned</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_resolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="resolved">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="title">
- <read_only/>
- </attribute>
- <attribute id="description">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <read_only/>
- </attribute>
- <attribute id="service_id">
- <read_only/>
- </attribute>
- <attribute id="servicesubcategory_id">
- <read_only/>
- </attribute>
- <attribute id="product">
- <read_only/>
- </attribute>
- <attribute id="impact">
- <read_only/>
- </attribute>
- <attribute id="urgency">
- <read_only/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="workgroup_id">
- <read_only/>
- </attribute>
- <attribute id="agent_id">
- <read_only/>
- </attribute>
- <attribute id="agent_email">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <hidden/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_reassign</stimulus>
- <target>assigned</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_close</stimulus>
- <target>closed</target>
- <actions>
- <action>
- <verb>SetClosureDate</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="closed">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="title">
- <read_only/>
- </attribute>
- <attribute id="description">
- <read_only/>
- </attribute>
- <attribute id="ticket_log">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <read_only/>
- </attribute>
- <attribute id="service_id">
- <read_only/>
- </attribute>
- <attribute id="servicesubcategory_id">
- <read_only/>
- </attribute>
- <attribute id="product">
- <read_only/>
- </attribute>
- <attribute id="impact">
- <read_only/>
- </attribute>
- <attribute id="urgency">
- <read_only/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="workgroup_id">
- <read_only/>
- </attribute>
- <attribute id="agent_id">
- <read_only/>
- </attribute>
- <attribute id="agent_email">
- <read_only/>
- </attribute>
- <attribute id="close_date">
- <read_only/>
- </attribute>
- <attribute id="last_update">
- <read_only/>
- </attribute>
- <attribute id="assignment_date">
- <read_only/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </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="SetResolveDate">
- <static>false</static>
- <access>public</access>
- <type>LifecycleAction</type>
- <code><![CDATA[ public function SetResolveDate($sStimulusCode)
- {
- $this->Set('resolution_date', time());
- 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="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,
- ),
- // a group
- 2 => array(
- 1 => 1,
- 2 => 2,
- 3 => 3,
- ),
- // a departement!
- 3 => array(
- 1 => 2,
- 2 => 3,
- 3 => 3,
- ),
- );
- $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('P-%06d', $iKey);
- $this->Set('ref', $sName);
- }
- }]]></code>
- </method>
- </methods>
- <presentation>
- <details>
- <items>
- <item>document_list</item>
- <item>ci_list</item>
- <item>contact_list</item>
- <item>incident_list</item>
- <item id="col:col1">
- <items>
- <item id="fieldset:Ticket:baseinfo">
- <items>
- <item>ref</item>
- <item>title</item>
- <item>org_id</item>
- <item>status</item>
- <item>priority</item>
- <item>service_id</item>
- <item>servicesubcategory_id</item>
- <item>product</item>
- </items>
- </item>
- <item id="fieldset:Ticket:moreinfo">
- <items>
- <item>impact</item>
- <item>urgency</item>
- <item>description</item>
- </items>
- </item>
- </items>
- </item>
- <item id="col:col2">
- <items>
- <item id="fieldset:Ticket:date">
- <items>
- <item>start_date</item>
- <item>last_update</item>
- <item>assignment_date</item>
- <item>close_date</item>
- </items>
- </item>
- <item id="fieldset:Ticket:contact">
- <items>
- <item>workgroup_id</item>
- <item>agent_id</item>
- </items>
- </item>
- <item id="fieldset:Ticket:relation">
- <items>
- <item>related_change_id</item>
- </items>
- </item>
- </items>
- </item>
- </items>
- </details>
- <search>
- <items>
- <item>ref</item>
- <item>title</item>
- <item>org_id</item>
- <item>start_date</item>
- <item>status</item>
- <item>service_id</item>
- <item>servicesubcategory_id</item>
- <item>product</item>
- <item>impact</item>
- <item>urgency</item>
- <item>priority</item>
- <item>workgroup_id</item>
- <item>agent_id</item>
- <item>agent_email</item>
- <item>close_date</item>
- </items>
- </search>
- <list>
- <items>
- <item>title</item>
- <item>org_id</item>
- <item>start_date</item>
- <item>status</item>
- <item>service_id</item>
- <item>priority</item>
- </items>
- </list>
- </presentation>
- </class>
- </classes>
- <menus>
- <menu id="Problem:Overview" xsi:type="TemplateMenuNode">
- <rank>0</rank>
- <parent>ProblemManagement</parent>
- <template_file>overview.html</template_file>
- </menu>
- <menu id="NewProblem" xsi:type="NewObjectMenuNode">
- <rank>1</rank>
- <parent>ProblemManagement</parent>
- <class>Problem</class>
- </menu>
- <menu id="SearchProblems" xsi:type="SearchMenuNode">
- <rank>2</rank>
- <parent>ProblemManagement</parent>
- <class>Problem</class>
- </menu>
- <menu id="Problem:MyProblems" xsi:type="OQLMenuNode">
- <rank>1</rank>
- <parent>Problem:Shortcuts</parent>
- <oql><![CDATA[SELECT Problem WHERE agent_id = :current_contact_id AND status NOT IN ("closed", "resolved")]]></oql>
- <do_search></do_search>
- </menu>
- <menu id="Problem:OpenProblems" xsi:type="OQLMenuNode">
- <rank>2</rank>
- <parent>Problem:Shortcuts</parent>
- <oql><![CDATA[SELECT Problem WHERE status IN ("new", "assigned", "resolved")]]></oql>
- <do_search></do_search>
- </menu>
- </menus>
- </itop_design>
|