Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/269885

Change subject: Adjust donor field labels to indicate they are fiscal year.
......................................................................

Adjust donor field labels to indicate they are fiscal year.

'Is 2016 Donor' actually means 'Is FY 2016-2017 Donor'

Bug: T126543
Change-Id: I55298765c81d3ded375ab2e274b7577d0b01aa10
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 18 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/85/269885/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 5ba9f57..cf14682 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -1081,11 +1081,12 @@
     $custom_group = array_pop($result);
 
        for ($year = WMF_MIN_ROLLUP_YEAR; $year <= WMF_MAX_ROLLUP_YEAR; 
$year++) {
+    $nextYear = $year + 1;
                $success = $api->CustomField->create(array(
                        'custom_group_id' => $custom_group->id,
                        'name' => "is_{$year}_donor",
                        'column_name' => "is_{$year}_donor",
-                       'label' => ts("Is {$year} donor"),
+                       'label' => ts("Is FY {$year}-{$nextYear} donor"),
                        'data_type' => 'Boolean',
                        'html_type' => 'Radio',
                        'default_value' => 0,
@@ -1739,3 +1740,19 @@
      )
    );
 }
+
+/**
+ * T126543 adjust donor field labels to indicate they are fiscal year.
+ *
+ * 'Is 2016 Donor' actually means 'Is FY 2016-2017 Donor'
+ */
+function wmf_civicrm_update_7141() {
+  civicrm_initialize();
+  $fields = civicrm_api3('CustomField', 'get', array('custom_group_id' => 
'wmf_donor'));
+  foreach ($fields['values'] as $field) {
+    $fieldNameParts = explode('_', $field['name']);
+    if ($fieldNameParts[0] == 'is' && $fieldNameParts[2] == 'donor') {
+      civicrm_api3('CustomField', 'create', array('id' => $field['id'], 
'label' => 'Is FY ' . $fieldNameParts[1] . '-' . ($fieldNameParts[1] + 1) . ' 
donor'));
+    }
+  }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55298765c81d3ded375ab2e274b7577d0b01aa10
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>

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

Reply via email to