jenkins-bot has submitted this change and it was merged.

Change subject: CiviCRM database name is configurable
......................................................................


CiviCRM database name is configurable

Change-Id: I826428a4840ed6f89e544dbef6b18a9787afed90
---
M defaults.js
M widgets/big-english.js
2 files changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Ssmith: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/defaults.js b/defaults.js
index 4c93e6b..5e73b05 100644
--- a/defaults.js
+++ b/defaults.js
@@ -2,6 +2,7 @@
     listen: '8080',
     dbserver: 'localhost',
     db: 'fredge',
+    civicrmDb: 'civicrm',
     dblogin: 'testuser',
     dbpwd: 'testpassword',
        // URL to redirect the user's browser to
diff --git a/widgets/big-english.js b/widgets/big-english.js
index 3c74562..22d84f0 100644
--- a/widgets/big-english.js
+++ b/widgets/big-english.js
@@ -1,6 +1,8 @@
+var config = require( '../config.js' );
+
 module.exports = {
        name: 'big-english',
-       query: 'select count(*) as donations, sum(total_amount) as usd_total,\n 
IF( day(receive_date) = day(utc_timestamp()) and hour(receive_date) = 
hour(utc_timestamp()), CEILING(TIMESTAMPDIFF(SECOND, MIN(receive_date), 
MAX(receive_date))/60), 60) as minutes, sum(total_amount)/IF( day(receive_date) 
= day(utc_timestamp()) and hour(receive_date) = hour(utc_timestamp()), 
CEILING(TIMESTAMPDIFF(SECOND, MIN(receive_date), MAX(receive_date))/60), 60)/60 
as usd_per_second, DAY(receive_date) as day, HOUR(receive_date) as hour from 
civicrm.civicrm_contribution cc [[WHERE]] GROUP BY DAY(receive_date), 
HOUR(receive_date) ORDER BY day ASC, hour ASC;',
+       query: 'select count(*) as donations, sum(total_amount) as usd_total,\n 
IF( day(receive_date) = day(utc_timestamp()) and hour(receive_date) = 
hour(utc_timestamp()), CEILING(TIMESTAMPDIFF(SECOND, MIN(receive_date), 
MAX(receive_date))/60), 60) as minutes, sum(total_amount)/IF( day(receive_date) 
= day(utc_timestamp()) and hour(receive_date) = hour(utc_timestamp()), 
CEILING(TIMESTAMPDIFF(SECOND, MIN(receive_date), MAX(receive_date))/60), 60)/60 
as usd_per_second, DAY(receive_date) as day, HOUR(receive_date) as hour from ' 
+ config.civicrmDb + '.civicrm_contribution cc [[WHERE]] GROUP BY 
DAY(receive_date), HOUR(receive_date) ORDER BY day ASC, hour ASC;',
        mainTableAlias: 'cc',
        optionalJoins: {},
        filters: {

-- 
To view, visit https://gerrit.wikimedia.org/r/178057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I826428a4840ed6f89e544dbef6b18a9787afed90
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to