Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

colemanw

🎯
Focusing
Block or report user

Report or block colemanw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BulkSaveTrait.php
<?php
/**
* Trait mixed into BAOs who support bulk-save operations
*/
trait CRM_Core_BulkSaveTrait {
/**
* @param $params
* @return CRM_Core_DAO|NULL
@colemanw
colemanw / webform_civicrm.utils.diff
Last active Feb 21, 2019
Add tag fields for multiple entities
View webform_civicrm.utils.diff
diff --git a/includes/utils.inc b/includes/utils.inc
index dc502c5..97757dc 100644
--- a/includes/utils.inc
+++ b/includes/utils.inc
@@ -806,16 +806,6 @@ function wf_crm_get_fields($var = 'fields') {
'table' => 'group',
'expose_list' => TRUE,
);
- $tagsets = array('' => t('Tag(s)')) + CRM_Core_BAO_Tag::getTagSet('civicrm_contact');
- foreach ($tagsets as $pid => $name) {
@colemanw
colemanw / font-awesome-mime-type-icons.php
Last active Jan 27, 2020 — forked from guedressel/font-awesome-mime-type-icons.php
Font Awesome File Icons: Mapping MIME Types to correct icon classes
View font-awesome-mime-type-icons.php
<?php
/**
* Get font awesome file icon class for specific MIME Type
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551
*
*/
function ($mime_type) {
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
$icon_classes = array(
@colemanw
colemanw / gitpr
Last active Oct 14, 2016
GitPR script
View gitpr
#!/bin/bash
# start at top directory if we're not already there
pushd "$(git rev-parse --show-toplevel)" > /dev/null
# run style checker
civilint
if [[ $? == 1 ]]
then
echo "PR aborted"
View EntityTables.diff
diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php
index ef7dff8..da06824 100644
--- a/CRM/Core/BAO/Note.php
+++ b/CRM/Core/BAO/Note.php
@@ -574,4 +574,19 @@ WHERE participant.contact_id = %1 AND note.entity_table = 'civicr
m_participant'
}
}
+ /**
View OptionsInSchema.diff
diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php
index 86c211a..a6f417b 100644
--- a/CRM/Core/CodeGen/Specification.php
+++ b/CRM/Core/CodeGen/Specification.php
@@ -416,6 +416,8 @@ class CRM_Core_CodeGen_Specification {
'callback',
// Path to options edit form
'optionEditPath',
+ // A simple list of options. I miss enum fields...
+ 'options',
View RemovePlaceholderOption.diff
diff --git a/js/Common.js b/js/Common.js
index 6fa4589..abbea0c 100644
--- a/js/Common.js
+++ b/js/Common.js
@@ -401,9 +401,6 @@ if (!CRM.vars) CRM.vars = {};
// Defaults for single-selects
if ($el.is('select:not([multiple])')) {
settings.minimumResultsForSearch = 10;
- if ($('option:first', this).val() === '') {
- settings.placeholderOption = 'first';
View select2_option_fix.diff
diff --git a/js/Common.js b/js/Common.js
index 6fa4589..a882280 100644
--- a/js/Common.js
+++ b/js/Common.js
@@ -409,6 +409,15 @@ if (!CRM.vars) CRM.vars = {};
if (settings.ajax) {
$el.addClass('crm-ajax-select');
}
+
+ if (settings.placeholder || settings.placeholderOption || $el.data('placeholder') || $el.a
@colemanw
colemanw / Fee.php
Created May 6, 2015
Change payment_processor field to use EntityRef
View Fee.php
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
View gist:a83c9b06af12d653671b
// Currently going to latest.civicrm.org/stable.php outputs:
4.5.4
// Proposed new output
{
"4.2": {
"status": "lts", // one of "lts", "eol", "stable" or "testing"
"releases": [
{"version": "4.2.alpha1", "date": "2012-06-08"},
{"version": "4.2.alpha2", "date": "2012-06-20"},
You can’t perform that action at this time.