Commit 1edcc041 authored by Mathieu Lutfy's avatar Mathieu Lutfy Committed by Aegir user

#90 Helper extension for Spark signup forms (handle...

#90 Helper extension for Spark signup forms (handle the Source/Referral field)
parent d83a83e3
This diff is collapsed.
# org.civicrm.sparkforms
Helper functions for the CiviCRM Spark signup forms.
The extension is licensed under [AGPL-3.0](LICENSE.txt).
## Requirements
* PHP v5.6+
* CiviCRM (*FIXME: Version number*)
## Installation (Web UI)
This extension has not yet been published for installation via the web UI.
## Installation (CLI, Zip)
Sysadmins and developers may download the `.zip` file for this extension and
install it with the command-line tool [cv](https://github.com/civicrm/cv).
```bash
cd <extension-dir>
cv dl org.civicrm.sparkforms@https://github.com/FIXME/org.civicrm.sparkforms/archive/master.zip
```
## Installation (CLI, Git)
Sysadmins and developers may clone the [Git](https://en.wikipedia.org/wiki/Git) repo for this extension and
install it with the command-line tool [cv](https://github.com/civicrm/cv).
```bash
git clone https://github.com/FIXME/org.civicrm.sparkforms.git
cv en sparkforms
```
## Usage
(* FIXME: Where would a new user navigate to get started? What changes would they see? *)
## Known Issues
(* FIXME *)
<?xml version="1.0"?>
<extension key="org.civicrm.sparkforms" type="module">
<file>sparkforms</file>
<name>FIXME</name>
<description>FIXME</description>
<license>AGPL-3.0</license>
<maintainer>
<author>FIXME</author>
<email>FIXME</email>
</maintainer>
<urls>
<url desc="Main Extension Page">http://FIXME</url>
<url desc="Documentation">http://FIXME</url>
<url desc="Support">http://FIXME</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2019-02-01</releaseDate>
<version>1.0</version>
<develStage>alpha</develStage>
<compatibility>
<ver>5.0</ver>
</compatibility>
<comments>This is a new, undeveloped module</comments>
<civix>
<namespace>CRM/Sparkforms</namespace>
</civix>
</extension>
This diff is collapsed.
<?php
require_once 'sparkforms.civix.php';
use CRM_Sparkforms_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_config
*/
function sparkforms_civicrm_config(&$config) {
_sparkforms_civix_civicrm_config($config);
}
/**
* Implements hook_civicrm_xmlMenu().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_xmlMenu
*/
function sparkforms_civicrm_xmlMenu(&$files) {
_sparkforms_civix_civicrm_xmlMenu($files);
}
/**
* Implements hook_civicrm_install().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
*/
function sparkforms_civicrm_install() {
_sparkforms_civix_civicrm_install();
}
/**
* Implements hook_civicrm_postInstall().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_postInstall
*/
function sparkforms_civicrm_postInstall() {
_sparkforms_civix_civicrm_postInstall();
}
/**
* Implements hook_civicrm_uninstall().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_uninstall
*/
function sparkforms_civicrm_uninstall() {
_sparkforms_civix_civicrm_uninstall();
}
/**
* Implements hook_civicrm_enable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_enable
*/
function sparkforms_civicrm_enable() {
_sparkforms_civix_civicrm_enable();
}
/**
* Implements hook_civicrm_disable().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_disable
*/
function sparkforms_civicrm_disable() {
_sparkforms_civix_civicrm_disable();
}
/**
* Implements hook_civicrm_upgrade().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_upgrade
*/
function sparkforms_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
return _sparkforms_civix_civicrm_upgrade($op, $queue);
}
/**
* Implements hook_civicrm_managed().
*
* Generate a list of entities to create/deactivate/delete when this module
* is installed, disabled, uninstalled.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed
*/
function sparkforms_civicrm_managed(&$entities) {
_sparkforms_civix_civicrm_managed($entities);
}
/**
* Implements hook_civicrm_angularModules().
*
* Generate a list of Angular modules.
*
* Note: This hook only runs in CiviCRM 4.5+. It may
* use features only available in v4.6+.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules
*/
function sparkforms_civicrm_angularModules(&$angularModules) {
_sparkforms_civix_civicrm_angularModules($angularModules);
}
/**
* Implements hook_civicrm_alterSettingsFolders().
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterSettingsFolders
*/
function sparkforms_civicrm_alterSettingsFolders(&$metaDataFolders = NULL) {
_sparkforms_civix_civicrm_alterSettingsFolders($metaDataFolders);
}
/**
* Implements hook_civicrm_entityTypes().
*
* Declare entity types provided by this module.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes
*/
function sparkforms_civicrm_entityTypes(&$entityTypes) {
_sparkforms_civix_civicrm_entityTypes($entityTypes);
}
/**
* Implements hook_civicrm_buildForm().
*/
function sparkforms_civicrm_buildForm($formName, &$form) {
if ($formName == 'CRM_Contribute_Form_Contribution_Main') {
$referral = CRM_Utils_Request::retrieveValue('spark', 'Positive');
if ($referral) {
$form->setDefaults([
'custom_272' => $referral,
]);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment