datamodel.itop-request-mgmt.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <classes><class name="UserRequest" category="bizmodel,searchable,requestmgmt" parent="ResponseTicket" abstract="false" key_type="autoincrement" db_table="ticket_request" db_key_field="id" db_final_class_field=""><properties><comment><![CDATA[/**
  3. * Persistent classes for a CMDB
  4. *
  5. * @author Erwan Taloc <erwan.taloc@combodo.com>
  6. * @author Romain Quetiez <romain.quetiez@combodo.com>
  7. * @author Denis Flaven <denis.flaven@combodo.com>
  8. * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
  9. */]]></comment><naming format="%1$s"><attributes><attribute name="ref"/></attributes></naming><display_template></display_template><icon>images/user-request.png</icon><reconciliation><attributes><attribute name="ref"/></attributes></reconciliation></properties><fields><field name="request_type" type="Enum" sql="request_type" default_value="service request" is_null_allowed="false"><values><value>service request</value><value>issue</value><value>information</value></values></field><field name="freeze_reason" type="String" sql="freeze_reason" default_value="" is_null_allowed="true"/></fields><lifecycle attribute="status"><stimuli><stimulus name="ev_assign" type="StimulusUserAction"/><stimulus name="ev_reassign" type="StimulusUserAction"/><stimulus name="ev_timeout" type="StimulusInternal"/><stimulus name="ev_resolve" type="StimulusUserAction"/><stimulus name="ev_close" type="StimulusUserAction"/><stimulus name="ev_freeze" type="StimulusUserAction"/></stimuli><states><state name="new"><flags><attribute name="ref" read_only="1"/><attribute name="title"/><attribute name="description" must_change="1"/><attribute name="ticket_log"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" mandatory="1"/><attribute name="caller_email"/><attribute name="org_id" must_change="1"/><attribute name="org_name"/><attribute name="service_id" must_change="1"/><attribute name="service_name"/><attribute name="servicesubcategory_id" must_change="1"/><attribute name="servicesubcategory_name"/><attribute name="product" must_prompt="1"/><attribute name="impact" must_change="1"/><attribute name="urgency" must_change="1"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id" must_change="1"/><attribute name="workgroup_name"/><attribute name="agent_id"/><attribute name="agent_name"/><attribute name="agent_email" hidden="1"/><attribute name="related_problem_id" hidden="1"/><attribute name="related_problem_ref"/><attribute name="related_change_id" hidden="1"/><attribute name="related_change_ref"/><attribute name="close_date" hidden="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" read_only="1"/><attribute name="ttr_escalation_deadline" hidden="1"/><attribute name="closure_deadline" hidden="1"/><attribute name="resolution_code" hidden="1"/><attribute name="solution" hidden="1"/><attribute name="user_satisfaction" hidden="1"/><attribute name="user_commment" hidden="1"/><attribute name="request_type" mandatory="1"/><attribute name="freeze_reason" hidden="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions><transition stimulus="ev_assign" target="assigned"><actions><action verb="SetAssignedDate"/></actions></transition><transition stimulus="ev_timeout" target="escalated_tto"><actions/></transition></transitions></state><state name="escalated_tto"><flags><attribute name="ref" read_only="1"/><attribute name="title"/><attribute name="description"/><attribute name="ticket_log"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" mandatory="1"/><attribute name="caller_email"/><attribute name="org_id"/><attribute name="org_name"/><attribute name="service_id"/><attribute name="service_name"/><attribute name="servicesubcategory_id"/><attribute name="servicesubcategory_name"/><attribute name="product"/><attribute name="impact"/><attribute name="urgency"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id"/><attribute name="workgroup_name"/><attribute name="agent_id"/><attribute name="agent_name"/><attribute name="agent_email" hidden="1"/><attribute name="related_problem_id" hidden="1"/><attribute name="related_problem_ref"/><attribute name="related_change_id" hidden="1"/><attribute name="related_change_ref"/><attribute name="close_date" hidden="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" read_only="1"/><attribute name="ttr_escalation_deadline" hidden="1"/><attribute name="closure_deadline" hidden="1"/><attribute name="resolution_code" hidden="1"/><attribute name="solution" hidden="1"/><attribute name="user_satisfaction" hidden="1"/><attribute name="user_commment" hidden="1"/><attribute name="request_type" mandatory="1"/><attribute name="freeze_reason" hidden="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions><transition stimulus="ev_assign" target="assigned"><actions><action verb="SetAssignedDate"/></actions></transition></transitions></state><state name="assigned"><flags><attribute name="ref" read_only="1"/><attribute name="title" read_only="1"/><attribute name="description" read_only="1"/><attribute name="ticket_log"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" read_only="1"/><attribute name="caller_email"/><attribute name="org_id" read_only="1"/><attribute name="org_name"/><attribute name="service_id"/><attribute name="service_name"/><attribute name="servicesubcategory_id"/><attribute name="servicesubcategory_name"/><attribute name="product"/><attribute name="impact"/><attribute name="urgency"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id" mandatory="1" must_prompt="1"/><attribute name="workgroup_name"/><attribute name="agent_id" mandatory="1" must_prompt="1"/><attribute name="agent_name"/><attribute name="agent_email" read_only="1"/><attribute name="related_problem_id"/><attribute name="related_problem_ref"/><attribute name="related_change_id"/><attribute name="related_change_ref"/><attribute name="close_date" hidden="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" hidden="1"/><attribute name="ttr_escalation_deadline" read_only="1"/><attribute name="closure_deadline" hidden="1"/><attribute name="resolution_code" hidden="1"/><attribute name="solution" hidden="1"/><attribute name="user_satisfaction" hidden="1"/><attribute name="user_commment" hidden="1"/><attribute name="request_type" mandatory="1"/><attribute name="freeze_reason" hidden="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions><transition stimulus="ev_reassign" target="assigned"><actions/></transition><transition stimulus="ev_timeout" target="escalated_ttr"><actions/></transition><transition stimulus="ev_resolve" target="resolved"><actions><action verb="SetResolveDate"/><action verb="SetClosureDeadline"/></actions></transition><transition stimulus="ev_freeze" target="frozen"><actions/></transition></transitions></state><state name="escalated_ttr"><flags><attribute name="ref" read_only="1"/><attribute name="title" read_only="1"/><attribute name="description" read_only="1"/><attribute name="ticket_log"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" read_only="1"/><attribute name="caller_email"/><attribute name="org_id" read_only="1"/><attribute name="org_name"/><attribute name="service_id"/><attribute name="service_name"/><attribute name="servicesubcategory_id"/><attribute name="servicesubcategory_name"/><attribute name="product"/><attribute name="impact"/><attribute name="urgency"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id" mandatory="1" must_prompt="1"/><attribute name="workgroup_name"/><attribute name="agent_id" mandatory="1" must_prompt="1"/><attribute name="agent_name"/><attribute name="agent_email" read_only="1"/><attribute name="related_problem_id"/><attribute name="related_problem_ref"/><attribute name="related_change_id"/><attribute name="related_change_ref"/><attribute name="close_date" hidden="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" hidden="1"/><attribute name="ttr_escalation_deadline" read_only="1"/><attribute name="closure_deadline" hidden="1"/><attribute name="resolution_code" hidden="1"/><attribute name="solution" hidden="1"/><attribute name="user_satisfaction" hidden="1"/><attribute name="user_commment" hidden="1"/><attribute name="request_type" mandatory="1"/><attribute name="freeze_reason" hidden="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions><transition stimulus="ev_reassign" target="escalated_ttr"><actions/></transition><transition stimulus="ev_resolve" target="resolved"><actions><action verb="SetResolveDate"/><action verb="SetClosureDeadline"/></actions></transition></transitions></state><state name="frozen"><flags><attribute name="ref" read_only="1"/><attribute name="title" read_only="1"/><attribute name="description" read_only="1"/><attribute name="ticket_log"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" read_only="1"/><attribute name="caller_email"/><attribute name="org_id" read_only="1"/><attribute name="org_name"/><attribute name="service_id"/><attribute name="service_name"/><attribute name="servicesubcategory_id"/><attribute name="servicesubcategory_name"/><attribute name="product"/><attribute name="impact"/><attribute name="urgency"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id" mandatory="1"/><attribute name="workgroup_name"/><attribute name="agent_id" mandatory="1"/><attribute name="agent_name"/><attribute name="agent_email" read_only="1"/><attribute name="related_problem_id"/><attribute name="related_problem_ref"/><attribute name="related_change_id"/><attribute name="related_change_ref"/><attribute name="close_date" hidden="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" hidden="1"/><attribute name="ttr_escalation_deadline" read_only="1"/><attribute name="closure_deadline" hidden="1"/><attribute name="resolution_code" hidden="1"/><attribute name="solution" hidden="1"/><attribute name="user_satisfaction" hidden="1"/><attribute name="user_commment" hidden="1"/><attribute name="request_type" mandatory="1"/><attribute name="freeze_reason" mandatory="1" must_prompt="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions><transition stimulus="ev_timeout" target="escalated_ttr"><actions/></transition><transition stimulus="ev_assign" target="assigned"><actions/></transition><transition stimulus="ev_resolve" target="resolved"><actions/></transition></transitions></state><state name="resolved"><flags><attribute name="ref" read_only="1"/><attribute name="title" read_only="1"/><attribute name="description" read_only="1"/><attribute name="ticket_log"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" read_only="1"/><attribute name="caller_email"/><attribute name="org_id" read_only="1"/><attribute name="org_name"/><attribute name="service_id" read_only="1"/><attribute name="service_name"/><attribute name="servicesubcategory_id" read_only="1"/><attribute name="servicesubcategory_name"/><attribute name="product" read_only="1"/><attribute name="impact" read_only="1"/><attribute name="urgency" read_only="1"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id" read_only="1"/><attribute name="workgroup_name"/><attribute name="agent_id" read_only="1"/><attribute name="agent_name"/><attribute name="agent_email" read_only="1"/><attribute name="related_problem_id"/><attribute name="related_problem_ref"/><attribute name="related_change_id"/><attribute name="related_change_ref"/><attribute name="close_date" hidden="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" hidden="1"/><attribute name="ttr_escalation_deadline" hidden="1"/><attribute name="closure_deadline" read_only="1"/><attribute name="resolution_code" must_prompt="1"/><attribute name="solution" must_prompt="1"/><attribute name="user_satisfaction" hidden="1"/><attribute name="user_commment" hidden="1"/><attribute name="request_type" mandatory="1"/><attribute name="freeze_reason" hidden="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions><transition stimulus="ev_reassign" target="assigned"><actions/></transition><transition stimulus="ev_close" target="closed"><actions><action verb="SetClosureDate"/></actions></transition></transitions></state><state name="closed"><flags><attribute name="ref" read_only="1"/><attribute name="title" read_only="1"/><attribute name="description" read_only="1"/><attribute name="ticket_log" read_only="1"/><attribute name="start_date" read_only="1"/><attribute name="document_list"/><attribute name="ci_list"/><attribute name="contact_list"/><attribute name="incident_list"/><attribute name="status"/><attribute name="caller_id" read_only="1"/><attribute name="caller_email"/><attribute name="org_id" read_only="1"/><attribute name="org_name"/><attribute name="service_id" read_only="1"/><attribute name="service_name"/><attribute name="servicesubcategory_id" read_only="1"/><attribute name="servicesubcategory_name"/><attribute name="product" read_only="1"/><attribute name="impact" read_only="1"/><attribute name="urgency" read_only="1"/><attribute name="priority" read_only="1"/><attribute name="workgroup_id" read_only="1"/><attribute name="workgroup_name"/><attribute name="agent_id" read_only="1"/><attribute name="agent_name"/><attribute name="agent_email" read_only="1"/><attribute name="related_problem_id"/><attribute name="related_problem_ref"/><attribute name="related_change_id"/><attribute name="related_change_ref"/><attribute name="close_date" read_only="1"/><attribute name="last_update" read_only="1"/><attribute name="assignment_date" hidden="1"/><attribute name="resolution_date" hidden="1"/><attribute name="tto_escalation_deadline" hidden="1"/><attribute name="ttr_escalation_deadline" hidden="1"/><attribute name="closure_deadline" hidden="1"/><attribute name="resolution_code" read_only="1"/><attribute name="solution" read_only="1"/><attribute name="user_satisfaction" must_prompt="1"/><attribute name="user_commment" must_prompt="1"/><attribute name="request_type" read_only="1"/><attribute name="freeze_reason" hidden="1"/><attribute name="related_change_id_finalclass_recall"/></flags><transitions/></state></states></lifecycle><methods><method name="ComputeValues" static="false" access="public" type="Overload-DBObject"><![CDATA[ public function ComputeValues()
  10. {
  11. $sCurrRef = $this->Get('ref');
  12. if (strlen($sCurrRef) == 0)
  13. {
  14. $iKey = $this->GetKey();
  15. if ($iKey < 0)
  16. {
  17. // Object not yet in the Database
  18. $iKey = MetaModel::GetNextKey(get_class($this));
  19. }
  20. $sName = sprintf('R-%06d', $iKey);
  21. $this->Set('ref', $sName);
  22. }
  23. return parent::ComputeValues();
  24. }]]></method><method name="GetIcon" static="false" access="public" type="Overload-DBObject"><comment><![CDATA[/**
  25. * Get the icon representing this object
  26. * @param boolean $bImgTag If true the result is a full IMG tag (or an emtpy string if no icon is defined)
  27. * @return string Either the full IMG tag ($bImgTag == true) or just the path to the icon file
  28. */]]></comment><![CDATA[ public function GetIcon($bImgTag = true)
  29. {
  30. $sStatus = $this->Get('status');
  31. switch($this->GetState())
  32. {
  33. case 'escalated_tto':
  34. case 'escalated_ttr':
  35. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  36. break;
  37. case 'resolved':
  38. case 'closed':
  39. $sIcon = self::MakeIconFromName('user-request-closed.png');
  40. break;
  41. case 'new':
  42. $sIcon = self::MakeIconFromName('user-request.png');
  43. $oEscalationDeadline = $this->Get('tto_escalation_deadline');
  44. if ($oEscalationDeadline != null)
  45. {
  46. // A SLA is running
  47. $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  48. $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
  49. $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
  50. if ($ratio <= 0)
  51. {
  52. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  53. }
  54. else if ($ratio <= 0.25)
  55. {
  56. $sIcon = self::MakeIconFromName('user-request-deadline.png');
  57. }
  58. }
  59. break;
  60. case 'assigned':
  61. $sIcon = self::MakeIconFromName('user-request.png');
  62. $oEscalationDeadline = $this->Get('ttr_escalation_deadline');
  63. if ($oEscalationDeadline != null)
  64. {
  65. // A SLA is running
  66. $iStartDate = AttributeDateTime::GetAsUnixSeconds($this->Get('start_date'));
  67. $iEscalationDeadline = AttributeDateTime::GetAsUnixSeconds($oEscalationDeadline);
  68. $ratio = ($iEscalationDeadline - time())/($iEscalationDeadline - $iStartDate);
  69. if ($ratio <= 0)
  70. {
  71. $sIcon = self::MakeIconFromName('user-request-escalated.png');
  72. }
  73. else if ($ratio <= 0.25)
  74. {
  75. $sIcon = self::MakeIconFromName('user-request-deadline.png');
  76. }
  77. }
  78. break;
  79. default:
  80. $sIcon = MetaModel::GetClassIcon(get_class($this), $bImgTag);
  81. }
  82. return $sIcon;
  83. }]]></method><method name="MakeIconFromName" static="true" access="protected" type="Overload-DBObject"><![CDATA[ protected static function MakeIconFromName($sIconName, $bImgTag = true)
  84. {
  85. $sIcon = '';
  86. if ($sIconName != '')
  87. {
  88. $sPath = utils::GetAbsoluteUrlModulesRoot().'itop-request-mgmt-1.0.0/images/'.$sIconName;
  89. if ($bImgTag)
  90. {
  91. $sIcon = "<img src=\"$sPath\" style=\"vertical-align:middle;\"/>";
  92. }
  93. else
  94. {
  95. $sIcon = $sPath;
  96. }
  97. }
  98. return $sIcon;
  99. }]]></method></methods><presentation><details><items><item>document_list</item><item>ci_list</item><item>contact_list</item><item>incident_list</item><item key="col:col1"><items><item key="fieldset:Ticket:baseinfo"><items><item>ref</item><item>title</item><item>org_id</item><item>status</item><item>priority</item><item>request_type</item><item>service_id</item><item>servicesubcategory_id</item><item>product</item></items></item><item key="fieldset:Ticket:moreinfo"><items><item>impact</item><item>urgency</item><item>description</item><item>resolution_code</item><item>solution</item><item>user_satisfaction</item><item>user_commment</item><item>freeze_reason</item></items></item></items></item><item key="col:col2"><items><item key="fieldset:Ticket:date"><items><item>start_date</item><item>last_update</item><item>assignment_date</item><item>tto_escalation_deadline</item><item>ttr_escalation_deadline</item><item>close_date</item><item>closure_deadline</item></items></item><item key="fieldset:Ticket:contact"><items><item>caller_id</item><item>workgroup_id</item><item>agent_id</item></items></item><item key="fieldset:Ticket:relation"><items><item>related_problem_id</item><item>related_change_id</item></items></item></items></item></items></details><search><items><item>ref</item><item>title</item><item>org_id</item><item>request_type</item><item>start_date</item><item>status</item><item>caller_id</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><item>resolution_code</item><item>solution</item><item>user_satisfaction</item><item>user_commment</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><item>workgroup_id</item><item>agent_id</item></items></list></presentation></class></classes>