Skip to content

Instantly share code, notes, and snippets.

View jackrabbithanna's full-sized avatar

Mark Hanna jackrabbithanna

View GitHub Profile
{
"name": "drupal/recommended-project",
"description": "Project template for Drupal projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
@jackrabbithanna
jackrabbithanna / gist:295ee250ea702f2bd18c62dc587bfd4d
Created November 7, 2020 01:56
civicrm_customs.module -- D7 Custom VBO action to update participant status
function civicrm_customs_action_info() {
return array(
'civicrm_customs_update_participant_status_action' => array(
'type' => 'civicrm_participant',
'label' => t('Update participant status'),
'behavior' => array('views_property'),
'configurable' => FALSE,
'vbo_configurable' => TRUE,
'triggers' => array('any'),
'pass rows' => TRUE,
@jackrabbithanna
jackrabbithanna / civicrm_customs.module
Last active May 10, 2022 23:07
Custom activity status update VBO .module file
function civicrm_customs_action_info() {
return array(
'civicrm_customs_update_activity_status_action' => array(
'type' => 'civicrm_activity',
'label' => t('Update Activity Status'),
'behavior' => array('views_property'),
'configurable' => FALSE,
'vbo_configurable' => TRUE,
'triggers' => array('any'),
'pass rows' => TRUE,
@jackrabbithanna
jackrabbithanna / gist:c1e9c95d256f0d27238dfd179f659a1b
Created February 14, 2022 21:05
Contacts in Group sample view yaml configuration
langcode: en
status: true
dependencies:
module:
- civicrm_entity
id: contacts_in_group_temp
label: 'Contacts in group temp'
module: views
description: ''
tag: ''
@jackrabbithanna
jackrabbithanna / webform.webform.mark_birthdate_tester.yml
Created January 6, 2022 20:27
3 page webform, one civi element per page
langcode: en
status: open
dependencies:
module:
- webform_civicrm
open: null
close: null
weight: 0
uid: 3795
template: false
@jackrabbithanna
jackrabbithanna / gist:d40edacba4da41023dd959bc097f3d12
Created May 12, 2021 22:10
Sample Rule, create Drupal user when EntityTag with Name = Application is created for a contact
langcode: en
status: true
dependencies: { }
id: create_user_1
label: 'Create user'
events:
-
event_name: 'rules_entity_insert:civicrm_entity_tag--civicrm_entity_tag'
description: ''
tags: { }
@jackrabbithanna
jackrabbithanna / gist:919e2839c7d6a436bc2945e0bc5e750f
Created May 5, 2021 13:05
CE custom code snippet, copy address lat/long to Geolocation field on contact
/**
* Implements hook_ENTITY_TYPE_update().
*
* On contact update, update primary Address, giving Drupal Geolocation its value
*/
function map_customs_civicrm_contact_update(CivicrmEntity $civicrm_contact) {
if ($civicrm_contact->get('contact_type')->value !== 'Organization') {
return;
}
@jackrabbithanna
jackrabbithanna / gist:258853fbdf20dc90db9695bb817c1151
Last active May 5, 2021 12:57
CiviCRM Entity, Leaflet Map with Markerclusters + Proximity Filter example View config export
langcode: en
status: true
dependencies:
module:
- civicrm_entity
- civicrm_entity_leaflet
- options
id: proximity_with_map
label: 'Proximity with Map'
module: views
langcode: en
status: true
dependencies:
module:
- charts
- charts_google
- civicrm_entity
id: chart_demo_temp
label: 'Chart Demo Temp'
module: views
/**
* Implements hook_civicrm_post().
*
* Manage Drupal group membership when Committee Relationship is added/updated/deleted
*
* @param $op
* @param $objectName
* @param $objectId
* @param $objectRef
*/