Contact.class.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Define a contact
  4. * @author Valentin MORREEL
  5. * @category Core
  6. * @license MIT
  7. */
  8. class Contact extends Entity{
  9. public $id,$scope,$uid,$label,$type,$value,$state;
  10. public $entityLabel = 'Information de Contact';
  11. //Phone constants
  12. const PHONE = 'phone';
  13. const MOBILE= 'mobile';
  14. //Mail constants
  15. const PERSONAL_MAIL = 'personal_mail';
  16. const PROFESSIONAL_MAIL = 'professional_mail';
  17. public $fields = array(
  18. 'id' => array('label'=>'Identifiant', 'type'=>'key'),
  19. 'scope' => array('label'=>'Périmetre de l\'entité liée', 'type'=>'text'),
  20. 'uid' => array('label'=>'Identifiant de l\'entité liée', 'type'=>'integer'),
  21. 'label' => array('label'=>'Libellé', 'type'=>'text'),
  22. 'type' => array('label'=>'Type d\'information de contact', 'type'=>'text'),
  23. 'value' => array('label'=>'Valeur', 'type'=>'text'),
  24. 'state' => array('label'=>'Etat', 'type'=>'text')
  25. );
  26. public $indexes = array('uid','scope');
  27. public static function types($key=null){
  28. $types = array(
  29. self::PHONE => array(
  30. 'label' => "Tél. Fixe",
  31. 'icon' => "",
  32. 'color' => "",
  33. ),
  34. self::MOBILE => array(
  35. 'label' => "Tél. Mobile",
  36. 'icon' => "",
  37. 'color' => "",
  38. ),
  39. self::PERSONAL_MAIL => array(
  40. 'label' => "Mail perso.",
  41. 'icon' => "",
  42. 'color' => "",
  43. ),
  44. self::PROFESSIONAL_MAIL => array(
  45. 'label' => "Mail pro.",
  46. 'icon' => "",
  47. 'color' => "",
  48. ),
  49. );
  50. Plugin::callHook('contact_types', array(&$types));
  51. return isset($key) && isset($types[$key]) ? $types[$key] : $types;
  52. }
  53. }
  54. ?>