<?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>
          <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_prompt/>
              </attribute>
              <attribute id="start_date">
                <read_only/>
              </attribute>
              <attribute id="caller_id">
                <mandatory/>
              </attribute>
              <attribute id="org_id">
                <must_prompt/>
              </attribute>
              <attribute id="service_id">
                <must_prompt/>
              </attribute>
              <attribute id="servicesubcategory_id">
                <must_prompt/>
              </attribute>
              <attribute id="product">
                <must_prompt/>
              </attribute>
              <attribute id="impact">
                <must_prompt/>
              </attribute>
              <attribute id="urgency">
                <must_prompt/>
              </attribute>
              <attribute id="priority">
                <read_only/>
              </attribute>
              <attribute id="workgroup_id">
                <must_prompt/>
              </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 id="ev_assign">
                <stimulus>ev_assign</stimulus>
                <target>assigned</target>
                <actions>
                  <action>
                    <verb>SetAssignedDate</verb>
                  </action>
                </actions>
              </transition>
              <transition id="ev_timeout">
                <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 id="ev_assign">
                <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 id="ev_reassign">
                <stimulus>ev_reassign</stimulus>
                <target>assigned</target>
                <actions/>
              </transition>
              <transition id="ev_timeout">
                <stimulus>ev_timeout</stimulus>
                <target>escalated_ttr</target>
                <actions/>
              </transition>
              <transition id="ev_resolve">
                <stimulus>ev_resolve</stimulus>
                <target>resolved</target>
                <actions>
                  <action>
                    <verb>SetResolveDate</verb>
                  </action>
                  <action>
                    <verb>SetClosureDeadline</verb>
                  </action>
                </actions>
              </transition>
              <transition id="ev_freeze">
                <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 id="ev_reassign">
                <stimulus>ev_reassign</stimulus>
                <target>escalated_ttr</target>
                <actions/>
              </transition>
              <transition id="ev_resolve">
                <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 id="ev_timeout">
                <stimulus>ev_timeout</stimulus>
                <target>escalated_ttr</target>
                <actions/>
              </transition>
              <transition id="ev_assign">
                <stimulus>ev_assign</stimulus>
                <target>assigned</target>
                <actions/>
              </transition>
              <transition id="ev_resolve">
                <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 id="ev_reassign">
                <stimulus>ev_reassign</stimulus>
                <target>assigned</target>
                <actions/>
              </transition>
              <transition id="ev_close">
                <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>
