Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Hanna jackrabbithanna

View GitHub Profile
View gist:c052115747553702cbf88ba08694f4a8
<?php
use Drupal\Tests\civicrm_tests\FunctionalJavascript\CivicrmFunctionalJavascriptBase;
/**
* Class CivicrmExtensionTests
*
* @group CivicrmTests
*/
class CivicrmExtensionTests extends CivicrmFunctionalJavascriptBase {
View gist:a627d24a3da48eed5e988986ab413031
<?php
namespace Drupal\Tests\civicrm_tests\FunctionalJavascript;
use Behat\Mink\Element\NodeElement;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Core\Database\Database;
/**
* Base class for CiviCRM Functional Javascript Tests
@jackrabbithanna
jackrabbithanna / gist:94d2f6cf222a01a657200d01b96882c8
Created Apr 28, 2020
Contact -> User, User -> Contact hook_views_data_alter()
View gist:94d2f6cf222a01a657200d01b96882c8
$data['civicrm_contact']['user'] = [
'title' => 'User related to the CiviCRM contact',
'help' => 'Relate user to the CiviCRM contact.',
'relationship' => [
'base' => 'users_field_data',
'base field' => 'uid',
'first field' => 'contact_id',
'second field' => 'uf_id',
'id' => 'civicrm_entity_civicrm_contact_user',
'label' => 'User',
@jackrabbithanna
jackrabbithanna / gist:a6c31b91dd9df2e79090b08590a860a4
Created Apr 28, 2020
D8 Contact -> User, User-> Contact View relationship plugin src/Plugin/views/relationship/CiviCrmContactUser.php
View gist:a6c31b91dd9df2e79090b08590a860a4
<?php
namespace Drupal\civicrm_entity\Plugin\views\relationship;
use Drupal\views\Plugin\views\relationship\RelationshipPluginBase;
use Drupal\views\Views;
/**
* Relationship for referencing civicrm_contact and user.
*
View gist:bd038c0ed0dcb2de21271d99d97d323e
class LmsLrsTestCaseSelenium extends \PHPUnit_Extensions_Selenium2TestCase {
/**
* Standard phpunit setup method.
*/
public function setUp() {
global $bootstrap;
if (!empty($bootstrap)) {
$this->bootstrap = $bootstrap;
@jackrabbithanna
jackrabbithanna / gist:170a3537adc06238d0ee9e74027727ae
Created May 25, 2017
Views export for contribution page view, with price set entity and price set relationships
View gist:170a3537adc06238d0ee9e74027727ae
$view = new view();
$view->name = 'contribution_pages';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'civicrm_contribution_page';
$view->human_name = 'Contribution Pages';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
View gist:b5eac41678ec9eefc022c44e9f21efc3
pcp_views_handlers.info:
name = PCP Views Field Handlers -- Additional
description = Adds some CiviCRM PCP Views handlers
core = 7.x
package = Custom
version = "7.x-1.0"
dependencies[] = civicrm
dependencies[] = views
@jackrabbithanna
jackrabbithanna / gist:71e407d5ffb089b4a07778b47a5629b8
Last active Jan 24, 2017
Custom FAPI multivalued element type, 2 column grid of textfields, ajax add and remove
View gist:71e407d5ffb089b4a07778b47a5629b8
/**
* Implements hook_theme().
*
* @return array
*/
function webform_multi_theme() {
return array(
'webform_multi_url_params_field' => array(
'render element' => 'element',
),
You can’t perform that action at this time.