123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194 |
- <?xml version="1.0" encoding="UTF-8"?>
- <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
- <constants>
- <constant id="PORTAL_POWER_USER_PROFILE" xsi:type="string" _delta="define"><![CDATA[Portal power user]]></constant>
- <constant id="PORTAL_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![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 = :org_id]]></constant>
- <constant id="PORTAL_SERVICE_SUBCATEGORY_QUERY" xsi:type="string" _delta="define"><![CDATA[SELECT ServiceSubcategory WHERE service_id = :svc_id]]></constant>
- <constant id="PORTAL_VALIDATE_SERVICECATEGORY_QUERY" xsi:type="string" _delta="define"><![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 = :org_id AND s.id = :id]]></constant>
- <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]]></constant>
- <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,urgency,workgroup_id,moreinfo,caller_id,start_date,end_date,duration,impact_duration]]></constant>
- <constant id="PORTAL_SET_TYPE_FROM" xsi:type="string" _delta="define"><![CDATA[]]></constant>
- <constant id="PORTAL_TYPE_TO_CLASS" xsi:type="string" _delta="define"><![CDATA[]]></constant>
- <constant id="PORTAL_USERREQUEST_PUBLIC_LOG" xsi:type="string" _delta="define"><![CDATA[ticket_log]]></constant>
- <constant id="PORTAL_USERREQUEST_USER_COMMENT" xsi:type="string" _delta="define"><![CDATA[user_commment]]></constant>
- <constant id="PORTAL_USERREQUEST_FORM_ATTRIBUTES" xsi:type="string" _delta="define"><![CDATA[title,description,impact,urgency,workgroup_id,ticket_log]]></constant>
- <constant id="PORTAL_USERREQUEST_TYPE" xsi:type="string" _delta="define"><![CDATA[]]></constant>
- <constant id="PORTAL_USERREQUEST_LIST_ZLIST" xsi:type="string" _delta="define"><![CDATA[finalclass,title,start_date,status,servicesubcategory_id,priority,caller_id]]></constant>
- <constant id="PORTAL_TICKETS_SEARCH_CRITERIA" xsi:type="string" _delta="define"><![CDATA[ref,start_date,close_date,service_id,caller_id]]></constant>
- <constant id="PORTAL_USERREQUEST_CLOSED_ZLIST" xsi:type="string" _delta="define"><![CDATA[title,start_date,close_date,servicesubcategory_id]]></constant>
- <constant id="PORTAL_USERREQUEST_DETAILS_ZLIST" xsi:type="string" _delta="define"><![CDATA[{"col:left":["ref","caller_id","servicesubcategory_id","title","description","solution"],"col:right":["status","priority","start_date","resolution_date","last_update","agent_id"]}]]></constant>
- <constant id="PORTAL_TICKETS_SEARCH_FILTER_service_id" xsi:type="string" _delta="define"><![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 = :org_id]]></constant>
- <constant id="PORTAL_TICKETS_SEARCH_FILTER_caller_id" xsi:type="string" _delta="define"><![CDATA[SELECT Person WHERE org_id = :org_id]]></constant>
- </constants>
- <classes>
- <class id="UserRequest" _delta="define">
- <parent>ResponseTicket</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" order="0">
- <ascending>false</ascending>
- </column>
- </columns>
- </order>
- </properties>
- <fields>
- <field id="request_type" xsi:type="AttributeEnum">
- <values>
- <value>service request</value>
- <value>issue</value>
- <value>information</value>
- </values>
- <sql>request_type</sql>
- <default_value>service request</default_value>
- <is_null_allowed>false</is_null_allowed>
- </field>
- <field id="freeze_reason" xsi:type="AttributeString">
- <sql>freeze_reason</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_timeout" xsi:type="StimulusInternal"/>
- <stimulus id="ev_resolve" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_close" xsi:type="StimulusUserAction"/>
- <stimulus id="ev_freeze" xsi:type="StimulusUserAction"/>
- </stimuli>
- <states>
- <state id="new">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="description">
- <must_change/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </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_email">
- <hidden/>
- </attribute>
- <attribute id="related_problem_id">
- <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>
- <attribute id="tto_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="closure_deadline">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_commment">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <mandatory/>
- </attribute>
- <attribute id="freeze_reason">
- <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>
- </transitions>
- </state>
- <state id="escalated_tto">
- <flags>
- <attribute id="ref">
- <read_only/>
- </attribute>
- <attribute id="start_date">
- <read_only/>
- </attribute>
- <attribute id="caller_id">
- <mandatory/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="agent_email">
- <hidden/>
- </attribute>
- <attribute id="related_problem_id">
- <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>
- <attribute id="tto_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="closure_deadline">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_commment">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <mandatory/>
- </attribute>
- <attribute id="freeze_reason">
- <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="caller_id">
- <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">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="closure_deadline">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_commment">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <mandatory/>
- </attribute>
- <attribute id="freeze_reason">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_reassign</stimulus>
- <target>assigned</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_timeout</stimulus>
- <target>escalated_ttr</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_resolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>SetClosureDeadline</verb>
- </action>
- </actions>
- </transition>
- <transition>
- <stimulus>ev_freeze</stimulus>
- <target>frozen</target>
- <actions/>
- </transition>
- </transitions>
- </state>
- <state id="escalated_ttr">
- <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="caller_id">
- <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">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="closure_deadline">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_commment">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <mandatory/>
- </attribute>
- <attribute id="freeze_reason">
- <hidden/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_reassign</stimulus>
- <target>escalated_ttr</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_resolve</stimulus>
- <target>resolved</target>
- <actions>
- <action>
- <verb>SetResolveDate</verb>
- </action>
- <action>
- <verb>SetClosureDeadline</verb>
- </action>
- </actions>
- </transition>
- </transitions>
- </state>
- <state id="frozen">
- <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="caller_id">
- <read_only/>
- </attribute>
- <attribute id="org_id">
- <read_only/>
- </attribute>
- <attribute id="priority">
- <read_only/>
- </attribute>
- <attribute id="workgroup_id">
- <mandatory/>
- </attribute>
- <attribute id="agent_id">
- <mandatory/>
- </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">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <read_only/>
- </attribute>
- <attribute id="closure_deadline">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <hidden/>
- </attribute>
- <attribute id="solution">
- <hidden/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_commment">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <mandatory/>
- </attribute>
- <attribute id="freeze_reason">
- <mandatory/>
- <must_prompt/>
- </attribute>
- </flags>
- <transitions>
- <transition>
- <stimulus>ev_timeout</stimulus>
- <target>escalated_ttr</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_assign</stimulus>
- <target>assigned</target>
- <actions/>
- </transition>
- <transition>
- <stimulus>ev_resolve</stimulus>
- <target>resolved</target>
- <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="caller_id">
- <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">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="closure_deadline">
- <read_only/>
- </attribute>
- <attribute id="resolution_code">
- <must_prompt/>
- </attribute>
- <attribute id="solution">
- <must_prompt/>
- </attribute>
- <attribute id="user_satisfaction">
- <hidden/>
- </attribute>
- <attribute id="user_commment">
- <hidden/>
- </attribute>
- <attribute id="request_type">
- <mandatory/>
- </attribute>
- <attribute id="freeze_reason">
- <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="caller_id">
- <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">
- <hidden/>
- </attribute>
- <attribute id="resolution_date">
- <hidden/>
- </attribute>
- <attribute id="tto_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="ttr_escalation_deadline">
- <hidden/>
- </attribute>
- <attribute id="closure_deadline">
- <hidden/>
- </attribute>
- <attribute id="resolution_code">
- <read_only/>
- </attribute>
- <attribute id="solution">
- <read_only/>
- </attribute>
- <attribute id="user_satisfaction">
- <must_prompt/>
- </attribute>
- <attribute id="user_commment">
- <must_prompt/>
- </attribute>
- <attribute id="request_type">
- <read_only/>
- </attribute>
- <attribute id="freeze_reason">
- <hidden/>
- </attribute>
- </flags>
- <transitions/>
- </state>
- </states>
- </lifecycle>
- <methods>
- <method id="ComputeValues">
- <static>false</static>
- <access>public</access>
- <type>Overload-DBObject</type>
- <code><![CDATA[ public function ComputeValues()
- {
- $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="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':
- $sIcon = self::MakeIconFromName('user-request.png');
- $oEscalationDeadline = $this->Get('tto_escalation_deadline');
- if ($oEscalationDeadline != null)
- {
- // A SLA is running
- $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
- $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
- $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');
- $oEscalationDeadline = $this->Get('ttr_escalation_deadline');
- if ($oEscalationDeadline != null)
- {
- // A SLA is running
- $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
- $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
- $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 = utils::GetAbsoluteUrlModulesRoot().'itop-request-mgmt-1.0.0/images/'.$sIconName;
- if ($bImgTag)
- {
- $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
- }
- else
- {
- $sIcon = $sPath;
- }
- }
- return $sIcon;
- }]]></code>
- </method>
- </methods>
- <presentation>
- <details>
- <items>
- <item id="document_list">
- <rank>10</rank>
- </item>
- <item id="ci_list">
- <rank>20</rank>
- </item>
- <item id="contact_list">
- <rank>30</rank>
- </item>
- <item id="incident_list">
- <rank>40</rank>
- </item>
- <item id="col:col1">
- <rank>50</rank>
- <items>
- <item id="fieldset:Ticket:baseinfo">
- <rank>10</rank>
- <items>
- <item id="ref">
- <rank>10</rank>
- </item>
- <item id="title">
- <rank>20</rank>
- </item>
- <item id="org_id">
- <rank>30</rank>
- </item>
- <item id="status">
- <rank>40</rank>
- </item>
- <item id="priority">
- <rank>50</rank>
- </item>
- <item id="request_type">
- <rank>60</rank>
- </item>
- <item id="service_id">
- <rank>70</rank>
- </item>
- <item id="servicesubcategory_id">
- <rank>80</rank>
- </item>
- <item id="product">
- <rank>90</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:moreinfo">
- <rank>20</rank>
- <items>
- <item id="impact">
- <rank>10</rank>
- </item>
- <item id="urgency">
- <rank>20</rank>
- </item>
- <item id="description">
- <rank>30</rank>
- </item>
- <item id="resolution_code">
- <rank>40</rank>
- </item>
- <item id="solution">
- <rank>50</rank>
- </item>
- <item id="user_satisfaction">
- <rank>60</rank>
- </item>
- <item id="user_commment">
- <rank>70</rank>
- </item>
- <item id="freeze_reason">
- <rank>80</rank>
- </item>
- </items>
- </item>
- </items>
- </item>
- <item id="col:col2">
- <rank>60</rank>
- <items>
- <item id="fieldset:Ticket:date">
- <rank>10</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="close_date">
- <rank>60</rank>
- </item>
- <item id="closure_deadline">
- <rank>70</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:contact">
- <rank>20</rank>
- <items>
- <item id="caller_id">
- <rank>10</rank>
- </item>
- <item id="workgroup_id">
- <rank>20</rank>
- </item>
- <item id="agent_id">
- <rank>30</rank>
- </item>
- </items>
- </item>
- <item id="fieldset:Ticket:relation">
- <rank>30</rank>
- <items>
- <item id="related_problem_id">
- <rank>10</rank>
- </item>
- <item id="related_change_id">
- <rank>20</rank>
- </item>
- </items>
- </item>
- </items>
- </item>
- </items>
- </details>
- <search>
- <items>
- <item id="ref">
- <rank>10</rank>
- </item>
- <item id="title">
- <rank>20</rank>
- </item>
- <item id="org_id">
- <rank>30</rank>
- </item>
- <item id="request_type">
- <rank>40</rank>
- </item>
- <item id="start_date">
- <rank>50</rank>
- </item>
- <item id="status">
- <rank>60</rank>
- </item>
- <item id="caller_id">
- <rank>70</rank>
- </item>
- <item id="service_id">
- <rank>80</rank>
- </item>
- <item id="servicesubcategory_id">
- <rank>90</rank>
- </item>
- <item id="product">
- <rank>100</rank>
- </item>
- <item id="impact">
- <rank>110</rank>
- </item>
- <item id="urgency">
- <rank>120</rank>
- </item>
- <item id="priority">
- <rank>130</rank>
- </item>
- <item id="workgroup_id">
- <rank>140</rank>
- </item>
- <item id="agent_id">
- <rank>150</rank>
- </item>
- <item id="agent_email">
- <rank>160</rank>
- </item>
- <item id="close_date">
- <rank>170</rank>
- </item>
- <item id="resolution_code">
- <rank>180</rank>
- </item>
- <item id="solution">
- <rank>190</rank>
- </item>
- <item id="user_satisfaction">
- <rank>200</rank>
- </item>
- <item id="user_commment">
- <rank>210</rank>
- </item>
- </items>
- </search>
- <list>
- <items>
- <item id="title">
- <rank>10</rank>
- </item>
- <item id="org_id">
- <rank>20</rank>
- </item>
- <item id="start_date">
- <rank>30</rank>
- </item>
- <item id="status">
- <rank>40</rank>
- </item>
- <item id="service_id">
- <rank>50</rank>
- </item>
- <item id="priority">
- <rank>60</rank>
- </item>
- <item id="workgroup_id">
- <rank>70</rank>
- </item>
- <item id="agent_id">
- <rank>80</rank>
- </item>
- </items>
- </list>
- </presentation>
- </class>
- </classes>
- <menus>
- <menu id="RequestManagement" xsi:type="MenuGroup" _delta="define">
- <rank>30</rank>
- </menu>
- <menu id="UserRequest:Overview" xsi:type="DashboardMenuNode" _delta="define">
- <rank>0</rank>
- <parent>RequestManagement</parent>
- <definition>
- <title>UI:RequestMgmtMenuOverview:Title</title>
- <layout>DashboardLayoutTwoCols</layout>
- <cells>
- <cell id="0">
- <rank>0</rank>
- <dashlets>
- <dashlet id="1" xsi:type="DashletGroupByBars">
- <rank>0</rank>
- <title>UI-RequestManagementOverview-RequestByService</title>
- <query>SELECT UserRequest</query>
- <group_by>service_id</group_by>
- <style>bars</style>
- </dashlet>
- </dashlets>
- </cell>
- <cell id="1">
- <rank>1</rank>
- <dashlets>
- <dashlet id="2" xsi:type="DashletGroupByPie">
- <rank>0</rank>
- <title>UI-RequestManagementOverview-RequestByPriority</title>
- <query>SELECT UserRequest</query>
- <group_by>priority</group_by>
- <style>pie</style>
- </dashlet>
- </dashlets>
- </cell>
- <cell id="2">
- <rank>2</rank>
- <dashlets>
- <dashlet id="3" xsi:type="DashletObjectList">
- <rank>0</rank>
- <title>UI-RequestManagementOverview-RequestUnassigned</title>
- <query>SELECT UserRequest WHERE status IN ("new", "escalated_tto")</query>
- </dashlet>
- </dashlets>
- </cell>
- </cells>
- </definition>
- </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>1</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>2</rank>
- <parent>UserRequest:Shortcuts</parent>
- <oql><![CDATA[SELECT UserRequest WHERE status IN ("escalated_tto", "escalated_ttr")]]></oql>
- <do_search/>
- <auto_reload>fast</auto_reload>
- </menu>
- <menu id="UserRequest:OpenRequests" xsi:type="OQLMenuNode" _delta="define">
- <rank>3</rank>
- <parent>UserRequest:Shortcuts</parent>
- <oql><![CDATA[SELECT UserRequest WHERE status IN ("new", "assigned", "escalated_tto", "escalated_ttr", "frozen", "resolved")]]></oql>
- <do_search/>
- <auto_reload>fast</auto_reload>
- </menu>
- </menus>
- </itop_design>
|