model.itop-tickets.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. //
  3. // File generated by ... on the 2012-06-05T18:30:57+0200
  4. // Please do not edit manually
  5. //
  6. //
  7. // Copyright (C) 2010 Combodo SARL
  8. //
  9. // ben on met quoi ici ?
  10. // Signé: Romain
  11. //
  12. // This program is free software; you can redistribute it and/or modify
  13. // it under the terms of the GNU General Public License as published by
  14. // the Free Software Foundation; version 3 of the License.
  15. //
  16. // This program is distributed in the hope that it will be useful,
  17. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. // GNU General Public License for more details.
  20. //
  21. // You should have received a copy of the GNU General Public License
  22. // along with this program; if not, write to the Free Software
  23. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. /**
  25. * Classes and menus for itop-tickets (version 1.0.0)
  26. *
  27. */
  28. /**
  29. * Persistent classes for a CMDB
  30. *
  31. * @copyright Copyright (C) 2010-2012 Combodo SARL
  32. * @license http://opensource.org/licenses/AGPL-3.0
  33. */
  34. class Ticket extends cmdbAbstractObject
  35. {
  36. public static function Init()
  37. {
  38. $aParams = array
  39. (
  40. 'category' => 'bizmodel,searchable,structure',
  41. 'key_type' => 'autoincrement',
  42. 'name_attcode' => 'ref',
  43. 'state_attcode' => '',
  44. 'reconc_keys' => array('ref'),
  45. 'db_table' => 'ticket',
  46. 'db_key_field' => 'id',
  47. 'db_finalclass_field' => '',
  48. );
  49. MetaModel::Init_Params($aParams);
  50. MetaModel::Init_InheritAttributes();
  51. MetaModel::Init_AddAttribute(new AttributeString("ref", array("allowed_values"=>null, "sql"=>'ref', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array())));
  52. MetaModel::Init_AddAttribute(new AttributeExternalKey("organization_id", array("targetclass"=>'Organization', "allowed_values"=>null, "sql"=>'organization_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  53. MetaModel::Init_AddAttribute(new AttributeExternalKey("caller_id", array("targetclass"=>'Person', "allowed_values"=>null, "sql"=>'caller_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  54. MetaModel::Init_AddAttribute(new AttributeExternalKey("team_id", array("targetclass"=>'Team', "allowed_values"=>null, "sql"=>'team_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  55. MetaModel::Init_AddAttribute(new AttributeExternalKey("agent_id", array("targetclass"=>'Person', "allowed_values"=>null, "sql"=>'agent_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  56. MetaModel::Init_AddAttribute(new AttributeString("title", array("allowed_values"=>null, "sql"=>'title', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
  57. MetaModel::Init_AddAttribute(new AttributeText("description", array("allowed_values"=>null, "sql"=>'description', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
  58. MetaModel::Init_AddAttribute(new AttributeDateTime("start_date", array("allowed_values"=>null, "sql"=>'start_date', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
  59. MetaModel::Init_AddAttribute(new AttributeDateTime("end_date", array("allowed_values"=>null, "sql"=>'end_date', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
  60. MetaModel::Init_AddAttribute(new AttributeDateTime("last_update", array("allowed_values"=>null, "sql"=>'last_update', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
  61. MetaModel::Init_AddAttribute(new AttributeDateTime("close_date", array("allowed_values"=>null, "sql"=>'close_date', "default_value"=>'', "is_null_allowed"=>true, "depends_on"=>array())));
  62. MetaModel::Init_AddAttribute(new AttributeCaseLog("private_log", array("allowed_values"=>null, "sql"=>'private_log', "default_value"=>'', "is_null_allowed"=>false, "depends_on"=>array())));
  63. MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("contacts_list", array("linked_class"=>'lnkContactToTicket', "ext_key_to_me"=>'ticket_id', "ext_key_to_remote"=>'contact_id', "allowed_values"=>null, "count_min"=>0, "count_max"=>0, "duplicates"=>false, "depends_on"=>array())));
  64. MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("functionalcis_list", array("linked_class"=>'lnkFunctionalCIToTicket', "ext_key_to_me"=>'ticket_id', "ext_key_to_remote"=>'functionalci_id', "allowed_values"=>null, "count_min"=>0, "count_max"=>0, "duplicates"=>false, "depends_on"=>array())));
  65. MetaModel::Init_SetZListItems('details', array (
  66. 0 => 'ref',
  67. 1 => 'organization_id',
  68. 2 => 'caller_id',
  69. 3 => 'team_id',
  70. 4 => 'agent_id',
  71. 5 => 'title',
  72. 6 => 'description',
  73. 7 => 'start_date',
  74. 8 => 'end_date',
  75. 9 => 'last_update',
  76. 10 => 'close_date',
  77. 11 => 'private_log',
  78. 12 => 'contacts_list',
  79. 13 => 'functionalcis_list',
  80. ));
  81. MetaModel::Init_SetZListItems('standard_search', array (
  82. 0 => 'ref',
  83. 1 => 'title',
  84. 2 => 'description',
  85. 3 => 'start_date',
  86. 4 => 'end_date',
  87. 5 => 'last_update',
  88. 6 => 'close_date',
  89. ));
  90. MetaModel::Init_SetZListItems('list', array (
  91. 0 => 'ref',
  92. 1 => 'organization_id',
  93. 2 => 'title',
  94. 3 => 'caller_id',
  95. 4 => 'team_id',
  96. 5 => 'agent_id',
  97. 6 => 'start_date',
  98. ));
  99. }
  100. }
  101. class lnkContactToTicket extends cmdbAbstractObject
  102. {
  103. public static function Init()
  104. {
  105. $aParams = array
  106. (
  107. 'category' => 'bizModel',
  108. 'key_type' => 'autoincrement',
  109. 'name_attcode' => array('ticket_id', 'contact_id'),
  110. 'state_attcode' => '',
  111. 'reconc_keys' => array('ticket_id', 'contact_id'),
  112. 'db_table' => 'lnkcontacttoticket',
  113. 'db_key_field' => 'id',
  114. 'db_finalclass_field' => '',
  115. );
  116. MetaModel::Init_Params($aParams);
  117. MetaModel::Init_InheritAttributes();
  118. MetaModel::Init_AddAttribute(new AttributeExternalKey("ticket_id", array("targetclass"=>'Ticket', "allowed_values"=>null, "sql"=>'ticket_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  119. MetaModel::Init_AddAttribute(new AttributeExternalKey("contact_id", array("targetclass"=>'Contact', "allowed_values"=>null, "sql"=>'contact_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  120. MetaModel::Init_SetZListItems('details', array (
  121. 0 => 'ticket_id',
  122. 1 => 'contact_id',
  123. ));
  124. MetaModel::Init_SetZListItems('standard_search', array (
  125. 0 => 'ticket_id',
  126. 1 => 'contact_id',
  127. ));
  128. MetaModel::Init_SetZListItems('list', array (
  129. 0 => 'ticket_id',
  130. 1 => 'contact_id',
  131. ));
  132. }
  133. }
  134. class lnkFunctionalCIToTicket extends cmdbAbstractObject
  135. {
  136. public static function Init()
  137. {
  138. $aParams = array
  139. (
  140. 'category' => 'bizModel',
  141. 'key_type' => 'autoincrement',
  142. 'name_attcode' => array('ticket_id', 'functionalci_id'),
  143. 'state_attcode' => '',
  144. 'reconc_keys' => array('ticket_id', 'functionalci_id'),
  145. 'db_table' => 'lnkfunctionalcitoticket',
  146. 'db_key_field' => 'id',
  147. 'db_finalclass_field' => '',
  148. );
  149. MetaModel::Init_Params($aParams);
  150. MetaModel::Init_InheritAttributes();
  151. MetaModel::Init_AddAttribute(new AttributeExternalKey("ticket_id", array("targetclass"=>'Ticket', "allowed_values"=>null, "sql"=>'ticket_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  152. MetaModel::Init_AddAttribute(new AttributeExternalKey("functionalci_id", array("targetclass"=>'FunctionalCI', "allowed_values"=>null, "sql"=>'functionalci_id', "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
  153. MetaModel::Init_SetZListItems('details', array (
  154. 0 => 'ticket_id',
  155. 1 => 'functionalci_id',
  156. ));
  157. MetaModel::Init_SetZListItems('standard_search', array (
  158. 0 => 'ticket_id',
  159. 1 => 'functionalci_id',
  160. ));
  161. MetaModel::Init_SetZListItems('list', array (
  162. 0 => 'ticket_id',
  163. 1 => 'functionalci_id',
  164. ));
  165. }
  166. }