Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14858

Refactor CiviGrant from component to extension

    Details

    • Type: Task
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.4.5
    • Fix Version/s: 4.7
    • Component/s: CiviGrant
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      Remove CiviGrant component from core and place in an extension.

      On upgrade, CiviGrant component should be removed. If CiviGrant component was enabled, upgrade should install and enable CiviGrant extension. If CiviGrant was disabled and there is no grant data, drop tables and remove option groups/values. If there is grant data (regardless of whether CiviGrant component was enabled or not), upgrade data as required so that all grant data including custom fields and customized option_values will work properly if CiviGrant extension is installed and enabled. Aim to reduce effort and improve backwards compatibility of custom code by not changing the tables or fields or option_values if possible.

      After CiviGrant removed from core, there should be no broken tests as a result of the removal.

      Include in the extension the functionality currently in Grant Application Pages.

      Please start by create an estimate of the effort involved using a bottom up method of identifying all tasks and putting a rough estimate on them. Create a few subtasks under this one to help manage the project.

      I would start by examining the files that need to be moved and / or modified. We should aim to keep scope limited by trying not to reimplement stuff if not required during refactoring into an extension.

      Step 1: Remove CiviGrant from core
      Files needing to be updated in core and/or migrated to extension:
      $ grep -Rli grant ./*
      ./CRM/ACL/BAO/ACL.php
      ./CRM/ACL/Form/WordPress/Permissions.php
      ./CRM/Activity/BAO/Activity.php
      ./CRM/Case/BAO/Case.php
      ./CRM/Contact/BAO/Contact.php
      ./CRM/Contact/BAO/GroupContact.php
      ./CRM/Contact/BAO/Query.php
      ./CRM/Contact/Page/View/Note.php
      ./CRM/Contact/Page/View.php
      ./CRM/Core/BAO/CustomGroup.php
      ./CRM/Core/BAO/CustomQuery.php
      ./CRM/Core/BAO/Mapping.php
      ./CRM/Core/OptionGroup.php
      ./CRM/Core/Page/Basic.php
      ./CRM/Core/Permission.php
      ./CRM/Core/SelectValues.php
      ./CRM/Core/xml/Menu/Admin.xml
      ./CRM/Custom/Form/Group.php
      ./CRM/Custom/Page/Group.php
      ./CRM/Dedupe/Merger.php
      ./CRM/Export/BAO/Export.php
      ./CRM/Export/Form/Select.php
      ./CRM/Financial/BAO/FinancialTypeAccount.php
      ./CRM/Grant/BAO/Grant.php
      ./CRM/Grant/BAO/Query.php
      ./CRM/Grant/Config.php
      ./CRM/Grant/Controller/Search.php
      ./CRM/Grant/Form/Grant.php
      ./CRM/Grant/Form/GrantView.php
      ./CRM/Grant/Form/Search.php
      ./CRM/Grant/Form/Task/Delete.php
      ./CRM/Grant/Form/Task/Print.php
      ./CRM/Grant/Form/Task/Result.php
      ./CRM/Grant/Form/Task/SearchTaskHookSample.php
      ./CRM/Grant/Form/Task/Update.php
      ./CRM/Grant/Form/Task.php
      ./CRM/Grant/Info.php
      ./CRM/Grant/Page/DashBoard.php
      ./CRM/Grant/Page/Tab.php
      ./CRM/Grant/Selector/Search.php
      ./CRM/Grant/StateMachine/Search.php
      ./CRM/Grant/Task.php
      ./CRM/Grant/xml/Menu/Grant.xml
      ./CRM/Member/Form/MembershipView.php
      ./CRM/Report/Form/Grant/Detail.php
      ./CRM/Report/Form/Grant/Statistics.php
      ./CRM/Upgrade/Incremental/php/FourThree.php
      ./CRM/Upgrade/Incremental/php/ThreeFour.php
      ./CRM/Upgrade/Incremental/sql/2.2.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.0.0.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.0.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.0.beta4.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.1.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.1.beta2.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.1.beta5.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.2.2.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.2.3.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.2.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.2.alpha3.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.3.4.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.3.6.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.3.beta1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/3.4.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/4.1.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/4.2.7.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl
      ./CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl
      ./CRM/Upgrade/TwoOne/Form/Step1.php
      ./CRM/Upgrade/TwoOne/sql/group_values.mysql
      ./CRM/Upgrade/TwoOne/sql/misc.mysql
      ./CRM/Utils/Hook.php
      ./CRM/Utils/System/Drupal.php
      ./CRM/Utils/VersionCheck.php
      ./agpl-3.0.exception.txt
      ./agpl-3.0.txt
      ./api/v3/examples/Grant/Create.php
      ./api/v3/examples/Grant/Delete.php
      ./api/v3/examples/Grant/Get.php
      ./api/v3/examples/Setting/GetFields.php
      ./api/v3/Grant.php
      ./css/civicrm.css
      ./gpl.txt
      ./install/index.php
      ./settings/Core.setting.php
      ./sql/civicrm_generated.mysql
      ./sql/civicrm_generated_report.mysql
      ./sql/civicrm_upgradedb_v1.5_v1.6_40.mysql
      ./sql/civicrm_upgradedb_v1.5_v1.6_41.mysql
      ./sql/sample_data.xml
      ./sql/test_data_second_domain.mysql
      ./sql/zipcodes.mysql
      ./templates/CRM/ACL/Form/ACL.tpl
      ./templates/CRM/ACL/Form/ACLBasic.tpl
      ./templates/CRM/ACL/Form/WordPress/Permissions.tpl
      ./templates/CRM/Admin/Form/Navigation.hlp
      ./templates/CRM/Admin/Form/Preferences/Display.tpl
      ./templates/CRM/Admin/Form/Setting/Component.hlp
      ./templates/CRM/Admin/Form/Setting/Miscellaneous.tpl
      ./templates/CRM/Admin/Page/Access.tpl
      ./templates/CRM/Admin/Page/ConfigTaskList.tpl
      ./templates/CRM/Admin/Page/Options.tpl
      ./templates/CRM/Admin/Page/Setting.tpl
      ./templates/CRM/Grant/Form/Grant.tpl
      ./templates/CRM/Grant/Form/GrantView.tpl
      ./templates/CRM/Grant/Form/Search/AdvancedSearchPane.tpl
      ./templates/CRM/Grant/Form/Search/Common.tpl
      ./templates/CRM/Grant/Form/Search.tpl
      ./templates/CRM/Grant/Form/Selector.tpl
      ./templates/CRM/Grant/Form/Task/Delete.tpl
      ./templates/CRM/Grant/Form/Task/Print.tpl
      ./templates/CRM/Grant/Form/Task/SearchTaskHookSample.tpl
      ./templates/CRM/Grant/Form/Task/Update.tpl
      ./templates/CRM/Grant/Form/Task.tpl
      ./templates/CRM/Grant/Page/DashBoard.tpl
      ./templates/CRM/Grant/Page/Tab.tpl
      ./templates/CRM/Member/Form/MembershipType.tpl
      ./templates/CRM/Member/Page/MembershipType.hlp
      ./templates/CRM/Report/Form/Case/Detail.tpl
      ./templates/CRM/Report/Form/Criteria.tpl
      ./templates/CRM/Report/Form/Grant/Statistics.tpl
      ./tests/phpunit/api/v3/ActivityTest.php
      ./tests/phpunit/api/v3/ContactTypeTest.php
      ./tests/phpunit/api/v3/GrantTest.php
      ./tests/phpunit/api/v3/SyntaxConformanceTest.php
      ./tests/phpunit/CiviTest/civicrm.settings.dist.php
      ./tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php
      ./tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php
      ./tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php
      ./tests/phpunit/CRM/Core/PseudoConstantTest.php
      ./tests/phpunit/CRM/Member/Form/MembershipTest.php
      ./tests/phpunit/CRM/Report/Form/Contribute/fixtures/dataset-ascii.sql
      ./tests/phpunit/CRM/Report/Form/Contribute/fixtures/report-ascii.csv
      ./tests/phpunit/CRM/Report/Form/Contribute/fixtures/report.csv
      ./tests/phpunit/WebTest/Campaign/PledgeTest.php
      ./tests/phpunit/WebTest/Contact/AddTest.php
      ./tests/phpunit/WebTest/Contact/RelationshipAddTest.php
      ./tests/phpunit/WebTest/Grant/ContactContextAddTest.php
      ./tests/phpunit/WebTest/Grant/CustomFieldsetTest.php
      ./tests/phpunit/WebTest/Grant/StandaloneAddTest.php
      ./tools/drupal/modules/civicrm_webtest/civicrm_webtest.install
      ./tools/extensions/org.civicrm.angularex/LICENSE.txt
      ./tools/extensions/org.civicrm.report.grant/Grant.php
      ./tools/extensions/org.civicrm.report.grant/info.xml
      ./tools/extensions/org.civicrm.report.grant.zip
      ./tools/scripts/mk-drupal-test-site
      ./tools/scripts/solr/database.xml
      ./tools/sites/latest/stable.php
      ./tools/sites/stats/index.php
      ./tools/sites/stats/stats.php
      ./xml/schema/ACL/ACL.xml
      ./xml/schema/Financial/EntityFinancialTrxn.xml
      ./xml/schema/Grant/files.xml
      ./xml/schema/Grant/Grant.xml
      ./xml/schema/Schema.xml
      ./xml/templates/civicrm_acl.tpl
      ./xml/templates/civicrm_data.tpl
      ./xml/templates/civicrm_navigation.tpl

      Step 2: Create CiviGrant extension including core functionality for API, UX, Reports, accounting integration, unit tests, and web tests.

      Step 3: Integrate Grant Application Pages extension into CiviGrant extension.

      Step 4: Make it so that as part of enabling extension, core component is disabled permanently, with suitable warnings and messages about creating backups. The intent is for this to be the upgrade path for the 4.6 version: if CiviGrant component data exists or CiviGrant component is enabled, install and enable CiviGrant extension and migrate data to it.

        Attachments

          Activity

            People

            • Assignee:
              pradeep.nayak Pradeep Nayak
              Reporter:
              joemurray Joe Murray
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 weeks, 1 day, 4 hours
                3w 1d 4h
                Remaining:
                Remaining Estimate - 3 weeks, 1 day, 4 hours
                3w 1d 4h
                Logged:
                Time Spent - Not Specified
                Not Specified