audit.category.class.inc.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. // Copyright (C) 2010 Combodo SARL
  3. //
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; version 3 of the License.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program; if not, write to the Free Software
  15. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. /**
  17. * This class manages the audit "categories". Each category defines a set of objects
  18. * to check and is linked to a set of rules that determine the valid or invalid objects
  19. * inside the set
  20. *
  21. * @author Erwan Taloc <erwan.taloc@combodo.com>
  22. * @author Romain Quetiez <romain.quetiez@combodo.com>
  23. * @author Denis Flaven <denis.flaven@combodo.com>
  24. * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL
  25. */
  26. require_once('../application/cmdbabstract.class.inc.php');
  27. class AuditCategory extends cmdbAbstractObject
  28. {
  29. public static function Init()
  30. {
  31. $aParams = array
  32. (
  33. "category" => "application",
  34. "key_type" => "autoincrement",
  35. "key_label" => "",
  36. "name_attcode" => "name",
  37. "state_attcode" => "",
  38. "reconc_keys" => array('name'),
  39. "db_table" => "priv_auditcategory",
  40. "db_key_field" => "id",
  41. "db_finalclass_field" => "",
  42. "display_template" => "../application/templates/audit_category.html",
  43. );
  44. MetaModel::Init_Params($aParams);
  45. MetaModel::Init_AddAttribute(new AttributeString("name", array("description"=>"Short name for this category", "allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
  46. MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
  47. MetaModel::Init_AddAttribute(new AttributeText("definition_set", array("allowed_values"=>null, "sql"=>"definition_set", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
  48. // Display lists
  49. MetaModel::Init_SetZListItems('details', array('name', 'description', 'definition_set')); // Attributes to be displayed for the complete details
  50. MetaModel::Init_SetZListItems('list', array('name', 'description', )); // Attributes to be displayed for a list
  51. // Search criteria
  52. MetaModel::Init_SetZListItems('standard_search', array('name', 'description')); // Criteria of the std search form
  53. MetaModel::Init_SetZListItems('advanced_search', array('name', 'description', 'definition_set')); // Criteria of the advanced search form
  54. }
  55. }
  56. ?>