Skip to content

Instantly share code, notes, and snippets.

View mlutfy's full-sized avatar

Mathieu Lu mlutfy

View GitHub Profile
@mlutfy
mlutfy / gist:8920137
Created February 10, 2014 17:12
templates/CRM/Contribute/Form/Contribution/Main.extra.tpl
{* [ML] fork of templates/CRM/Form/validate.tpl specific for public contribute pages *}
{* Initialize jQuery validate *}
{* Extra params and functions may be added to the CRM.validate object before this template is loaded *}
{if !$crm_form_validate_included}
{assign var=crm_form_validate_included value=1}
{literal}
<script type="text/javascript" >
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eb54ca7..8408d02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,9 @@ set(USE_LOCAL OFF CACHE BOOL "Use the locally built packages when building image
set(JOBS "2" CACHE STRING "Number of parallel compile jobs")
set(DL_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE FILEPATH "Custom download directory")
+# Packages for Reseau Libre
+set(RESEAULIBRE_PACKAGES "babeld;tinc" CACHE INTERNAL "Reseau Libre default packages")
@mlutfy
mlutfy / gist:2025727
Created March 13, 2012 00:36
Show the soft-credit for contributions details
// The soft-credit report shows contributions received from the point of view of the fundraiser (soft-credit)
// I just want to add a column to the contribution detail report
// For more info: http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviReport+structure+and+customization
<?php
// Based on CRM/Report/Form/Contribute/Detail.php
// modified to add the soft-credit column
require_once 'CRM/Report/Form/Contribute/Detail.php';
@mlutfy
mlutfy / gist:2026648
Created March 13, 2012 03:58
CiviCRM empty translation function for us-en
/**
* Implementation of hook_civicrm_config()
*/
function civicrm_l10n_civicrm_config(&$config) {
$config =& CRM_Core_Config::singleton();
$config->customTranslateFunction = 'civicrm_l10n_ts';
}
function civicrm_l10n_ts($text, $params = array()) {
@mlutfy
mlutfy / gist:2147910
Created March 21, 2012 14:55
Show PCP contributions for the logged-in user using Views (Drupal)
/**
* Implements hook_views_query_alter().
*
* HOW TO USE THIS:
* 1- Create a View that displays contributions
* 2- Add a filter to the View for "soft-credit ID = -1". This means that by
* default, no contributions will be shown.
* 3- Enter the correct $view->name for your view in the code below.
* If in doubt, use dsm($view); with the devel module enabled.
*
@mlutfy
mlutfy / gist:2205960
Created March 26, 2012 15:32
Static CiviCRM dashboard
/**
* Implements hook_civicrm_dashboard().
*
* Replaces the CiviCRM dashboard with only the Activity dashlet.
* Avoids having users setup their dashboard, and this is the only dashlet available in our installation.
*
* For more information:
* http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmdashboard
*/
function mymodule_civicrm_dashboard($contactID, &$contentPlacement) {

CiviCRM 2.1 to 4.0.7:

Patches in the upgrade scripts:

  • comment out "ALTER TABLE civicrm_domain ADD locale_custom_strings [...]" from sites/all/modules/CRM/Upgrade/Incremental/sql/3.2.alpha3.mysql.tpl
  • Comment out: Incremental/sql/3.1.beta2.mysql.tpl (towards the end, creation of civicrm_option_value.domain_id),
    -- ALTER TABLE `civicrm_option_value`
 -- ADD `domain_id` INT(10) UNSIGNED DEFAULT NULL COMMENT 'Which Domain is this option value for' AFTER `component_id`;
@mlutfy
mlutfy / babelstatus.sh
Created August 31, 2012 01:53
babeld mesh status
#!/bin/sh
#########################################################
# Display the status of the Babel mesh.
# Latest version:
# http://redmine.bidon.ca/projects/reseaulibre-scripts/repository/raw/babelstatus.sh
#
# Usage:
# babelstatus.sh : shows babel routes
# babelstatus.sh --full : show other relevant info
<?php
// Read login credentials from the aegir conf.
global $aliases;
require "/var/aegir/.drush/server_localhost.alias.drushrc.php";
if (! isset($aliases['server_localhost'])) {
die("alias not found for server_localhost");
}
@mlutfy
mlutfy / civicrm-git.make
Last active December 15, 2015 19:19
Drush makefile for CiviCRM using git
; A drush makefile for CiviCRM.
; Call using:
; drush make --working-copy civicrm.make
; drush make API version
api = 2
; Drupal core
core = 7.x