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
/* | |
DROP TABLE IF EXISTS days; | |
CREATE TABLE days ( | |
day_of_year int NOT NULL | |
); | |
DROP TABLE IF EXISTS recurrence_rules; | |
CREATE TABLE recurrence_rules ( |
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
CREATE ALGORITHM=UNDEFINED DEFINER=`mzd`@`localhost` SQL SECURITY DEFINER VIEW `find_inbound_emails` | |
AS select | |
`opt`.`name` AS `record_type` | |
,`ac`.`record_type_id` AS `record_type_id` | |
,`act`.`id` AS `id` | |
,`act`.`subject` AS `subject` | |
,`act`.`activity_date_time` AS `activity_date_time` | |
,`ac`.`contact_id` AS `contact_id` | |
,`cont`.`display_name` AS `display_name` | |
FROM (((`civicrm_activity` `act` |
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
#!/usr/bin/php | |
<?php | |
/*** | |
* generates xml config for import to civicrm as Option Group Values | |
* | |
* cat interests.html | ./parse-interests-options-values.php > xml/option_values.xml | |
* | |
* STDIN should be html Select-list, each option on a line | |
***/ |
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
-- SELECT count(*) from unsubscribes uns INNER JOIN import_unsubscribes_aug5 imp on uns.email = imp.email | |
--DELETE FROM import_unsubscribes_aug5 where email in (SELECT DISTINCT email from unsubscribes); | |
INSERT INTO unsubscribes ( | |
SELECT nextval('unsubscribes_id_seq'), uns.email, 'manual-unsub', sent.member_id, now(), now(), null, null, sent_id | |
FROM | |
import_unsubscribes_aug5 uns | |
INNER JOIN |
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
civix_conf_db() { | |
conf_path=`readlink -f $1` | |
echo "setting civicrm_api3_conf_path to $conf_path" | |
civix config:set civicrm_api3_conf_path $conf_path | |
civix civicrm:ping | |
} |
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
function findFullPathInArray($array, $search, $path=array()) { | |
if (!is_array($array)) return FALSE; | |
$try_path = $path; | |
foreach($array as $key => $item) { | |
if ($key == $search) { // found | |
$path[] = $search; | |
return $path; | |
} | |
$try_path[] = $key; |
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 | |
$sql = 'show tables'; | |
$db = $argv[1]; | |
$tables = array(); | |
exec("echo '$sql' | mysql $db", $tables); | |
$prefix = <<<'TPL' | |
<?php |
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
var ConfirmRouteBase = { | |
getParams: function() { | |
var ctlSchedule = this.controllerFor('schedule'); | |
this.data = ctlSchedule.get('userInput'); | |
this.data.email_optin = 1; | |
this.data.occurrence_id = ctlSchedule.get('appointment').id; | |
this.data.sms_optin = 1; | |
return this.data; |
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/bin/cli.class.php b/bin/cli.class.php | |
index de72c47..5906656 100644 | |
--- a/bin/cli.class.php | |
+++ b/bin/cli.class.php | |
@@ -45,6 +45,7 @@ class civicrm_cli { | |
var $_entity = NULL; | |
var $_action = NULL; | |
var $_output = FALSE; | |
+ var $_json = FALSE; | |
var $_joblog = FALSE; |
OlderNewer