Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
form-processor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mattwire
form-processor
Commits
1b1c59f8
Commit
1b1c59f8
authored
6 years ago
by
jaapjansma
Browse files
Options
Downloads
Patches
Plain Diff
added campaign type
parent
fdbf336a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+3
-2
3 additions, 2 deletions
CHANGELOG.md
Civi/FormProcessor/Type/CampaignType.php
+65
-0
65 additions, 0 deletions
Civi/FormProcessor/Type/CampaignType.php
Civi/FormProcessor/Type/Factory.php
+1
-0
1 addition, 0 deletions
Civi/FormProcessor/Type/Factory.php
with
69 additions
and
2 deletions
CHANGELOG.md
+
3
−
2
View file @
1b1c59f8
...
...
@@ -2,10 +2,11 @@ Version 1.2
===========
*
Implemented the refactored action provider
*
Remoed the action provider for default data actions, all actions are now available at the default data.
*
Removed the action provider for default data actions, all actions are now available at the default data.
*
Added a Campaign Type
**
Importanted notices when you are updating
**
*
You have also to update the action provider extension
*
When you have a _Create/Update Group_ action in your form processor you have to check that form processor
because this action has been renamed in the action provider extension.
\ No newline at end of file
because this action has been renamed in the action provider extension.
This diff is collapsed.
Click to expand it.
Civi/FormProcessor/Type/CampaignType.php
0 → 100644
+
65
−
0
View file @
1b1c59f8
<?php
/**
* @author Jaap Jansma (CiviCooP) <jaap.jansma@civicoop.org>
* @license http://www.gnu.org/licenses/agpl-3.0.html
*/
namespace
Civi\FormProcessor\Type
;
use
\Civi\FormProcessor\Config\Specification
;
use
\Civi\FormProcessor\Config\SpecificationBag
;
use
\Civi\FormProcessor\Type\AbstractType
;
use
\Civi\FormProcessor\Type\OptionListInterface
;
use
\CRM_FormProcessor_ExtensionUtil
as
E
;
class
CampaignType
extends
AbstractType
implements
OptionListInterface
{
/**
* Get the configuration specification
*
* @return SpecificationBag
*/
public
function
getConfigurationSpecification
()
{
return
new
SpecificationBag
(
array
());
}
public
function
validateValue
(
$value
,
$allValues
=
array
())
{
$options
=
$this
->
getOptions
();
if
(
!
is_array
(
$value
))
{
if
(
\CRM_Utils_Type
::
validate
(
$value
,
'Integer'
,
FALSE
)
===
NULL
)
{
return
FALSE
;
}
if
(
!
isset
(
$options
[
$value
]))
{
return
FALSE
;
}
}
else
{
return
FALSE
;
}
return
true
;
}
/**
* Returns the type number from CRM_Utils_Type
*/
public
function
getCrmType
()
{
return
\CRM_Utils_Type
::
T_INT
;
}
public
function
getOptions
(
$params
)
{
static
$return
;
if
(
$return
)
{
return
$return
;
}
$groups
=
civicrm_api3
(
'Campaign'
,
'get'
,
array
(
'is_active'
=>
1
,
'options'
=>
array
(
'limit'
=>
0
)));
$return
=
array
();
foreach
(
$groups
[
'values'
]
as
$group
)
{
$return
[
$group
[
'id'
]]
=
$group
[
'title'
];
}
return
$return
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Civi/FormProcessor/Type/Factory.php
+
1
−
0
View file @
1b1c59f8
...
...
@@ -33,6 +33,7 @@
$this
->
addType
(
new
CountryType
(
'Country'
,
E
::
ts
(
'Country'
)));
$this
->
addType
(
new
MailingGroupType
(
'MailingGroup'
,
E
::
ts
(
'Mailing Group'
)));
$this
->
addType
(
new
ParticipantStatusType
(
'ParticipantStatusType'
,
E
::
ts
(
'Participant Status'
)));
$this
->
addType
(
new
CampaignType
(
'CampaignType'
,
E
::
ts
(
'Campaign'
)));
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment