This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$usage = "Given the ID of a field mapping (e.g., for imports), returns the SQL " | |
. "required to import the mapping into another system. The output *should* be pipeable " | |
. "to mysql (not tested).\n\nExample: " . basename($argv[0]) . " <id>"; | |
// TODO: if we did this as a drush script we could leave out all the DB stuff | |
// CONFIG // | |
$db_host = 'localhost'; | |
$db_name = 'test_drupal7_civicrm'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php | |
index 54962f9..205cb0b 100644 | |
--- a/CRM/ACL/BAO/ACL.php | |
+++ b/CRM/ACL/BAO/ACL.php | |
@@ -723,14 +723,54 @@ SELECT count( a.id ) | |
} | |
/** | |
+ * Build a join and where part for a query | |
+ * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Various rewrite rules. | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteRule ^ - [E=vka_api_cache:sites/default/files/api-cache] | |
# Enable back-door and skip the rewriting | |
# Pass all requests not referring directly to files in the filesystem to | |
# index.php. Clean URLs are handled in drupal_environment_initialize(). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// MZD's JANKY CACHE | |
define('VKA_API_CACHE_DIR', '/home/vegeta85/public_html/sites/default/files/api-cache'); | |
$types = array('recipes', 'days', 'images','test'); | |
for ($d=1;$d < 32; $d++) { | |
$lastMonths = genFileNamesForDate($d, 'last'); | |
if ($lastMonths === FALSE) continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Find suspect Memberships due to contributions being linked to multiple membership-payment records | |
SELECT | |
mempay.id AS mempay_id, | |
mempay.contribution_id AS contrib_id, | |
contrib.receive_date, contrib.total_amount, | |
mempay.membership_id AS mem_id, memtype.name, | |
c_contrib.display_name AS contrib_contact_name, c_contrib.id AS contrib_contact_id, | |
c_mem.id AS mem_contact_id, c_mem.display_name AS mem_contact_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$participants = civicrm_api3('Participant', 'get', array( | |
'sequential' => 1, | |
'status_id' => "Registered", | |
'event_id' => array( | |
'IN' => $event_ids | |
), | |
// Get price set info if available in line below | |
'api.LineItem.get' => array('entity_table' => "civicrm_participant", 'entity_id' => "\$value.participant_id") | |
)) ['values']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** | |
* Suggestion for a utility function or pattern for API Exceptions | |
***/ | |
$params = array( | |
'name' => $optionName, | |
'label' => ts($optionLabel, array('domain' => 'org.civicrm')), | |
'option_group_id' => null, // so it will cause an exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SITE=sandbox-volunteer.leadercenter.org | |
HTDOCS=/home/leaderce/websites/$SITE/htdocs | |
DRUSH=/usr/local/bin/drush | |
pushd $HTDOCS > /dev/null | |
while read line ; do | |
read contact_id | |
$DRUSH cvapi --out=pretty \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
__print_completions() { | |
printf '%s\n' "${COMPREPLY[@]}" | |
} | |
# load bash-completion functions | |
source /etc/bash_completion | |
_ansible_wrapper() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// example call, specifying bit-flags, | |
// returns as string: | |
echo listEnabledErrorReportingFlags(E_ALL & ~(E_WARNING|E_NOTICE|E_STRICT)); | |
// example call, using current bit-flags, | |
// returns as array: | |
var_export(listEnabledErrorReportingFlags(null, TRUE)); |