forked from CiviWare/com.megaphonetech.relateentities
		
	Added xml file for schema
This commit is contained in:
		
				
					committed by
					
						
						Pradeep Nayak
					
				
			
			
				
	
			
			
			
						parent
						
							5596e9b90b
						
					
				
				
					commit
					ae5edc1f48
				
			@@ -4,9 +4,9 @@
 | 
			
		||||
 * @package CRM
 | 
			
		||||
 * @copyright CiviCRM LLC (c) 2004-2019
 | 
			
		||||
 *
 | 
			
		||||
 * Generated from xml/schema/CRM/Contact/RelateEntities.xml
 | 
			
		||||
 * Generated from /Users/pradeep/Sites/drupal7/sites/all/extensions/com.megaphonetech.relateentities/xml/schema/CRM/RelateEntities/RelateEntities.xml
 | 
			
		||||
 * DO NOT EDIT.  Generated by CRM_Core_CodeGen
 | 
			
		||||
 * (GenCodeChecksum:ebfcea88ae4bd09a0821a942ecdfa4db)
 | 
			
		||||
 * (GenCodeChecksum:0aed23f92f04bbba15d37ebab3346963)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -29,20 +29,68 @@ class CRM_RelateEntities_DAO_RelateEntities extends CRM_Core_DAO {
 | 
			
		||||
  public static $_log = TRUE;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * RelateEntities ID
 | 
			
		||||
   * Unique Related Entity ID
 | 
			
		||||
   *
 | 
			
		||||
   * @var int
 | 
			
		||||
   */
 | 
			
		||||
  public $id;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc
 | 
			
		||||
   *
 | 
			
		||||
   * @var string
 | 
			
		||||
   */
 | 
			
		||||
  public $entity_table_a;
 | 
			
		||||
  public $entity_table_b;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * entry in table
 | 
			
		||||
   *
 | 
			
		||||
   * @var int
 | 
			
		||||
   */
 | 
			
		||||
  public $entity_id_a;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc
 | 
			
		||||
   *
 | 
			
		||||
   * @var string
 | 
			
		||||
   */
 | 
			
		||||
  public $entity_table_b;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * entry in table
 | 
			
		||||
   *
 | 
			
		||||
   * @var int
 | 
			
		||||
   */
 | 
			
		||||
  public $entity_id_b;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * id of the relationship
 | 
			
		||||
   *
 | 
			
		||||
   * @var int
 | 
			
		||||
   */
 | 
			
		||||
  public $relationship_type_id;
 | 
			
		||||
  public $created_date;
 | 
			
		||||
  public $modified_date;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * is the relationship active ?
 | 
			
		||||
   *
 | 
			
		||||
   * @var bool
 | 
			
		||||
   */
 | 
			
		||||
  public $is_active;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * When was the entry was created.
 | 
			
		||||
   *
 | 
			
		||||
   * @var timestamp
 | 
			
		||||
   */
 | 
			
		||||
  public $created_date;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * When was the entry was modified.
 | 
			
		||||
   *
 | 
			
		||||
   * @var timestamp
 | 
			
		||||
   */
 | 
			
		||||
  public $modified_date;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Class constructor.
 | 
			
		||||
   */
 | 
			
		||||
@@ -61,6 +109,8 @@ class CRM_RelateEntities_DAO_RelateEntities extends CRM_Core_DAO {
 | 
			
		||||
    if (!isset(Civi::$statics[__CLASS__]['links'])) {
 | 
			
		||||
      Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
 | 
			
		||||
      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'relationship_type_id', 'civicrm_relationship_type', 'id');
 | 
			
		||||
      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'entity_id_a', NULL, 'id', 'entity_table_a');
 | 
			
		||||
      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'entity_id_b', NULL, 'id', 'entity_table_b');
 | 
			
		||||
      CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
 | 
			
		||||
    }
 | 
			
		||||
    return Civi::$statics[__CLASS__]['links'];
 | 
			
		||||
@@ -77,40 +127,23 @@ class CRM_RelateEntities_DAO_RelateEntities extends CRM_Core_DAO {
 | 
			
		||||
        'id' => [
 | 
			
		||||
          'name' => 'id',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_INT,
 | 
			
		||||
          'title' => ts('RelateEntities ID'),
 | 
			
		||||
          'description' => ts('RelateEntities ID'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('Unique Related Entity ID'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.id',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
        'entity_table_a' => [
 | 
			
		||||
          'name' => 'entity_table_a',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_STRING,
 | 
			
		||||
          'title' => ts('Entity Table A'),
 | 
			
		||||
          'description' => ts('May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'maxlength' => 64,
 | 
			
		||||
          'size' => CRM_Utils_Type::BIG,
 | 
			
		||||
          'import' => TRUE,
 | 
			
		||||
          'export' => TRUE,
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
        'entity_table_b' => [
 | 
			
		||||
          'name' => 'entity_table_b',
 | 
			
		||||
        'entity_table_a' => [
 | 
			
		||||
          'name' => 'entity_table_a',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_STRING,
 | 
			
		||||
          'title' => ts('Entity Table B'),
 | 
			
		||||
          'description' => ts('May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc'),
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('Entity Table A'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'maxlength' => 64,
 | 
			
		||||
          'size' => CRM_Utils_Type::BIG,
 | 
			
		||||
          'import' => TRUE,
 | 
			
		||||
          'export' => TRUE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.entity_table_a',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
@@ -119,86 +152,99 @@ class CRM_RelateEntities_DAO_RelateEntities extends CRM_Core_DAO {
 | 
			
		||||
        'entity_id_a' => [
 | 
			
		||||
          'name' => 'entity_id_a',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_INT,
 | 
			
		||||
          'title' => ts('Entity Id A'),
 | 
			
		||||
          'description' => '',
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('Entity Id A'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('entry in table'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.entity_id_a',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
        'entity_table_b' => [
 | 
			
		||||
          'name' => 'entity_table_b',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_STRING,
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('Entity Table b'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('May contain civicrm_financial_item, civicrm_contribution, civicrm_financial_trxn, civicrm_grant, etc'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'maxlength' => 64,
 | 
			
		||||
          'size' => CRM_Utils_Type::BIG,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.entity_table_b',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
        'entity_id_b' => [
 | 
			
		||||
          'name' => 'entity_id_b',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_INT,
 | 
			
		||||
          'title' => ts('Entity Id B'),
 | 
			
		||||
          'description' => '',
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('Entity Id B'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('entry in table'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.entity_id_b',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
        'relationship_type_id' => [
 | 
			
		||||
          'name' => 'relationship_type_id',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_INT,
 | 
			
		||||
          'title' => ts('Relationship Type'),
 | 
			
		||||
          'description' => ts('id of the relationship'),
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('Relationship Type'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('id of the relationship'),
 | 
			
		||||
          'required' => TRUE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.relationship_type_id',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
          'FKClassName' => 'CRM_Relationship_DAO_RelationshipType',
 | 
			
		||||
          'html' => [
 | 
			
		||||
            'type' => 'Select',
 | 
			
		||||
          ],
 | 
			
		||||
        ],
 | 
			
		||||
        'created_date' => [
 | 
			
		||||
          'name' => 'created_date',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_DATE,
 | 
			
		||||
          'title' => ts('RelateEntities Created Date'),
 | 
			
		||||
          'description' => ts('date when the relationship created'),
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
          'html' => [
 | 
			
		||||
            'type' => 'Select Date',
 | 
			
		||||
            'formatType' => 'activityDate',
 | 
			
		||||
          ],
 | 
			
		||||
        ],
 | 
			
		||||
        'modified_date' => [
 | 
			
		||||
          'name' => 'modified_date',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_DATE,
 | 
			
		||||
          'title' => ts('RelateEntities Modified Date'),
 | 
			
		||||
          'description' => ts('date when the relationship modified'),
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
          'html' => [
 | 
			
		||||
            'type' => 'Select Date',
 | 
			
		||||
            'formatType' => 'activityDate',
 | 
			
		||||
          ],
 | 
			
		||||
        ],
 | 
			
		||||
        'is_active' => [
 | 
			
		||||
          'name' => 'is_active',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_BOOLEAN,
 | 
			
		||||
          'title' => ts('Is Active?'),
 | 
			
		||||
          'description' => ts('is active ?'),
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('Relationship Is Active'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('is the relationship active ?'),
 | 
			
		||||
          'where' => 'civicrm_relate_entities.is_active',
 | 
			
		||||
          'default' => '1',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_BAO_RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
          'html' => [
 | 
			
		||||
            'type' => 'Radio',
 | 
			
		||||
          ],
 | 
			
		||||
          'options' => [
 | 
			
		||||
            '1' => ts('Yes'),
 | 
			
		||||
            '0' => ts('No'),
 | 
			
		||||
            'type' => 'CheckBox',
 | 
			
		||||
          ],
 | 
			
		||||
        ],
 | 
			
		||||
        'created_date' => [
 | 
			
		||||
          'name' => 'created_date',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_TIMESTAMP,
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('RelateEntities Created Date'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('When was the entry was created.'),
 | 
			
		||||
          'required' => FALSE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.created_date',
 | 
			
		||||
          'export' => TRUE,
 | 
			
		||||
          'default' => 'CURRENT_TIMESTAMP',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
        'modified_date' => [
 | 
			
		||||
          'name' => 'modified_date',
 | 
			
		||||
          'type' => CRM_Utils_Type::T_TIMESTAMP,
 | 
			
		||||
          'title' => CRM_RelateEntities_ExtensionUtil::ts('RelateEntities Modified Date'),
 | 
			
		||||
          'description' => CRM_RelateEntities_ExtensionUtil::ts('When was the entry was modified.'),
 | 
			
		||||
          'required' => FALSE,
 | 
			
		||||
          'where' => 'civicrm_relate_entities.modified_date',
 | 
			
		||||
          'export' => TRUE,
 | 
			
		||||
          'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
 | 
			
		||||
          'table_name' => 'civicrm_relate_entities',
 | 
			
		||||
          'entity' => 'RelateEntities',
 | 
			
		||||
          'bao' => 'CRM_RelateEntities_DAO_RelateEntities',
 | 
			
		||||
          'localizable' => 0,
 | 
			
		||||
        ],
 | 
			
		||||
      ];
 | 
			
		||||
      CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -214,7 +214,7 @@ use CRM_Core_Form_EntityFormTrait;
 | 
			
		||||
      if (!empty($result['is_error'])) {
 | 
			
		||||
        CRM_Core_Error::statusBounce($result['error_message'], CRM_Utils_System::url('civicrm/', "reset=1&action=browse"), ts('Cannot Delete'));
 | 
			
		||||
      }
 | 
			
		||||
      CRM_Core_Session::setStatus(ts('Selected Bank Account has been deleted.'), ts('Record Deleted'), 'success');
 | 
			
		||||
      CRM_Core_Session::setStatus(ts('Selected Related entity has been deleted.'), ts('Record Deleted'), 'success');
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      // store the submitted values in an array
 | 
			
		||||
@@ -240,7 +240,7 @@ use CRM_Core_Form_EntityFormTrait;
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
    if ($buttonName == $this->getButtonName('next', 'new')) {
 | 
			
		||||
      CRM_Core_Session::setStatus(ts(' You can add another Bank Account.'));
 | 
			
		||||
      CRM_Core_Session::setStatus(ts(' You can add another Related entity.'));
 | 
			
		||||
      $session->replaceUserContext(CRM_Utils_System::url('civicrm/relatedentities/add',
 | 
			
		||||
        "action=add&reset=1&entityTable={$this->entity_table}&entityId={$apiParams['entity_id_a']}")
 | 
			
		||||
      );
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user