You are here

party_starterkit_b2b.module in Party 8.2

Same filename and directory in other branches
  1. 7 starterkits/party_starterkit_b2b/party_starterkit_b2b.module

Main file for the Party Kickstart

File

starterkits/party_starterkit_b2b/party_starterkit_b2b.module
View source
<?php

/**
 * @file Main file for the Party Kickstart
 */

/**
 * Implements hook_default_profile2_type();
 */
function party_starterkit_b2b_default_profile2_type() {
  $type = array();

  // Organisation type
  $types['party_org'] = new ProfileType(array(
    'type' => 'party_org',
    'label' => 'Organisation',
    'weight' => 0,
  ));

  // Individual Contact type
  $types['party_contact'] = new ProfileType(array(
    'type' => 'party_contact',
    'label' => 'Contact',
    'weight' => 1,
  ));

  // Notes Profile
  $types['party_notes'] = new ProfileType(array(
    'type' => 'party_notes',
    'label' => 'Notes',
    'weight' => 2,
  ));
  return $types;
}

/**
 * Implements hook_default_party_hat().
 */
function party_starterkit_b2b_default_party_hat() {
  $hats = array();

  // Contact hat.
  $hats['contact'] = new PartyHat(array(
    'name' => 'contact',
    'label' => 'Contact',
    'description' => 'An individual contact.',
    'parent' => '',
    'weight' => 0,
    'data' => array(
      'data_sets' => array(
        'profile2_party_contact' => array(
          'has' => TRUE,
        ),
        'profile2_party_notes' => array(
          'has' => TRUE,
        ),
      ),
    ),
  ));

  // Organization hat.
  $hats['org'] = new PartyHat(array(
    'name' => 'org',
    'label' => 'Organization',
    'description' => 'An organization contact.',
    'parent' => '',
    'weight' => 1,
    'data' => array(
      'data_sets' => array(
        'profile2_party_org' => array(
          'has' => TRUE,
        ),
        'profile2_party_notes' => array(
          'has' => TRUE,
        ),
      ),
    ),
  ));
  return $hats;
}

/**
 * Implement hook_default_party_activity_type().
 */
function party_starterkit_b2b_default_party_activity_type() {
  $types = array();

  // Meeting activity
  $types['meeting'] = new PartyActivityType(array(
    'type' => 'meeting',
    'label' => 'Meeting',
  ));

  // Meeting activity
  $types['task'] = new PartyActivityType(array(
    'type' => 'task',
    'label' => 'Task',
  ));

  // Meeting activity
  $types['call'] = new PartyActivityType(array(
    'type' => 'call',
    'label' => 'Call',
  ));
  return $types;
}

/**
 * Implement hook_views_api().
 */
function party_starterkit_b2b_views_api() {
  return array(
    'api' => '3.0',
    'path' => drupal_get_path('module', 'party_starterkit_b2b') . '/views',
  );
}

Functions

Namesort descending Description
party_starterkit_b2b_default_party_activity_type Implement hook_default_party_activity_type().
party_starterkit_b2b_default_party_hat Implements hook_default_party_hat().
party_starterkit_b2b_default_profile2_type Implements hook_default_profile2_type();
party_starterkit_b2b_views_api Implement hook_views_api().