Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
dataprocessor-token-output
Commits
db085098
Commit
db085098
authored
Nov 24, 2021
by
jaapjansma
Browse files
Made case token output compatible with send email from case and export document from case
parent
b9df5df3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Civi/DataProcessorTokenOutput/Output/CaseToken.php
View file @
db085098
...
...
@@ -11,9 +11,9 @@ use CRM_DataprocessorTokenOutput_ExtensionUtil as E;
class
CaseToken
extends
AbstractToken
{
/**
* Array containing all the related
participant
ids
* Array containing all the related
case
ids
*
* This property is set when executed from a
n participant search
action.
* This property is set when executed from a
case
action.
*
* @var array
*/
...
...
@@ -36,6 +36,10 @@ class CaseToken extends AbstractToken {
}
elseif
(
isset
(
$values
[
'extra_data'
][
'case'
][
'id'
]))
{
// Coming from CiviRules
return
$values
[
'extra_data'
][
'case'
][
'id'
];
}
elseif
(
is_array
(
self
::
$_caseIds
)
&&
count
(
self
::
$_caseIds
))
{
return
array_shift
(
self
::
$_caseIds
);
}
elseif
(
self
::
$_caseIds
)
{
return
self
::
$_caseIds
;
}
return
false
;
}
...
...
@@ -56,5 +60,22 @@ class CaseToken extends AbstractToken {
return
'case_id_field'
;
}
/**
* Extract the event ids from the event task forms.
* We need this as soon as the task is a send letter or send e-mail from the action
* after a search for participants.
*
* We can then use those event ids during the processing of the tokens.
*
* @param $form
*/
public
static
function
extractCaseIdsFromManageCaseForms
(
\
CRM_Core_Form
$form
)
{
if
(
$form
instanceof
\
CRM_Contact_Form_Task_Email
)
{
self
::
$_caseIds
=
$form
->
getVar
(
'_caseId'
);
}
elseif
(
$form
instanceof
\
CRM_Contact_Form_Task_PDF
)
{
self
::
$_caseIds
=
$form
->
getVar
(
'_caseId'
);
}
}
}
dataprocessor_token_output.php
View file @
db085098
...
...
@@ -118,6 +118,7 @@ function dataprocessor_token_output_get_token_factory() {
function
dataprocessor_token_output_civicrm_buildForm
(
$formName
,
&
$form
)
{
\
Civi\DataProcessorTokenOutput\Output\EventToken
::
extractParticipantIdsFromEventFormTasks
(
$form
);
\
Civi\DataProcessorTokenOutput\Output\ParticipantToken
::
extractParticipantIdsFromEventFormTasks
(
$form
);
\
Civi\DataProcessorTokenOutput\Output\CaseToken
::
extractCaseIdsFromManageCaseForms
(
$form
);
}
...
...
info.xml
View file @
db085098
...
...
@@ -13,8 +13,8 @@
<url
desc=
"Documentation"
>
https://lab.civicrm.org/extensions/dataprocessor-token-output/blob/master/README.md
</url>
<url
desc=
"Licensing"
>
http://www.gnu.org/licenses/agpl-3.0.html
</url>
</urls>
<releaseDate>
2021-1
0-08
</releaseDate>
<version>
1.
8
</version>
<releaseDate>
2021-1
1-24
</releaseDate>
<version>
1.
9
</version>
<develStage>
stable
</develStage>
<compatibility>
<ver>
5.13
</ver>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment